text: /**
    ******************************************************************************
    * @file    radio_board_if.h
    * @author  MCD Application Team
    * @brief   Header for Radio interface configuration
    ******************************************************************************
    * @attention
    *
    * <h2><center>&copy; 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
    *
    ******************************************************************************
    */
  
  /* Define to prevent recursive inclusion -------------------------------------*/
  #ifndef RADIO_BOARD_IF_H
  #define RADIO_BOARD_IF_H
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /* Includes ------------------------------------------------------------------*/
  #include "platform.h"
  /* USER CODE BEGIN include */
  
  /* USER CODE END include */
  
  /* Exported defines ----------------------------------------------------------*/
  #define RBI_CONF_RFO_LP_HP  0
  #define RBI_CONF_RFO_LP     1
  #define RBI_CONF_RFO_HP     2
  
  /* Indicates the type of switch between the ones proposed by CONFIG Constants
   */
  #define RBI_CONF_RFO                        RBI_CONF_RFO_HP
  
  /* Radio maximum wakeup time (in ms) */
  #define RF_WAKEUP_TIME                     10U
  
  /* Indicates whether or not TCXO is supported by the board
   * 0: TCXO not supported
   * 1: TCXO supported
   */
  #define IS_TCXO_SUPPORTED                   1U
  
  /* Indicates whether or not DCDC is supported by the board
   * 0: DCDC not supported
   * 1: DCDC supported
   */
  #define IS_DCDC_SUPPORTED                   1U
  
  /* RF switch ctrl define */
  #define RF_SW_CTRL1_PIN                          GPIO_PIN_4
  #define RF_SW_CTRL1_GPIO_PORT                    GPIOA
  #define RF_SW_CTRL1_GPIO_CLK_ENABLE()            __HAL_RCC_GPIOA_CLK_ENABLE()
  #define RF_SW_RX_GPIO_CLK_DISABLE()              __HAL_RCC_GPIOA_CLK_DISABLE()
  
  #define RF_SW_CTRL2_PIN                          GPIO_PIN_5
  #define RF_SW_CTRL2_GPIO_PORT                    GPIOA
  #define RF_SW_CTRL2_GPIO_CLK_ENABLE()            __HAL_RCC_GPIOA_CLK_ENABLE()
  #define RF_SW_CTRL2_GPIO_CLK_DISABLE()           __HAL_RCC_GPIOA_CLK_DISABLE()
  
  /* To be checked vs TCXO management in RCC config */
  #define RF_TCXO_VCC_PIN                          GPIO_PIN_0
  #define RF_TCXO_VCC_GPIO_PORT                    GPIOB
  #define RF_TCXO_VCC_CLK_ENABLE()                 __HAL_RCC_GPIOB_CLK_ENABLE()
  #define RF_TCXO_VCC_CLK_DISABLE()                __HAL_RCC_GPIOB_CLK_DISABLE()
  
  /* USER CODE BEGIN Exported_Defines */
  
  /* USER CODE END Exported_Defines */
  
  /* Exported types ------------------------------------------------------------*/
  typedef enum
  {
    RBI_SWITCH_OFF    = 0,
    RBI_SWITCH_RX     = 1,
    RBI_SWITCH_RFO_LP = 2,
    RBI_SWITCH_RFO_HP = 3,
  } RBI_Switch_TypeDef;
  
  /* USER CODE BEGIN ET */
  
  /* USER CODE END ET */
  
  /* Exported constants --------------------------------------------------------*/
  /* USER CODE BEGIN EC */
  
  /* USER CODE END EC */
  
  /* External variables --------------------------------------------------------*/
  /* USER CODE BEGIN EV */
  
  /* USER CODE END EV */
  
  /* Exported macro ------------------------------------------------------------*/
  /* USER CODE BEGIN EM */
  
  /* USER CODE END EM */
  
  /* Exported functions ------------------------------------------------------- */
  /**
    * @brief  Init Radio Switch
    * @return BSP status
    */
  int32_t RBI_Init(void);
  
  /**
    * @brief  DeInit Radio Switch
    * @return BSP status
    */
  int32_t RBI_DeInit(void);
  
  /**
    * @brief  Configure Radio Switch.
    * @param  Config: Specifies the Radio RF switch path to be set.
    *         This parameter can be one of following parameters:
    *           @arg RADIO_SWITCH_OFF
    *           @arg RADIO_SWITCH_RX
    *           @arg RADIO_SWITCH_RFO_LP
    *           @arg RADIO_SWITCH_RFO_HP
    * @return BSP status
    */
  int32_t RBI_ConfigRFSwitch(RBI_Switch_TypeDef Config);
  
  /**
    * @brief  Return Board Configuration
    * @retval RBI_CONF_RFO_LP_HP
    * @retval RBI_CONF_RFO_LP
    * @retval RBI_CONF_RFO_HP
    */
  int32_t RBI_GetTxConfig(void);
  
  /**
    * @brief  Get Radio Wake Time
    * @return the wake upt time in ms
    */
  int32_t RBI_GetWakeUpTime(void);
  
  /**
    * @brief  Get If TCXO is to be present on board
    * @note   never remove called by MW,
    * @retval return 1 if present, 0 if not present
    */
  int32_t RBI_IsTCXO(void);
  
  /**
    * @brief  Get If DCDC is to be present on board
    * @note   never remove called by MW,
    * @retval return 1 if present, 0 if not present
    */
  int32_t RBI_IsDCDC(void);
  
  /* USER CODE BEGIN EFP */
  
  /* USER CODE END EFP */
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* RADIO_BOARD_IF_H */
  
  /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
  