The friendly Operating System for the Internet of Things
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 
21 #ifndef BOARD_H
22 #define BOARD_H
23 
24 #include "cpu.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #define LED0_PIN GPIO_PIN(PORT_C, 9)
35 #define LED1_PIN GPIO_PIN(PORT_C, 8)
36 
37 #define LED_PORT GPIOC
38 #define LED0_MASK (1 << 9)
39 #define LED1_MASK (1 << 8)
40 
41 #define LED0_ON (LED_PORT->BSRR = LED0_MASK)
42 #define LED0_OFF (LED_PORT->BRR = LED0_MASK)
43 #define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
44 
45 #define LED1_ON (LED_PORT->BSRR = LED1_MASK)
46 #define LED1_OFF (LED_PORT->BRR = LED1_MASK)
47 #define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
48 
53 #define BTN_B1_PIN GPIO_PIN(PORT_A, 0)
54 
58 void board_init(void);
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif /* BOARD_H */
65 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.