board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Inria
3  * 2019 Freie Universität Berlin
4  * 2019 Kaspar Schleiser <kaspar@schleiser.de>
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
21 #ifndef BOARD_H
22 #define BOARD_H
23 
24 #include <stdint.h>
25 
26 #include "cpu.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
36 #define LED0_PIN GPIO_PIN(PORT_B, 4)
37 #define LED0_MASK (1 << 4)
38 
39 #define LED0_ON (GPIOB->BSRR = LED0_MASK)
40 #define LED0_OFF (GPIOB->BSRR = (LED0_MASK << 16))
41 #define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK)
42 
47 #define BTN_B1_PIN GPIO_PIN(PORT_B, 3)
48 
52 void board_init(void);
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif /* BOARD_H */
59 
board_init
void board_init(void)
Board level initialization.