board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Baptiste Clenet <bapclenet@gmail.com>
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 
9 #pragma once
10 
23 #include "cpu.h"
24 #include "periph/gpio.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #define AT86RF2XX_PARAM_SPI SPI_DEV(0)
35 #define AT86RF2XX_PARAM_CS GPIO_PIN(PB, 31)
36 #define AT86RF2XX_PARAM_INT GPIO_PIN(PB, 0)
37 #define AT86RF2XX_PARAM_SLEEP GPIO_PIN(PA, 20)
38 #define AT86RF2XX_PARAM_RESET GPIO_PIN(PB, 15)
39 #define AT86RF2XX_PARAM_SPI_CLK SPI_CLK_5MHZ
46 #define LED_PORT PORT->Group[0]
47 
48 #define LED0_PIN GPIO_PIN(PA, 18)
49 #define LED0_MASK (1 << 18)
50 #define LED0_ON (LED_PORT.OUTCLR.reg = LED0_MASK)
51 #define LED0_OFF (LED_PORT.OUTSET.reg = LED0_MASK)
52 #define LED0_TOGGLE (LED_PORT.OUTTGL.reg = LED0_MASK)
53 
54 #define LED1_PIN GPIO_PIN(PA, 19)
55 #define LED1_MASK (1 << 19)
56 #define LED1_ON (LED_PORT.OUTCLR.reg = LED1_MASK)
57 #define LED1_OFF (LED_PORT.OUTSET.reg = LED1_MASK)
58 #define LED1_TOGGLE (LED_PORT.OUTTGL.reg = LED1_MASK)
65 #define BTN0_PIN GPIO_PIN(PA, 28)
66 #define BTN0_MODE GPIO_IN_PU
73 #define RFCTL1_PIN GPIO_PIN(PA, 9)
74 #define RFCTL2_PIN GPIO_PIN(PA, 12)
80 enum {
81  RFCTL_ANTENNA_BOARD,
82  RFCTL_ANTENNA_EXT,
83 };
84 
89 #ifndef RFCTL_ANTENNA_DEFAULT
90 #define RFCTL_ANTENNA_DEFAULT RFCTL_ANTENNA_BOARD
91 #endif
97 void board_antenna_config(uint8_t antenna);
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
Low-level GPIO peripheral driver interface definitions.
void board_antenna_config(uint8_t antenna)
Set antenna switch.