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_C, 9)
34 #define LED1_PIN GPIO_PIN(PORT_C, 8)
35 
36 #define LED_PORT GPIOC
37 #define LED0_MASK (1 << 9)
38 #define LED1_MASK (1 << 8)
39 
40 #define LED0_ON (LED_PORT->BSRR = LED0_MASK)
41 #define LED0_OFF (LED_PORT->BRR = LED0_MASK)
42 #define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
43 
44 #define LED1_ON (LED_PORT->BSRR = LED1_MASK)
45 #define LED1_OFF (LED_PORT->BRR = LED1_MASK)
46 #define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
47 
53 #define BTN0_PIN GPIO_PIN(PORT_A, 0)
54 #define BTN0_MODE GPIO_IN
55 
60 void board_init(void);
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif /* BOARD_H */
67 
board_init
void board_init(void)
Board level initialization.