The friendly Operating System for the Internet of Things
weio/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
21 #ifndef BOARD_H
22 #define BOARD_H
23 
24 #include <stdint.h>
25 
26 #include "bitarithm.h"
27 #include "cpu.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
37 #define LED0_PIN GPIO_PIN(1, 13)
38 #define LED1_PIN GPIO_PIN(1, 14)
39 #define LED2_PIN GPIO_PIN(1, 15)
40 
41 #define LED_PORT LPC_GPIO
42 #define LED0_MASK BIT13
43 #define LED1_MASK BIT14
44 #define LED2_MASK BIT15
45 
46 #define LED0_ON (LED_PORT->CLR[1] = LED0_MASK)
47 #define LED0_OFF (LED_PORT->SET[1] = LED0_MASK)
48 #define LED0_TOGGLE (LED_PORT->NOT[1] = LED0_MASK)
49 
50 #define LED1_ON (LED_PORT->CLR[1] = LED1_MASK)
51 #define LED1_OFF (LED_PORT->SET[1] = LED1_MASK)
52 #define LED1_TOGGLE (LED_PORT->NOT[1] = LED1_MASK)
53 
54 #define LED2_ON (LED_PORT->CLR[1] = LED2_MASK)
55 #define LED2_OFF (LED_PORT->SET[1] = LED2_MASK)
56 #define LED2_TOGGLE (LED_PORT->NOT[1] = LED2_MASK)
57 
62 void board_init(void);
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif /* BOARD_H */
69 
void board_init(void)
Initialize board specific hardware, include clocks, LEDs and stdio.
Helper functions for bit arithmetic.