You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
220 lines
8.1 KiB
220 lines
8.1 KiB
/* USER CODE BEGIN Header */ |
|
/** |
|
****************************************************************************** |
|
* @file radio_board_if.c |
|
* @author MCD Application Team |
|
* @brief This file provides an interface layer between MW and Radio Board |
|
****************************************************************************** |
|
* @attention |
|
* |
|
* <h2><center>© Copyright (c) 2020 STMicroelectronics. |
|
* All rights reserved.</center></h2> |
|
* |
|
* This software component is licensed by ST under Ultimate Liberty license |
|
* SLA0044, the "License"; You may not use this file except in compliance with |
|
* the License. You may obtain a copy of the License at: |
|
* www.st.com/SLA0044 |
|
* |
|
****************************************************************************** |
|
*/ |
|
/* USER CODE END Header */ |
|
|
|
/* Includes ------------------------------------------------------------------*/ |
|
#include "radio_board_if.h" |
|
|
|
/* USER CODE BEGIN Includes */ |
|
|
|
/* USER CODE END Includes */ |
|
|
|
/* External variables ---------------------------------------------------------*/ |
|
/* USER CODE BEGIN EV */ |
|
|
|
/* USER CODE END EV */ |
|
|
|
/* Private typedef -----------------------------------------------------------*/ |
|
/* USER CODE BEGIN PTD */ |
|
|
|
/* USER CODE END PTD */ |
|
|
|
/* Private define ------------------------------------------------------------*/ |
|
/* USER CODE BEGIN PD */ |
|
|
|
/* USER CODE END PD */ |
|
|
|
/* Private macro -------------------------------------------------------------*/ |
|
/* USER CODE BEGIN PM */ |
|
|
|
/* USER CODE END PM */ |
|
|
|
/* Private variables ---------------------------------------------------------*/ |
|
/* USER CODE BEGIN PV */ |
|
|
|
/* USER CODE END PV */ |
|
|
|
/* Private function prototypes -----------------------------------------------*/ |
|
/* USER CODE BEGIN PFP */ |
|
|
|
/* USER CODE END PFP */ |
|
|
|
/* Exported functions --------------------------------------------------------*/ |
|
int32_t RBI_Init(void) |
|
{ |
|
/* USER CODE BEGIN RBI_Init_1 */ |
|
|
|
/* USER CODE END RBI_Init_1 */ |
|
#if defined(USE_BSP_DRIVER) |
|
/* Important note: BSP code is board dependent |
|
* STM32WL_Nucleo code can be found |
|
* either in STM32CubeWL package under Drivers/BSP/STM32WLxx_Nucleo/ |
|
* or at https://github.com/STMicroelectronics/STM32CubeWL/tree/main/Drivers/BSP/STM32WLxx_Nucleo/ |
|
* 1/ For User boards, the BSP/STM32WLxx_Nucleo/ directory can be copied and replaced in the project. The copy must then be updated depending: |
|
* on board RF switch configuration (pin control, number of port etc) |
|
* on TCXO configuration |
|
* on DC/DC configuration */ |
|
return BSP_RADIO_Init(); |
|
#else |
|
/* 2/ Or implement RBI_Init here */ |
|
int32_t retcode = 0; |
|
/* USER CODE BEGIN RBI_Init_2 */ |
|
#warning user to provide its board code or to call his board driver functions |
|
/* USER CODE END RBI_Init_2 */ |
|
return retcode; |
|
#endif /* USE_BSP_DRIVER */ |
|
} |
|
|
|
int32_t RBI_DeInit(void) |
|
{ |
|
/* USER CODE BEGIN RBI_DeInit_1 */ |
|
|
|
/* USER CODE END RBI_DeInit_1 */ |
|
#if defined(USE_BSP_DRIVER) |
|
/* Important note: BSP code is board dependent |
|
* STM32WL_Nucleo code can be found |
|
* either in STM32CubeWL package under Drivers/BSP/STM32WLxx_Nucleo/ |
|
* or at https://github.com/STMicroelectronics/STM32CubeWL/tree/main/Drivers/BSP/STM32WLxx_Nucleo/ |
|
* 1/ For User boards, the BSP/STM32WLxx_Nucleo/ directory can be copied and replaced in the project. The copy must then be updated depending: |
|
* on board RF switch configuration (pin control, number of port etc) |
|
* on TCXO configuration |
|
* on DC/DC configuration */ |
|
return BSP_RADIO_DeInit(); |
|
#else |
|
/* 2/ Or implement RBI_DeInit here */ |
|
int32_t retcode = 0; |
|
/* USER CODE BEGIN RBI_DeInit_2 */ |
|
#warning user to provide its board code or to call his board driver functions |
|
/* USER CODE END RBI_DeInit_2 */ |
|
return retcode; |
|
#endif /* USE_BSP_DRIVER */ |
|
} |
|
|
|
int32_t RBI_ConfigRFSwitch(RBI_Switch_TypeDef Config) |
|
{ |
|
/* USER CODE BEGIN RBI_ConfigRFSwitch_1 */ |
|
|
|
/* USER CODE END RBI_ConfigRFSwitch_1 */ |
|
#if defined(USE_BSP_DRIVER) |
|
|
|
/* Important note: BSP code is board dependent |
|
* STM32WL_Nucleo code can be found |
|
* either in STM32CubeWL package under Drivers/BSP/STM32WLxx_Nucleo/ |
|
* or at https://github.com/STMicroelectronics/STM32CubeWL/tree/main/Drivers/BSP/STM32WLxx_Nucleo/ |
|
* 1/ For User boards, the BSP/STM32WLxx_Nucleo/ directory can be copied and replaced in the project. The copy must then be updated depending: |
|
* on board RF switch configuration (pin control, number of port etc) |
|
* on TCXO configuration |
|
* on DC/DC configuration */ |
|
return BSP_RADIO_ConfigRFSwitch((BSP_RADIO_Switch_TypeDef) Config); |
|
#else |
|
/* 2/ Or implement RBI_ConfigRFSwitch here */ |
|
int32_t retcode = 0; |
|
/* USER CODE BEGIN RBI_ConfigRFSwitch_2 */ |
|
#warning user to provide its board code or to call his board driver functions |
|
/* USER CODE END RBI_ConfigRFSwitch_2 */ |
|
return retcode; |
|
#endif /* USE_BSP_DRIVER */ |
|
} |
|
|
|
int32_t RBI_GetTxConfig(void) |
|
{ |
|
/* USER CODE BEGIN RBI_GetTxConfig_1 */ |
|
|
|
/* USER CODE END RBI_GetTxConfig_1 */ |
|
#if defined(USE_BSP_DRIVER) |
|
/* Important note: BSP code is board dependent |
|
* STM32WL_Nucleo code can be found |
|
* either in STM32CubeWL package under Drivers/BSP/STM32WLxx_Nucleo/ |
|
* or at https://github.com/STMicroelectronics/STM32CubeWL/tree/main/Drivers/BSP/STM32WLxx_Nucleo/ |
|
* 1/ For User boards, the BSP/STM32WLxx_Nucleo/ directory can be copied and replaced in the project. The copy must then be updated depending: |
|
* on board RF switch configuration (pin control, number of port etc) |
|
* on TCXO configuration |
|
* on DC/DC configuration */ |
|
return BSP_RADIO_GetTxConfig(); |
|
#else |
|
/* 2/ Or implement RBI_GetTxConfig here */ |
|
int32_t retcode = RBI_CONF_RFO; |
|
/* USER CODE BEGIN RBI_GetTxConfig_2 */ |
|
#warning user to provide its board code or to call his board driver functions |
|
/* USER CODE END RBI_GetTxConfig_2 */ |
|
return retcode; |
|
#endif /* USE_BSP_DRIVER */ |
|
} |
|
|
|
int32_t RBI_IsTCXO(void) |
|
{ |
|
/* USER CODE BEGIN RBI_IsTCXO_1 */ |
|
|
|
/* USER CODE END RBI_IsTCXO_1 */ |
|
#if defined(USE_BSP_DRIVER) |
|
/* Important note: BSP code is board dependent |
|
* STM32WL_Nucleo code can be found |
|
* either in STM32CubeWL package under Drivers/BSP/STM32WLxx_Nucleo/ |
|
* or at https://github.com/STMicroelectronics/STM32CubeWL/tree/main/Drivers/BSP/STM32WLxx_Nucleo/ |
|
* 1/ For User boards, the BSP/STM32WLxx_Nucleo/ directory can be copied and replaced in the project. The copy must then be updated depending: |
|
* on board RF switch configuration (pin control, number of port etc) |
|
* on TCXO configuration |
|
* on DC/DC configuration */ |
|
return BSP_RADIO_IsTCXO(); |
|
#else |
|
/* 2/ Or implement RBI_IsTCXO here */ |
|
int32_t retcode = IS_TCXO_SUPPORTED; |
|
/* USER CODE BEGIN RBI_IsTCXO_2 */ |
|
#warning user to provide its board code or to call his board driver functions |
|
/* USER CODE END RBI_IsTCXO_2 */ |
|
return retcode; |
|
#endif /* USE_BSP_DRIVER */ |
|
} |
|
|
|
int32_t RBI_IsDCDC(void) |
|
{ |
|
/* USER CODE BEGIN RBI_IsDCDC_1 */ |
|
|
|
/* USER CODE END RBI_IsDCDC_1 */ |
|
#if defined(USE_BSP_DRIVER) |
|
/* Important note: BSP code is board dependent |
|
* STM32WL_Nucleo code can be found |
|
* either in STM32CubeWL package under Drivers/BSP/STM32WLxx_Nucleo/ |
|
* or at https://github.com/STMicroelectronics/STM32CubeWL/tree/main/Drivers/BSP/STM32WLxx_Nucleo/ |
|
* 1/ For User boards, the BSP/STM32WLxx_Nucleo/ directory can be copied and replaced in the project. The copy must then be updated depending: |
|
* on board RF switch configuration (pin control, number of port etc) |
|
* on TCXO configuration |
|
* on DC/DC configuration */ |
|
return BSP_RADIO_IsDCDC(); |
|
#else |
|
/* 2/ Or implement RBI_IsDCDC here */ |
|
int32_t retcode = IS_DCDC_SUPPORTED; |
|
/* USER CODE BEGIN RBI_IsDCDC_2 */ |
|
#warning user to provide its board code or to call his board driver functions |
|
/* USER CODE END RBI_IsDCDC_2 */ |
|
return retcode; |
|
#endif /* USE_BSP_DRIVER */ |
|
} |
|
|
|
/* USER CODE BEGIN EF */ |
|
|
|
/* USER CODE END EF */ |
|
|
|
/* Private Functions Definition -----------------------------------------------*/ |
|
/* USER CODE BEGIN PrFD */ |
|
|
|
/* USER CODE END PrFD */ |
|
|
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
|