The friendly Operating System for the Internet of Things
f4vi1/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 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 
22 #ifndef BOARD_H
23 #define BOARD_H
24 
25 #include "cpu.h"
26 #include "periph_conf.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
36 #define LED0_PIN GPIO_PIN(PORT_A, 1)
37 #define LED1_PIN GPIO_PIN(PORT_A, 3)
38 #define LED2_PIN GPIO_PIN(PORT_A, 2)
39 
40 #define LED_PORT GPIOA
41 #define LED0_MASK (1 << 1)
42 #define LED1_MASK (1 << 3)
43 #define LED2_MASK (1 << 2)
44 
45 #define LED0_ON (LED_PORT->BSRR = LED0_MASK)
46 #define LED0_OFF (LED_PORT->BSRR = (LED0_MASK << 16))
47 #define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
48 
49 #define LED1_ON (LED_PORT->BSRR = LED1_MASK)
50 #define LED1_OFF (LED_PORT->BSRR = (LED1_MASK << 16))
51 #define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
52 
53 #define LED2_ON (LED_PORT->BSRR = LED2_MASK)
54 #define LED2_OFF (LED_PORT->BSRR = (LED2_MASK << 16))
55 #define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
56 
61 void board_init(void);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif /* BOARD_H */
68 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.