mbed_lpc1768/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 INRIA
3  * Copyright (C) 2014 Freie Universit├Ąt Berlin
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser General
6  * Public License v2.1. See the file LICENSE in the top level directory for more
7  * details.
8  */
9 
23 #ifndef BOARD_H
24 #define BOARD_H
25 
26 #include <stdint.h>
27 
28 #include "bitarithm.h"
29 #include "cpu.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
39 #define LED0_PIN GPIO_PIN(1, 18)
40 #define LED1_PIN GPIO_PIN(1, 20)
41 #define LED2_PIN GPIO_PIN(1, 21)
42 #define LED3_PIN GPIO_PIN(1, 23)
43 
44 #define LED_PORT (LPC_GPIO1)
45 #define LED0_MASK (BIT18)
46 #define LED1_MASK (BIT20)
47 #define LED2_MASK (BIT21)
48 #define LED3_MASK (BIT23)
49 
50 #define LED0_ON (LED_PORT->FIOSET = LED0_MASK)
51 #define LED0_OFF (LED_PORT->FIOCLR = LED0_MASK)
52 #define LED0_TOGGLE (LED_PORT->FIOPIN ^= LED0_MASK)
53 #define LED1_ON (LED_PORT->FIOSET = LED1_MASK)
54 #define LED1_OFF (LED_PORT->FIOCLR = LED1_MASK)
55 #define LED1_TOGGLE (LED_PORT->FIOPIN ^= LED1_MASK)
56 #define LED2_ON (LED_PORT->FIOSET = LED2_MASK)
57 #define LED2_OFF (LED_PORT->FIOCLR = LED2_MASK)
58 #define LED2_TOGGLE (LED_PORT->FIOPIN ^= LED2_MASK)
59 #define LED3_ON (LED_PORT->FIOSET = LED3_MASK)
60 #define LED3_OFF (LED_PORT->FIOCLR = LED3_MASK)
61 #define LED3_TOGGLE (LED_PORT->FIOPIN ^= LED3_MASK)
62 
67 void board_init(void);
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif /* BOARD_H */
74 
void board_init(void)
Initialize board specific hardware, include clocks, LEDs and stdio.
Helper functions for bit arithmetic.