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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2015-02-12 13:53:29 +01:00
|
|
|
* @ingroup boards_samr21-xpro
|
2014-09-09 11:12:39 +02:00
|
|
|
* @{
|
|
|
|
*
|
2015-05-22 07:34:41 +02:00
|
|
|
* @file
|
2015-05-27 13:20:31 +02:00
|
|
|
* @brief Board specific implementations for the Atmel SAM R21 Xplained
|
|
|
|
* Pro board
|
2014-09-09 11:12:39 +02:00
|
|
|
*
|
|
|
|
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
|
2015-05-27 13:20:31 +02:00
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
2014-09-09 11:12:39 +02:00
|
|
|
*
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "board.h"
|
2016-03-11 18:04:26 +01:00
|
|
|
#include "periph/gpio.h"
|
2014-09-09 11:12:39 +02:00
|
|
|
|
2018-01-11 09:24:50 +01:00
|
|
|
void board_antenna_config(uint8_t antenna)
|
|
|
|
{
|
|
|
|
if (antenna == RFCTL_ANTENNA_EXT){
|
|
|
|
gpio_set(RFCTL1_PIN);
|
|
|
|
gpio_clear(RFCTL2_PIN);
|
|
|
|
}
|
|
|
|
else if (antenna == RFCTL_ANTENNA_BOARD){
|
|
|
|
gpio_clear(RFCTL1_PIN);
|
|
|
|
gpio_set(RFCTL2_PIN);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-09 11:12:39 +02:00
|
|
|
void board_init(void)
|
|
|
|
{
|
2020-02-24 19:39:00 +01:00
|
|
|
|
2021-06-03 18:21:45 +02:00
|
|
|
/* initialize the on-board antenna switch */
|
|
|
|
if (IS_USED(MODULE_AT86RF233)) {
|
|
|
|
gpio_init(RFCTL1_PIN, GPIO_OUT);
|
|
|
|
gpio_init(RFCTL2_PIN, GPIO_OUT);
|
|
|
|
|
|
|
|
/* set default antenna switch configuration */
|
|
|
|
board_antenna_config(RFCTL_ANTENNA_DEFAULT);
|
|
|
|
}
|
2014-09-09 11:12:39 +02:00
|
|
|
}
|