Wirepas SDK
wms_radio_config.h
Go to the documentation of this file.
1 /* Copyright 2020 Wirepas Ltd. All Rights Reserved.
2  *
3  * See file LICENSE.txt for full license details.
4  *
5  */
6 
17 #ifndef APP_LIB_RADIO_CONFIG_H_
18 #define APP_LIB_RADIO_CONFIG_H_
19 
20 #include <stdlib.h>
21 #include <stdint.h>
22 #include <stdbool.h>
23 
24 #include "wms_app.h"
25 
27 #define APP_LIB_RADIO_CFG_NAME 0x6e080bb7
28 
29 
30 #define APP_LIB_RADIO_CFG_VERSION 0x200
31 
33 #define APP_LIB_RADIO_CFG_POWER_MAX_CNT 10
34 
36 #define APP_LIB_RADIO_CFG_CURRENT_MIN 1
37 
46 #define APP_LIB_RADIO_CFG_CURRENT_MAX 1000
47 
63 typedef enum
64 {
76 
92 typedef struct
93 {
99  uint32_t pd_to_sby;
105  uint32_t sby_to_tx;
111  uint32_t sby_to_rx;
116 
134 typedef void (*app_lib_radio_cfg_fem_set_power_cb_f)(uint8_t power_index);
135 
150 typedef void (*app_lib_radio_cfg_fem_cmd_cb_f)(uint8_t femcmd);
151 
157 typedef struct
158 {
166 
176 typedef struct
177 {
179  uint32_t tx_power_raw;
183  uint8_t value_set;
185  uint16_t tx_current;
187 
197 typedef struct
198 {
200  uint16_t rx_current;
202  int8_t rx_gain_db;
204  uint8_t power_count;
213 
221  (const app_lib_radio_cfg_fem_t * fem_cfg);
222 
230  (const app_lib_radio_cfg_power_t * power_cfg);
231 
242 typedef app_res_e (*app_lib_radio_cfg_pa_setup_f) (const void * pa_cfg);
243 
247 typedef struct
248 {
260 
261 #endif /* APP_LIB_RADIO_CONFIG_H_ */
app_lib_radio_cfg_fem_cmd_cb_f
void(* app_lib_radio_cfg_fem_cmd_cb_f)(uint8_t femcmd)
Callback function to control FEM state.
Definition: wms_radio_config.h:150
app_lib_radio_cfg_fem_timings_t::sby_to_tx
uint32_t sby_to_tx
Definition: wms_radio_config.h:105
app_lib_radio_cfg_fem_timings_t::pd_to_sby
uint32_t pd_to_sby
Definition: wms_radio_config.h:99
app_lib_radio_cfg_t::femSetup
app_lib_radio_cfg_fem_setup_f femSetup
Definition: wms_radio_config.h:251
app_lib_radio_cfg_fem_timings_t::delay_values_set
bool delay_values_set
Definition: wms_radio_config.h:114
APP_LIB_RADIO_CFG_FEM_PWR_OFF
@ APP_LIB_RADIO_CFG_FEM_PWR_OFF
Definition: wms_radio_config.h:74
APP_LIB_RADIO_CFG_FEM_STANDBY
@ APP_LIB_RADIO_CFG_FEM_STANDBY
Definition: wms_radio_config.h:70
app_lib_radio_cfg_pa_setup_f
app_res_e(* app_lib_radio_cfg_pa_setup_f)(const void *pa_cfg)
Setup radio PA configuration, relevant only for platforms that require PA configuration (e....
Definition: wms_radio_config.h:242
app_lib_radio_cfg_fem_t::setPower
app_lib_radio_cfg_fem_set_power_cb_f setPower
Definition: wms_radio_config.h:160
app_res_e
app_res_e
Definition: wms_app.h:201
app_lib_radio_cfg_fem_t
Radio FEM configuration structure from application to firmware.
Definition: wms_radio_config.h:157
app_lib_radio_cfg_tx_pwr_lvl_t::tx_current
uint16_t tx_current
Definition: wms_radio_config.h:185
app_lib_radio_cfg_tx_pwr_lvl_t::tx_output_dbm
int8_t tx_output_dbm
Definition: wms_radio_config.h:181
app_lib_radio_cfg_fem_t::femCmd
app_lib_radio_cfg_fem_cmd_cb_f femCmd
Definition: wms_radio_config.h:162
app_lib_radio_cfg_fem_t::femTimings
app_lib_radio_cfg_fem_timings_t femTimings
Definition: wms_radio_config.h:164
wms_app.h
APP_LIB_RADIO_CFG_FEM_PWR_ON
@ APP_LIB_RADIO_CFG_FEM_PWR_ON
Definition: wms_radio_config.h:72
APP_LIB_RADIO_CFG_FEM_RX_ON
@ APP_LIB_RADIO_CFG_FEM_RX_ON
Definition: wms_radio_config.h:66
app_lib_radio_cfg_fem_timings_t::sby_to_rx
uint32_t sby_to_rx
Definition: wms_radio_config.h:111
APP_LIB_RADIO_CFG_POWER_MAX_CNT
#define APP_LIB_RADIO_CFG_POWER_MAX_CNT
Maximum amount of configurable power levels.
Definition: wms_radio_config.h:33
app_lib_radio_cfg_power_setup_f
app_res_e(* app_lib_radio_cfg_power_setup_f)(const app_lib_radio_cfg_power_t *power_cfg)
Setup radio configuration / power level settings.
Definition: wms_radio_config.h:230
app_lib_radio_cfg_power_t::power_count
uint8_t power_count
Definition: wms_radio_config.h:204
app_lib_radio_cfg_fem_timings_t
FEM state transition delays.
Definition: wms_radio_config.h:92
app_lib_radio_cfg_tx_pwr_lvl_t::tx_power_raw
uint32_t tx_power_raw
Definition: wms_radio_config.h:179
app_lib_radio_cfg_fem_setup_f
app_res_e(* app_lib_radio_cfg_fem_setup_f)(const app_lib_radio_cfg_fem_t *fem_cfg)
Setup FEM control.
Definition: wms_radio_config.h:221
app_lib_radio_cfg_power_t
Radio FEM configuration structure from application to firmware.
Definition: wms_radio_config.h:197
APP_LIB_RADIO_CFG_FEM_TX_ON
@ APP_LIB_RADIO_CFG_FEM_TX_ON
Definition: wms_radio_config.h:68
app_lib_radio_cfg_t::powerSetup
app_lib_radio_cfg_power_setup_f powerSetup
Definition: wms_radio_config.h:254
app_lib_radio_cfg_power_t::rx_gain_db
int8_t rx_gain_db
Definition: wms_radio_config.h:202
app_lib_radio_cfg_tx_pwr_lvl_t
Definition for single TX power level.
Definition: wms_radio_config.h:176
app_lib_radio_cfg_femcmd_e
app_lib_radio_cfg_femcmd_e
FEM control command from firmware to application.
Definition: wms_radio_config.h:63
app_lib_radio_cfg_tx_pwr_lvl_t::value_set
uint8_t value_set
Definition: wms_radio_config.h:183
app_lib_radio_cfg_t::paSetup
app_lib_radio_cfg_pa_setup_f paSetup
Definition: wms_radio_config.h:258
app_lib_radio_cfg_power_t::rx_current
uint16_t rx_current
Definition: wms_radio_config.h:200
app_lib_radio_cfg_t
List of library functions.
Definition: wms_radio_config.h:247
app_lib_radio_cfg_fem_set_power_cb_f
void(* app_lib_radio_cfg_fem_set_power_cb_f)(uint8_t power_index)
Callback function to set radio TX power.
Definition: wms_radio_config.h:134