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 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 #define LED0_PIN GPIO_PIN(PORT_E, 9)
34 #define LED1_PIN GPIO_PIN(PORT_E, 8)
35 #define LED2_PIN GPIO_PIN(PORT_E, 10)
36 #define LED3_PIN GPIO_PIN(PORT_E, 15)
37 #define LED4_PIN GPIO_PIN(PORT_E, 11)
38 #define LED5_PIN GPIO_PIN(PORT_E, 14)
39 #define LED6_PIN GPIO_PIN(PORT_E, 12)
40 #define LED7_PIN GPIO_PIN(PORT_E, 13)
41 
42 #define LED_PORT GPIOE
43 #define LED0_MASK (1 << 9)
44 #define LED1_MASK (1 << 8)
45 #define LED2_MASK (1 << 10)
46 #define LED3_MASK (1 << 15)
47 #define LED4_MASK (1 << 11)
48 #define LED5_MASK (1 << 14)
49 #define LED6_MASK (1 << 12)
50 #define LED7_MASK (1 << 13)
51 
52 #define LED0_ON (LED_PORT->BSRR = LED0_MASK)
53 #define LED0_OFF (LED_PORT->BSRR = (LED0_MASK << 16))
54 #define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
55 
56 #define LED1_ON (LED_PORT->BSRR = LED1_MASK)
57 #define LED1_OFF (LED_PORT->BSRR = (LED1_MASK << 16))
58 #define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
59 
60 #define LED2_ON (LED_PORT->BSRR = LED2_MASK)
61 #define LED2_OFF (LED_PORT->BSRR = (LED2_MASK << 16))
62 #define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
63 
64 #define LED3_ON (LED_PORT->BSRR = LED3_MASK)
65 #define LED3_OFF (LED_PORT->BSRR = (LED3_MASK << 16))
66 #define LED3_TOGGLE (LED_PORT->ODR ^= LED3_MASK)
67 
68 #define LED4_ON (LED_PORT->BSRR = LED4_MASK)
69 #define LED4_OFF (LED_PORT->BSRR = (LED4_MASK << 16))
70 #define LED4_TOGGLE (LED_PORT->ODR ^= LED4_MASK)
71 
72 #define LED5_ON (LED_PORT->BSRR = LED5_MASK)
73 #define LED5_OFF (LED_PORT->BSRR = (LED5_MASK << 16))
74 #define LED5_TOGGLE (LED_PORT->ODR ^= LED5_MASK)
75 
76 #define LED6_ON (LED_PORT->BSRR = LED6_MASK)
77 #define LED6_OFF (LED_PORT->BSRR = (LED6_MASK << 16))
78 #define LED6_TOGGLE (LED_PORT->ODR ^= LED6_MASK)
79 
80 #define LED7_ON (LED_PORT->BSRR = LED7_MASK)
81 #define LED7_OFF (LED_PORT->BSRR = (LED7_MASK << 16))
82 #define LED7_TOGGLE (LED_PORT->ODR ^= LED7_MASK)
83 
89 #define BTN0_PIN GPIO_PIN(PORT_A, 0)
90 #define BTN0_MODE GPIO_IN
91 
97 void board_init(void);
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 #endif /* BOARD_H */
104 
board_init
void board_init(void)
Board level initialization.