2019-03-23 22:11:48 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Mesotic SAS
|
|
|
|
*
|
|
|
|
* 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_samr34-xpro
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file board.c
|
|
|
|
* @brief Board specific implementations for the Microchip
|
|
|
|
* SAM R34 Xplained Pro board
|
|
|
|
*
|
|
|
|
* @author Dylan Laduranty <dylan.laduranty@mesotic.com>
|
|
|
|
*
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "board.h"
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "periph/gpio.h"
|
|
|
|
|
|
|
|
#ifdef MODULE_SX127X
|
|
|
|
#include "sx127x_params.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void led_init(void);
|
|
|
|
|
|
|
|
void board_init(void)
|
|
|
|
{
|
|
|
|
/* initialize the CPU */
|
|
|
|
cpu_init();
|
|
|
|
|
|
|
|
/* initialize the boards LEDs */
|
|
|
|
led_init();
|
|
|
|
|
|
|
|
/* initialize board specific pins for LoRa */
|
|
|
|
#ifdef MODULE_SX127X
|
2019-09-25 11:27:04 +02:00
|
|
|
gpio_init(TCXO_PWR_PIN, GPIO_OUT);
|
|
|
|
gpio_set(TCXO_PWR_PIN);
|
2019-03-23 22:11:48 +01:00
|
|
|
gpio_init(TX_OUTPUT_SEL_PIN, GPIO_OUT);
|
|
|
|
gpio_write(TX_OUTPUT_SEL_PIN, !SX127X_PARAM_PASELECT);
|
|
|
|
#endif /* USEMODULE_SX127X */
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Initialize the boards on-board LED
|
|
|
|
*/
|
|
|
|
void led_init(void)
|
|
|
|
{
|
|
|
|
gpio_init(LED0_PIN, GPIO_OUT);
|
|
|
|
gpio_set(LED0_PIN); /* gpio is inverted => clear */
|
|
|
|
gpio_init(LED1_PIN, GPIO_OUT);
|
|
|
|
gpio_set(LED1_PIN); /* gpio is inverted => clear */
|
|
|
|
}
|