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 #include "arduino_pinmap.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
38 #define LED0_PIN GPIO_PIN(PORT_B, 0)
39 #define LED0_MASK (1 << 0)
40 #define LED0_ON (GPIOB->BSRR = LED0_MASK)
41 #define LED0_OFF (GPIOB->BSRR = (LED0_MASK << 16))
42 #define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK)
43 
44 #define LED1_PIN GPIO_PIN(PORT_B, 7)
45 #define LED1_MASK (1 << 7)
46 #define LED1_ON (GPIOB->BSRR = LED1_MASK)
47 #define LED1_OFF (GPIOB->BSRR = (LED1_MASK << 16))
48 #define LED1_TOGGLE (GPIOB->ODR ^= LED1_MASK)
49 
50 #define LED2_PIN GPIO_PIN(PORT_B, 14)
51 #define LED2_MASK (1 << 14)
52 #define LED2_ON (GPIOB->BSRR = LED2_MASK)
53 #define LED2_OFF (GPIOB->BSRR = (LED2_MASK << 16))
54 #define LED2_TOGGLE (GPIOB->ODR ^= LED2_MASK)
55 
60 #define BTN_B1_PIN GPIO_PIN(PORT_C, 13)
61 
65 void board_init(void);
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif /* BOARD_COMMON_H */
72 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.
Mapping from MCU pins to Arduino pins.