stm32f7discovery/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 OTA keys S.A.
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 
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_J, 13)
37 #define LED1_PIN GPIO_PIN(PORT_J, 5)
38 #define LED2_PIN GPIO_PIN(PORT_A, 12)
39 #define LED3_PIN GPIO_PIN(PORT_D, 4)
40 
41 #define LED0_PORT GPIOJ
42 #define LED1_PORT GPIOJ
43 #define LED2_PORT GPIOA
44 #define LED3_PORT GPIOD
45 #define LED0_MASK (1 << 13)
46 #define LED1_MASK (1 << 5)
47 #define LED2_MASK (1 << 12)
48 #define LED3_MASK (1 << 4)
49 
50 #define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
51 #define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
52 #define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
53 
54 #define LED1_ON (LED1_PORT->BSRR = LED1_MASK)
55 #define LED1_OFF (LED1_PORT->BSRR = (LED1_MASK << 16))
56 #define LED1_TOGGLE (LED1_PORT->ODR ^= LED1_MASK)
57 
58 #define LED2_ON (LED2_PORT->BSRR = LED2_MASK)
59 #define LED2_OFF (LED2_PORT->BSRR = (LED2_MASK << 16))
60 #define LED2_TOGGLE (LED2_PORT->ODR ^= LED2_MASK)
61 
62 #define LED3_ON (LED3_PORT->BSRR = LED3_MASK)
63 #define LED3_OFF (LED3_PORT->BSRR = (LED3_MASK << 16))
64 #define LED3_TOGGLE (LED3_PORT->ODR ^= LED3_MASK)
65 
71 #define BTN0_PIN GPIO_PIN(PORT_A, 0)
72 #define BTN0_MODE GPIO_IN
73 
79 void board_init(void);
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif /* BOARD_H */
86 
Peripheral MCU configuration for the stm32f769discovery6 board.
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.