![]() |
HT32SX Monarch Scan
Monarch Scan application for HT32SX
|
Sigfox manufacturer functions. More...
#include "sigfox_types.h"Go to the source code of this file.
Macros | |
| #define | ST_RF_ERR_API_ERROR (sfx_u8)(0x01) |
| #define | TIMER_START 0 |
| #define | TIMER_STOP 1 |
Functions | |
| sfx_u8 | ST_RF_API_set_xtal_freq (sfx_u32 xtal) |
| Sets the XTAL frequency of the S2-LP in Hertz (default is 50MHz). More... | |
| sfx_u8 | ST_RF_API_get_xtal_freq (sfx_u32 *xtal) |
| Gets the RF frequency offset of the S2-LP XTAL in Hertz. More... | |
| sfx_u8 | ST_RF_API_set_freq_offset (sfx_s32 offset) |
| Sets the RF frequency offset in Hertz (default is 0 Hz). More... | |
| sfx_u8 | ST_RF_API_get_freq_offset (sfx_s32 *offset) |
| sfx_u8 | ST_RF_API_set_rssi_offset (sfx_s8 rssi_off) |
| Set an RSSI offset for the RSSI. More... | |
| sfx_u8 | ST_RF_API_get_rssi_offset (sfx_s8 *rssi_off) |
| Get the RSSI offset for the RSSI. More... | |
| sfx_u8 | ST_RF_API_set_lbt_thr_offset (sfx_s8 lbt_thr_off) |
| Set an offset (dB) for tuning the LBT mechanism. More... | |
| sfx_u8 | ST_RF_API_get_lbt_thr_offset (sfx_s8 *lbt_thr_off) |
| Get the LBT offset (dB) for the LBT mechanism. More... | |
| sfx_u8 | ST_RF_API_gpio_irq_pin (sfx_u8 gpio_pin) |
| Configures one of the S2-LP pin to be an IRQ pin. More... | |
| sfx_u8 | ST_RF_API_gpio_tx_rx_pin (sfx_u8 gpio_pin) |
| Configures one of the S2-LP pin to be to be configured as (RX or TX) signal. More... | |
| sfx_u8 | ST_RF_API_gpio_rx_pin (sfx_u8 gpio_pin) |
| Configures one of the S2-LP pin to be configured as RX signal. More... | |
| sfx_u8 | ST_RF_API_gpio_tx_pin (sfx_u8 gpio_pin) |
| Configures one of the S2-LP pin to be configured as TX signal. More... | |
| sfx_u8 | ST_RF_API_reduce_output_power (sfx_s16 reduction) |
| Reduces the output power of the transmitted signal by a facor (reduction*0.5dB against the actual value). More... | |
| sfx_u8 | ST_RF_API_set_tcxo (sfx_u8 tcxo) |
| Instructs the library to configure the S2-LP for a TCXO or for a XTAL. More... | |
| sfx_u8 | ST_RF_API_smps (sfx_u8 mode) |
| Instructs the library to configure the S2-LP with a user defined smps frequency. More... | |
| sfx_u8 | ST_RF_API_set_pa (sfx_u8 pa) |
| Instructs the library to configure the S2-LP for a external PA (Power Amplifier). More... | |
| sfx_u8 | ST_RF_API_get_ramp_duration (void) |
| Returns the duration of the initial (or final) ramp in ms. More... | |
| void | ST_RF_API_S2LP_IRQ_CB (void) |
| This is a callback exported by the RF_API library. The RF_API module configures the S2-LP to raise interrupts and to notify them on a GPIO. When the interrupt of that GPIO is raised, this function must be called. It must be called when the S2-LP raises the IRQ via GPIO. More... | |
| void | ST_RF_API_Timer_CB (sfx_u8 state) |
| void | ST_RF_API_Timer_Channel_Clear_CB (void) |
| This is a callback exported by the RF_API library. It must be called when the timer started by MCU_API_timer_start_carrier_sense expires. More... | |
| sfx_u8 | ST_RF_API_Get_Continuous_TX_or_MONARCH_Scan_Flag (void) |
| sfx_u8 | ST_RF_API_StartTx (void) |
| This is a function to force S2LP to switch in TX mode. It is called from Monarch detection algorithm. More... | |
| sfx_u8 | ST_RF_API_StartRx (void) |
| This is a function to force S2LP to switch in RX mode. It is called from Monarch detection algorithm. More... | |
| sfx_u8 | ST_RF_API_StopRxTx (void) |
| This is a function to force S2LP to switch in Ready mode. It is called from Monarch detection algorithm. More... | |
| sfx_s16 | ST_RF_API_GetRSSI (void) |
| This is a function to Get the latest detected RSSI It is called from Monarch detection algorithm. More... | |
| void | ST_RF_API_ReadFifo (sfx_u8 n_bytes, sfx_u8 *buffer, sfx_u8 flush) |
| sfx_u8 | ST_RF_API_ReadFifoStatus (void) |
| void | ST_RF_API_SetFifoLength (sfx_u8 n_bytes) |
Sigfox manufacturer functions.
This file defines the manufacturer's RF functions to be implemented for library usage.
| #define ST_RF_ERR_API_ERROR (sfx_u8)(0x01) |
Error on ST_RF_API
| sfx_u8 ST_RF_API_get_lbt_thr_offset | ( | sfx_s8 * | lbt_thr_off | ) |
Get the LBT offset (dB) for the LBT mechanism.
| [in] | sfx_s8 | *lbt_thr_off: a pointer to the integer representing the offset in dB. Default value is 0. |
| 0 | if no error, 1 otherwise. |
| sfx_u8 ST_RF_API_get_ramp_duration | ( | void | ) |
Returns the duration of the initial (or final) ramp in ms.
| [in] | None. |
| Ramp | duration in ms. |
| sfx_u8 ST_RF_API_get_rssi_offset | ( | sfx_s8 * | rssi_off | ) |
Get the RSSI offset for the RSSI.
| [in] | sfx_s8* | rssi_off: a pointer to the integer representing the offset in dB. Default value is 0. |
| 0 | if no error, 1 otherwise. |
| sfx_u32 ST_RF_API_get_xtal_freq | ( | sfx_u32 * | xtal | ) |
Gets the RF frequency offset of the S2-LP XTAL in Hertz.
| [in] | sfx_s32* | xtal: a pointer to the integer representing the S2-LP XTAL frequency in Hertz. |
| 0 | if no error, 1 otherwise. |
| void ST_RF_API_GetRSSI | ( | void | ) |
This is a function to Get the latest detected RSSI
It is called from Monarch detection algorithm.
| [in] | None. |
| RSSI | level. |
| sfx_u8 ST_RF_API_gpio_irq_pin | ( | sfx_u8 | gpio_pin | ) |
Configures one of the S2-LP pin to be an IRQ pin.
| [in] | sfx_u8 | gpio_pin: an integer in the range [0,3] representing the GPIO to be used as IRQ. Default value is 3. |
| 0 | if no error, 1 otherwise. |
| sfx_u8 ST_RF_API_gpio_rx_pin | ( | sfx_u8 | gpio_pin | ) |
Configures one of the S2-LP pin to be configured as RX signal.
| [in] | sfx_u8 | gpio_pin: an integer in the range [0,3] representing the GPIO to be configured as RX signal. Pass the value 0xFF if the GPIO should not be configured. |
| 0 | if no error, 1 otherwise. |
| sfx_u8 ST_RF_API_gpio_tx_pin | ( | sfx_u8 | gpio_pin | ) |
Configures one of the S2-LP pin to be configured as TX signal.
| [in] | sfx_u8 | gpio_pin: an integer in the range [0,3] representing the GPIO to be configured as TX signal. Pass the value 0xFF if the GPIO should not be configured. |
| 0 | if no error, 1 otherwise. |
| sfx_u8 ST_RF_API_gpio_tx_rx_pin | ( | sfx_u8 | gpio_pin | ) |
Configures one of the S2-LP pin to be to be configured as (RX or TX) signal.
| [in] | sfx_u8 | gpio_pin: an integer in the range [0,3] representing the GPIO to be configured as (RX or TX) signal. Pass the value 0xFF if the GPIO should not be configured. |
| 0 | if no error, 1 otherwise. |
| sfx_u8 ST_RF_API_reduce_output_power | ( | sfx_s16 | reduction | ) |
Reduces the output power of the transmitted signal by a facor (reduction*0.5dB against the actual value).
Each positive step of 1 reduces the power at S2-LP level of about 0.5dB. A negative value increase the power level of the same quantity.
The function returns an error if the output power is bigger than the one used dutring cerification.
| [in] | sfx_s16 | reduction: the reduction factor. |
| 0 | if no error, 1 otherwise. |
| void ST_RF_API_S2LP_IRQ_CB | ( | void | ) |
This is a callback exported by the RF_API library. The RF_API module configures the S2-LP to raise interrupts and to notify them on a GPIO. When the interrupt of that GPIO is raised, this function must be called. It must be called when the S2-LP raises the IRQ via GPIO.
| [in] | None. |
| None. |
| sfx_u8 ST_RF_API_set_freq_offset | ( | sfx_s32 | offset | ) |
Sets the RF frequency offset in Hertz (default is 0 Hz).
| [in] | sfx_s32 | offset: frequency offset in Hz as an integer. |
| 0 | if no error, 1 otherwise. |
| sfx_u8 ST_RF_API_set_lbt_thr_offset | ( | sfx_s8 | lbt_thr_off | ) |
Set an offset (dB) for tuning the LBT mechanism.
| [in] | sfx_s8 | lbt_thr_off: an integer representing the offset in dB. Default value is 0. |
| 0 | if no error, 1 otherwise. |
| sfx_u8 ST_RF_API_set_pa | ( | sfx_u8 | pa | ) |
Instructs the library to configure the S2-LP for a external PA (Power Amplifier).
| [in] | sfx_u8 | pa: 1 if a PA, 0 if not. |
| 0 | if no error, 1 otherwise. |
| sfx_u8 ST_RF_API_set_rssi_offset | ( | sfx_s8 | rssi_off | ) |
Set an RSSI offset for the RSSI.
| [in] | sfx_s8 | rssi_off: an integer representing the offset in dB. Default value is 0. |
| 0 | if no error, 1 otherwise. |
| sfx_u8 ST_RF_API_set_tcxo | ( | sfx_u8 | tcxo | ) |
Instructs the library to configure the S2-LP for a TCXO or for a XTAL.
| [in] | sfx_u8 | tcxo: 1 if a TCXO, 0 if XTAL. |
| 0 | if no error, 1 otherwise. |
| sfx_u8 ST_RF_API_set_xtal_freq | ( | sfx_u32 | xtal | ) |
Sets the XTAL frequency of the S2-LP in Hertz (default is 50MHz).
| [in] | sfx_u32 | xtal: the xtal frequency of the S2-LP in Hz as an integer. |
| 0 | if no error, 1 otherwise. |
| sfx_u8 ST_RF_API_smps | ( | sfx_u8 | mode | ) |
Instructs the library to configure the S2-LP with a user defined smps frequency.
| [in] | sfx_u8 | mode: from 1 (1.2V) to 7 (1.8V). |
| 0 | if no error, 1 otherwise. |
| void ST_RF_API_StartRx | ( | void | ) |
This is a function to force S2LP to switch in RX mode.
It is called from Monarch detection algorithm.
| [in] | None. |
| None. |
| void ST_RF_API_StartTx | ( | void | ) |
This is a function to force S2LP to switch in TX mode.
It is called from Monarch detection algorithm.
| [in] | None. |
| None. |
| void ST_RF_API_StopRxTx | ( | void | ) |
This is a function to force S2LP to switch in Ready mode.
It is called from Monarch detection algorithm.
| [in] | None. |
| None. |
| void ST_RF_API_Timer_Channel_Clear_CB | ( | void | ) |
This is a callback exported by the RF_API library. It must be called when the timer started by MCU_API_timer_start_carrier_sense expires.
| [in] | None. |
| None. |