The friendly Operating System for the Internet of Things
nucleo144-common/include/board_common.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Inria
3  * 2017 OTAKeys
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
23 #ifndef BOARD_COMMON_H
24 #define BOARD_COMMON_H
25 
26 #include "cpu.h"
27 #include "periph_conf.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
37 #define LED0_PIN GPIO_PIN(PORT_B, 0)
38 #define LED0_MASK (1 << 0)
39 #define LED0_ON (GPIOB->BSRR = LED0_MASK)
40 #define LED0_OFF (GPIOB->BSRR = (LED0_MASK << 16))
41 #define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK)
42 
43 #define LED1_PIN GPIO_PIN(PORT_B, 7)
44 #define LED1_MASK (1 << 7)
45 #define LED1_ON (GPIOB->BSRR = LED1_MASK)
46 #define LED1_OFF (GPIOB->BSRR = (LED1_MASK << 16))
47 #define LED1_TOGGLE (GPIOB->ODR ^= LED1_MASK)
48 
49 #define LED2_PIN GPIO_PIN(PORT_B, 14)
50 #define LED2_MASK (1 << 14)
51 #define LED2_ON (GPIOB->BSRR = LED2_MASK)
52 #define LED2_OFF (GPIOB->BSRR = (LED2_MASK << 16))
53 #define LED2_TOGGLE (GPIOB->ODR ^= LED2_MASK)
54 
59 #define BTN_B1_PIN GPIO_PIN(PORT_C, 13)
60 
64 void board_init(void);
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /* BOARD_COMMON_H */
71 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.