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 
20 #ifndef BOARD_H
21 #define BOARD_H
22 
23 #include "cpu.h"
24 #include "periph_conf.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #define XTIMER_BACKOFF (10)
35 
47 #define LED0_PIN GPIO_PIN(PORT_D, 13)
48 #define LED1_PIN GPIO_PIN(PORT_D, 12)
49 #define LED2_PIN GPIO_PIN(PORT_D, 14)
50 #define LED3_PIN GPIO_PIN(PORT_D, 15)
51 
52 #define LED_PORT GPIOD
53 #define LED0_MASK (1 << 13)
54 #define LED1_MASK (1 << 12)
55 #define LED2_MASK (1 << 14)
56 #define LED3_MASK (1 << 15)
57 
58 #define LED0_ON (LED_PORT->BSRR = LED0_MASK)
59 #define LED0_OFF (LED_PORT->BSRR = (LED0_MASK << 16))
60 #define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
61 
62 #define LED1_ON (LED_PORT->BSRR = LED1_MASK)
63 #define LED1_OFF (LED_PORT->BSRR = (LED1_MASK << 16))
64 #define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
65 
66 #define LED2_ON (LED_PORT->BSRR = LED2_MASK)
67 #define LED2_OFF (LED_PORT->BSRR = (LED2_MASK << 16))
68 #define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
69 
70 #define LED3_ON (LED_PORT->BSRR = LED3_MASK)
71 #define LED3_OFF (LED_PORT->BSRR = (LED3_MASK << 16))
72 #define LED3_TOGGLE (LED_PORT->ODR ^= LED3_MASK)
73 
79 #define BTN0_PIN GPIO_PIN(PORT_A, 0)
80 #define BTN0_MODE GPIO_IN
81 
87 void board_init(void);
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif /* BOARD_H */
94 
periph_conf.h
board_init
void board_init(void)
Board level initialization.