b-l072z-lrwan1/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Inria
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
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 XTIMER_WIDTH (16)
37 
43 #define SX127X_PARAM_SPI (SPI_DEV(1))
44 #define SX127X_PARAM_SPI_NSS GPIO_PIN(PORT_A, 15)
45 
46 #define SX127X_PARAM_RESET GPIO_PIN(PORT_C, 0)
47 #define SX127X_PARAM_DIO0 GPIO_PIN(PORT_B, 4)
48 #define SX127X_PARAM_DIO1 GPIO_PIN(PORT_B, 1)
49 #define SX127X_PARAM_DIO2 GPIO_PIN(PORT_B, 0)
50 #define SX127X_PARAM_DIO3 GPIO_PIN(PORT_C, 13)
51 
52 #define RADIO_TCXO_VCC_PIN GPIO_PIN(PORT_A, 12)
53 
59 #define LED0_PIN GPIO_PIN(PORT_A, 5)
60 #define LED0_MASK (1 << 5)
61 
62 #define LED0_ON (GPIOA->BSRR = LED0_MASK)
63 #define LED0_OFF (GPIOA->BSRR = (LED0_MASK << 16))
64 #define LED0_TOGGLE (GPIOA->ODR ^= LED0_MASK)
65 
66 #define LED1_PIN GPIO_PIN(PORT_B, 5)
67 #define LED1_MASK (1 << 5)
68 
69 #define LED1_ON (GPIOB->BSRR = LED0_MASK)
70 #define LED1_OFF (GPIOB->BSRR = (LED0_MASK << 16))
71 #define LED1_TOGGLE (GPIOB->ODR ^= LED0_MASK)
72 
73 #define LED2_PIN GPIO_PIN(PORT_B, 6)
74 #define LED2_MASK (1 << 6)
75 
76 #define LED2_ON (GPIOB->BSRR = LED0_MASK)
77 #define LED2_OFF (GPIOB->BSRR = (LED0_MASK << 16))
78 #define LED2_TOGGLE (GPIOB->ODR ^= LED0_MASK)
79 
80 #define LED3_PIN GPIO_PIN(PORT_B, 7)
81 #define LED3_MASK (1 << 7)
82 
83 #define LED3_ON (GPIOB->BSRR = LED0_MASK)
84 #define LED3_OFF (GPIOB->BSRR = (LED0_MASK << 16))
85 #define LED3_TOGGLE (GPIOB->ODR ^= LED0_MASK)
86 
91 #define BTN_B1_PIN GPIO_PIN(PORT_B, 2)
92 
96 void board_init(void);
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif /* BOARD_H */
103 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.