2014-09-09 11:12:39 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Freie Universität Berlin
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2018-07-26 11:59:14 +02:00
|
|
|
* @ingroup boards_samr21-xpro
|
2014-09-09 11:12:39 +02:00
|
|
|
* @{
|
|
|
|
*
|
2014-10-21 16:52:30 +02:00
|
|
|
* @file
|
2015-05-27 13:20:31 +02:00
|
|
|
* @brief Board specific definitions for the Atmel SAM R21 Xplained Pro
|
|
|
|
* board
|
2014-09-09 11:12:39 +02:00
|
|
|
*
|
|
|
|
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
|
2017-06-20 21:11:34 +02:00
|
|
|
* @author Sebastian Meiling <s@mlng.net>
|
2014-09-09 11:12:39 +02:00
|
|
|
*/
|
|
|
|
|
2017-01-18 13:00:05 +01:00
|
|
|
#ifndef BOARD_H
|
|
|
|
#define BOARD_H
|
2014-09-09 11:12:39 +02:00
|
|
|
|
|
|
|
#include "cpu.h"
|
2015-05-19 18:12:23 +02:00
|
|
|
#include "periph_conf.h"
|
2015-06-03 18:27:05 +02:00
|
|
|
#include "periph_cpu.h"
|
2014-09-09 11:12:39 +02:00
|
|
|
|
2014-10-13 15:25:50 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2014-09-09 11:12:39 +02:00
|
|
|
/**
|
2017-04-10 19:04:32 +02:00
|
|
|
* @name xtimer configuration
|
2016-03-15 17:11:47 +01:00
|
|
|
* @{
|
2014-09-09 11:12:39 +02:00
|
|
|
*/
|
2017-08-28 16:38:27 +02:00
|
|
|
#define XTIMER_DEV TIMER_DEV(1)
|
2015-07-30 10:25:04 +02:00
|
|
|
#define XTIMER_CHAN (0)
|
2016-03-15 17:11:47 +01:00
|
|
|
/** @} */
|
2014-09-09 11:12:39 +02:00
|
|
|
|
2019-07-17 15:26:45 +02:00
|
|
|
/**
|
|
|
|
* @name ztimer configuration
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define CONFIG_ZTIMER_USEC_TYPE ZTIMER_TYPE_PERIPH_TIMER
|
|
|
|
#define CONFIG_ZTIMER_USEC_DEV TIMER_DEV(1)
|
2020-06-10 13:30:48 +02:00
|
|
|
/* timer_set() may underflow for values smaller than 9, set 10 as margin */
|
|
|
|
#define CONFIG_ZTIMER_USEC_MIN (10)
|
2019-07-17 15:26:45 +02:00
|
|
|
/** @} */
|
|
|
|
|
2015-11-13 16:32:08 +01:00
|
|
|
/**
|
2017-04-10 19:04:32 +02:00
|
|
|
* @name AT86RF233 configuration
|
2015-11-13 16:32:08 +01:00
|
|
|
*
|
|
|
|
* {spi bus, spi speed, cs pin, int pin, reset pin, sleep pin}
|
|
|
|
*/
|
2018-02-28 18:30:28 +01:00
|
|
|
#define AT86RF2XX_PARAM_CS GPIO_PIN(PB, 31)
|
|
|
|
#define AT86RF2XX_PARAM_INT GPIO_PIN(PB, 0)
|
|
|
|
#define AT86RF2XX_PARAM_SLEEP GPIO_PIN(PA, 20)
|
|
|
|
#define AT86RF2XX_PARAM_RESET GPIO_PIN(PB, 15)
|
2015-11-13 16:32:08 +01:00
|
|
|
|
2014-09-09 11:12:39 +02:00
|
|
|
/**
|
2017-04-10 19:04:32 +02:00
|
|
|
* @name LED pin definitions and handlers
|
2014-09-09 11:12:39 +02:00
|
|
|
* @{
|
|
|
|
*/
|
2016-03-11 18:04:26 +01:00
|
|
|
#define LED0_PIN GPIO_PIN(0, 19)
|
2014-09-09 11:12:39 +02:00
|
|
|
|
2016-03-11 18:04:26 +01:00
|
|
|
#define LED_PORT PORT->Group[0]
|
|
|
|
#define LED0_MASK (1 << 19)
|
2014-09-09 11:12:39 +02:00
|
|
|
|
2016-03-11 18:04:26 +01:00
|
|
|
#define LED0_ON (LED_PORT.OUTCLR.reg = LED0_MASK)
|
|
|
|
#define LED0_OFF (LED_PORT.OUTSET.reg = LED0_MASK)
|
|
|
|
#define LED0_TOGGLE (LED_PORT.OUTTGL.reg = LED0_MASK)
|
2014-09-09 11:12:39 +02:00
|
|
|
/** @} */
|
|
|
|
|
2016-02-04 13:58:03 +01:00
|
|
|
/**
|
2017-04-10 19:04:32 +02:00
|
|
|
* @name SW0 (Button) pin definitions
|
2016-02-04 13:58:03 +01:00
|
|
|
* @{
|
|
|
|
*/
|
2017-06-20 21:11:34 +02:00
|
|
|
#define BTN0_PORT PORT->Group[0]
|
|
|
|
#define BTN0_PIN GPIO_PIN(0, 28)
|
|
|
|
#define BTN0_MODE GPIO_IN_PU
|
2016-02-04 13:58:03 +01:00
|
|
|
/** @} */
|
|
|
|
|
2018-01-11 09:24:50 +01:00
|
|
|
/**
|
|
|
|
* @name Antenna configuration pin interface
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define RFCTL1_PIN GPIO_PIN(0, 9)
|
|
|
|
#define RFCTL2_PIN GPIO_PIN(0, 12)
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Antenna configuration values
|
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
RFCTL_ANTENNA_BOARD,
|
|
|
|
RFCTL_ANTENNA_EXT,
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name Default antenna configuration
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#ifndef RFCTL_ANTENNA_DEFAULT
|
|
|
|
#define RFCTL_ANTENNA_DEFAULT RFCTL_ANTENNA_BOARD
|
|
|
|
#endif
|
|
|
|
/** @} */
|
|
|
|
|
2014-09-09 11:12:39 +02:00
|
|
|
/**
|
2017-04-10 19:04:32 +02:00
|
|
|
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
|
2014-09-09 11:12:39 +02:00
|
|
|
*/
|
|
|
|
void board_init(void);
|
|
|
|
|
2018-01-11 09:24:50 +01:00
|
|
|
/**
|
|
|
|
* @brief Set antenna switch
|
|
|
|
*/
|
|
|
|
void board_antenna_config(uint8_t antenna);
|
2014-10-13 15:25:50 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-01-18 13:00:05 +01:00
|
|
|
#endif /* BOARD_H */
|
2014-09-09 11:12:39 +02:00
|
|
|
/** @} */
|