stm32f4discovery/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 #include "periph_conf.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35 #define XTIMER_DEV TIMER_DEV(0)
36 #define XTIMER_CHAN (0)
37 #define XTIMER_OVERHEAD (6)
38 #define XTIMER_BACKOFF (10)
39 
51 #define LED0_PIN GPIO_PIN(PORT_D, 13)
52 #define LED1_PIN GPIO_PIN(PORT_D, 12)
53 #define LED2_PIN GPIO_PIN(PORT_D, 14)
54 #define LED3_PIN GPIO_PIN(PORT_D, 15)
55 
56 #define LED_PORT GPIOD
57 #define LED0_MASK (1 << 13)
58 #define LED1_MASK (1 << 12)
59 #define LED2_MASK (1 << 14)
60 #define LED3_MASK (1 << 15)
61 
62 #define LED0_ON (LED_PORT->BSRR = LED0_MASK)
63 #define LED0_OFF (LED_PORT->BSRR = (LED0_MASK << 16))
64 #define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
65 
66 #define LED1_ON (LED_PORT->BSRR = LED1_MASK)
67 #define LED1_OFF (LED_PORT->BSRR = (LED1_MASK << 16))
68 #define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
69 
70 #define LED2_ON (LED_PORT->BSRR = LED2_MASK)
71 #define LED2_OFF (LED_PORT->BSRR = (LED2_MASK << 16))
72 #define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
73 
74 #define LED3_ON (LED_PORT->BSRR = LED3_MASK)
75 #define LED3_OFF (LED_PORT->BSRR = (LED3_MASK << 16))
76 #define LED3_TOGGLE (LED_PORT->ODR ^= LED3_MASK)
77 
82 #define BTN_B1_PIN GPIO_PIN(PORT_A, 0)
83 
87 void board_init(void);
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif /* BOARD_H */
94 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.