nucleo-common/include/board_common.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
21 #ifndef BOARD_COMMON_H
22 #define BOARD_COMMON_H
23 
24 #include "cpu.h"
25 #include "periph_conf.h"
26 #include "arduino_pinmap.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
36 #ifdef CPU_MODEL_STM32F302R8
37 #define LED0_PIN GPIO_PIN(PORT_B, 13)
38 #define LED0_MASK (1 << 13)
39 #else
40 #define LED0_PIN GPIO_PIN(PORT_A, 5)
41 #define LED0_MASK (1 << 5)
42 #endif
43 
44 #define LED0_ON (GPIOA->BSRR = LED0_MASK)
45 #define LED0_OFF (GPIOA->BSRR = (LED0_MASK << 16))
46 #define LED0_TOGGLE (GPIOA->ODR ^= LED0_MASK)
47 
52 #define BTN_B1_PIN GPIO_PIN(PORT_C, 13)
53 
57 void board_init(void);
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif /* BOARD_COMMON_H */
64 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.
Mapping from MCU pins to Arduino pins.