board.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2017 Baptiste Clenet <bapclenet@gmail.com>
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
20 #include "cpu.h"
21 #include "periph/gpio.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
31 #define AT86RF2XX_PARAM_SPI SPI_DEV(0)
32 #define AT86RF2XX_PARAM_CS GPIO_PIN(PB, 31)
33 #define AT86RF2XX_PARAM_INT GPIO_PIN(PB, 0)
34 #define AT86RF2XX_PARAM_SLEEP GPIO_PIN(PA, 20)
35 #define AT86RF2XX_PARAM_RESET GPIO_PIN(PB, 15)
36 #define AT86RF2XX_PARAM_SPI_CLK SPI_CLK_5MHZ
43 #define LED_PORT PORT->Group[0]
44 
45 #define LED0_PIN GPIO_PIN(PA, 18)
46 #define LED0_MASK (1 << 18)
47 #define LED0_ON (LED_PORT.OUTCLR.reg = LED0_MASK)
48 #define LED0_OFF (LED_PORT.OUTSET.reg = LED0_MASK)
49 #define LED0_TOGGLE (LED_PORT.OUTTGL.reg = LED0_MASK)
50 
51 #define LED1_PIN GPIO_PIN(PA, 19)
52 #define LED1_MASK (1 << 19)
53 #define LED1_ON (LED_PORT.OUTCLR.reg = LED1_MASK)
54 #define LED1_OFF (LED_PORT.OUTSET.reg = LED1_MASK)
55 #define LED1_TOGGLE (LED_PORT.OUTTGL.reg = LED1_MASK)
62 #define BTN0_PIN GPIO_PIN(PA, 28)
63 #define BTN0_MODE GPIO_IN_PU
70 #define RFCTL1_PIN GPIO_PIN(PA, 9)
71 #define RFCTL2_PIN GPIO_PIN(PA, 12)
77 enum {
78  RFCTL_ANTENNA_BOARD,
79  RFCTL_ANTENNA_EXT,
80 };
81 
86 #ifndef RFCTL_ANTENNA_DEFAULT
87 #define RFCTL_ANTENNA_DEFAULT RFCTL_ANTENNA_BOARD
88 #endif
94 void board_antenna_config(uint8_t antenna);
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
Low-level GPIO peripheral driver interface definitions.
void board_antenna_config(uint8_t antenna)
Set antenna switch.