stm32f0discovery/include/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 
22 #ifndef BOARD_H
23 #define BOARD_H
24 
25 #include "cpu.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35 #define LED0_PIN GPIO_PIN(PORT_C, 9)
36 #define LED1_PIN GPIO_PIN(PORT_C, 8)
37 
38 #define LED_PORT GPIOC
39 #define LED0_MASK (1 << 9)
40 #define LED1_MASK (1 << 8)
41 
42 #define LED0_ON (LED_PORT->BSRR = LED0_MASK)
43 #define LED0_OFF (LED_PORT->BRR = LED0_MASK)
44 #define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
45 
46 #define LED1_ON (LED_PORT->BSRR = LED1_MASK)
47 #define LED1_OFF (LED_PORT->BRR = LED1_MASK)
48 #define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
49 
55 #define BTN0_PIN GPIO_PIN(PORT_A, 0)
56 #define BTN0_MODE GPIO_IN
57 
62 void board_init(void);
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif /* BOARD_H */
69 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.