seeeduino_arch-pro/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 INRIA
3  * Copyright (C) 2016 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 
24 #ifndef BOARD_H
25 #define BOARD_H
26 
27 #include <stdint.h>
28 
29 #include "bitarithm.h"
30 #include "cpu.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
40 #define LED0_PIN GPIO_PIN(1, 18)
41 #define LED1_PIN GPIO_PIN(1, 20)
42 #define LED2_PIN GPIO_PIN(1, 21)
43 #define LED3_PIN GPIO_PIN(1, 23)
44 
45 #define LED_PORT (LPC_GPIO1)
46 #define LED0_MASK (BIT18)
47 #define LED1_MASK (BIT20)
48 #define LED2_MASK (BIT21)
49 #define LED3_MASK (BIT23)
50 
51 #define LED0_ON (LED_PORT->FIOCLR = LED0_MASK)
52 #define LED0_OFF (LED_PORT->FIOSET = LED0_MASK)
53 #define LED0_TOGGLE (LED_PORT->FIOPIN ^= LED0_MASK)
54 #define LED1_ON (LED_PORT->FIOCLR = LED1_MASK)
55 #define LED1_OFF (LED_PORT->FIOSET = LED1_MASK)
56 #define LED1_TOGGLE (LED_PORT->FIOPIN ^= LED1_MASK)
57 #define LED2_ON (LED_PORT->FIOCLR = LED2_MASK)
58 #define LED2_OFF (LED_PORT->FIOSET = LED2_MASK)
59 #define LED2_TOGGLE (LED_PORT->FIOPIN ^= LED2_MASK)
60 #define LED3_ON (LED_PORT->FIOCLR = LED3_MASK)
61 #define LED3_OFF (LED_PORT->FIOSET = LED3_MASK)
62 #define LED3_TOGGLE (LED_PORT->FIOPIN ^= LED3_MASK)
63 
68 void board_init(void);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* BOARD_H */
75 
Helper functions for bit arithmetic.
void board_init(void)
Initialize board specific hardware, include clocks, LEDs and stdio.