1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/lora-e5-dev: enable 3.3V and 5V output by default

This commit is contained in:
Francisco Molina 2021-11-07 18:55:17 +01:00
parent 358abcf133
commit c393efd360
3 changed files with 40 additions and 0 deletions

View File

@ -23,3 +23,11 @@ config BOARD_LORA_E5_DEV
# Put other features for this board (in alphabetical order)
select HAS_RIOTBOOT
config LORA_E5_DEV_ENABLE_3P3V
bool "LoRa-E5 Development Kit - Enable 3.3V output"
default y
config LORA_E5_DEV_ENABLE_5V
bool "LoRa-E5 Development Kit - Enable 5V output"
default y

View File

@ -18,6 +18,7 @@
* @}
*/
#include "kernel_defines.h"
#include "cpu.h"
#include "board.h"
#include "periph/gpio.h"
@ -34,6 +35,16 @@ void board_init(void)
LED0_OFF;
#endif
if(IS_ACTIVE(CONFIG_LORA_E5_DEV_ENABLE_3P3V)) {
gpio_init(LORA_E5_DEV_3P3V_ENABLE_PIN, GPIO_OUT);
gpio_set(LORA_E5_DEV_3P3V_ENABLE_PIN);
}
if(IS_ACTIVE(CONFIG_LORA_E5_DEV_ENABLE_5V)) {
gpio_init(LORA_E5_DEV_5V_ENABLE_PIN, GPIO_OUT);
gpio_set(LORA_E5_DEV_5V_ENABLE_PIN);
}
if (IS_USED(MODULE_SX126X_STM32WL)) {
/* Initialize the GPIO control for RF 3-port switch (SP3T) */
gpio_init(FE_CTRL1, GPIO_OUT);

View File

@ -82,6 +82,27 @@ extern void lora_e5_dev_sx126x_set_rf_mode(sx126x_t *dev, sx126x_rf_mode_t rf_mo
#define FE_CTRL2 GPIO_PIN(PORT_A, 5)
/** @} */
/**
* @brief Enable 3.3V output
*/
#ifndef CONFIG_LORA_E5_DEV_ENABLE_3P3V
#define CONFIG_LORA_E5_DEV_ENABLE_3P3V 1
#endif
/**
* @brief Enable 5V output
*/
#ifndef CONFIG_LORA_E5_DEV_ENABLE_5V
#define CONFIG_LORA_E5_DEV_ENABLE_5V 1
#endif
/**
* @brief lora-e5-dev 3.3V gpio enable pin
*/
#define LORA_E5_DEV_3P3V_ENABLE_PIN GPIO_PIN(PORT_A, 9)
/**
* @brief lora-e5-dev 5V gpio enable pin
*/
#define LORA_E5_DEV_5V_ENABLE_PIN GPIO_PIN(PORT_B, 10)
/**
* @brief Board level initialization
*/