1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/boards/bastwan/board.c
Lokotius 303ac4ded2 boards/bastwan: Support BastWAN Board
This board is based on rak4260 with rak specific pinmappings.
ADC, LED and UART as well as USB ist supposed to work.
Mostly adopted from SAM R34 Xplained Pro board with adoption to rak pinout.
2021-03-25 16:21:18 +01:00

55 lines
1.3 KiB
C

/*
* Copyright (C) 2021 Lokotius Filzer
*
* 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.
*/
/**
* @ingroup boards_bastwan
* @{
*
* @file board.c
* @brief Board specific implementations for the bastwan board
*
*
* @author Lokotius Filzer <h-filzer@pixelsalat.de>
*
* @}
*/
#include <stdio.h>
#include "board.h"
#include "cpu.h"
#include "periph/gpio.h"
#ifdef MODULE_SX127X
#include "sx127x_params.h"
#endif
void board_init(void)
{
/* initialize the CPU */
cpu_init();
/* initialize the boards LED */
gpio_init(LED0_PIN, GPIO_OUT);
#ifdef TX_SWITCH_PWR_PIN
/* Enables pwr to the Antenna switch circuit */
gpio_init(TX_SWITCH_PWR_PIN, GPIO_OUT);
gpio_set(TX_SWITCH_PWR_PIN);
#endif /* TX_SWITCH_PWR_PIN */
/* initialize board specific pins for LoRa */
#ifdef MODULE_SX127X
/* Enable the pwr for the tcxo of the radio module*/
gpio_init(TCXO_PWR_PIN, GPIO_OUT);
gpio_set(TCXO_PWR_PIN);
/* Enable Toggling on TX/RX between RFI and RFO on the antenna switch SKY13373 */
gpio_init(TX_OUTPUT_SEL_PIN, GPIO_OUT);
gpio_write(TX_OUTPUT_SEL_PIN, !SX127X_PARAM_PASELECT);
#endif /* USEMODULE_SX127X */
}