1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/boards/lora-e5-dev/include/board.h
Marian Buschsieweke 1fd9913293
boards/common/stm32: clean up LED definitions
Let boards only define the port and pin number of each LEDs. The common
definitions in `stm32_leds.h` will provide `LED<x>_ON`, `LED<x>_OFF`,
`LED<x>_TOGGLE`, `LED<x>_PIN`, `LED<x>_MASK` and `LED<x>_PORT`.

In addition to code de-duplication, this also makes it easier to use
LEDs in GPIO LL, which can be beneficial for super low overhead
debugging output - e.g. when a bug is timing sensitive and `DEBUG()`
would spent to much time for stdio to reproduce a bug.
2022-08-08 23:35:06 +02:00

102 lines
2.2 KiB
C

/*
* Copyright (C) 2021 Inria
*
* 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_lora-e5-dev
* @{
*
* @file
* @brief Pin definitions and board configuration options for
* LoRa-E5 Development Board
*
* @author Francisco Molina <francois-xavier.molina@inria.yyfr>
*/
#ifndef BOARD_H
#define BOARD_H
#include "kernel_defines.h"
#if IS_USED(MODULE_SX126X_STM32WL)
#include "sx126x.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Sub-GHz radio (LoRa) configuration
* @{
*/
#define SX126X_PARAM_SPI (SPI_DEV(0))
#define SX126X_PARAM_TX_PA_MODE SX126X_RF_MODE_TX_HPA
#if IS_USED(MODULE_SX126X_STM32WL)
extern void lora_e5_dev_sx126x_set_rf_mode(sx126x_t *dev, sx126x_rf_mode_t rf_mode);
#define SX126X_PARAM_SET_RF_MODE_CB lora_e5_dev_sx126x_set_rf_mode
#define SX126X_PARAM_TYPE SX126X_TYPE_STM32WL
#endif
/** @} */
/**
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PORT_NUM PORT_B
#define LED0_PIN_NUM 5
/** @} */
/**
* @name User button
* @{
*/
#define BTN0_PIN GPIO_PIN(PORT_B, 13)
#define BTN0_MODE GPIO_IN_PU
#define BTN1_PIN GPIO_PIN(PORT_A, 0)
#define BTN1_MODE GPIO_IN_PU
/** @} */
/**
* @name RF 3-port switch (SP3T) control
*
* Refer Section 6.6.3 RF Overview in User Manual (UM2592)
* @{
*/
#define FE_CTRL1 GPIO_PIN(PORT_A, 4)
#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)
#ifdef __cplusplus
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */