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 
20 #ifndef BOARD_H
21 #define BOARD_H
22 
23 #include "cpu.h"
24 #include "periph_conf.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #define LED0_PIN GPIO_PIN(PORT_A, 1)
35 #define LED1_PIN GPIO_PIN(PORT_A, 3)
36 #define LED2_PIN GPIO_PIN(PORT_A, 2)
37 
38 #define LED_PORT GPIOA
39 #define LED0_MASK (1 << 1)
40 #define LED1_MASK (1 << 3)
41 #define LED2_MASK (1 << 2)
42 
43 #define LED0_ON (LED_PORT->BSRR = LED0_MASK)
44 #define LED0_OFF (LED_PORT->BSRR = (LED0_MASK << 16))
45 #define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
46 
47 #define LED1_ON (LED_PORT->BSRR = LED1_MASK)
48 #define LED1_OFF (LED_PORT->BSRR = (LED1_MASK << 16))
49 #define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
50 
51 #define LED2_ON (LED_PORT->BSRR = LED2_MASK)
52 #define LED2_OFF (LED_PORT->BSRR = (LED2_MASK << 16))
53 #define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
54 
59 void board_init(void);
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif /* BOARD_H */
66 
periph_conf.h
board_init
void board_init(void)
Board level initialization.