![]() |
HT32SX Generic Push Button
Generic Push Button application for HT32SX
|
Sigfox manufacturer functions. More...
Go to the source code of this file.
Macros | |
#define | RF_ERR_API_INIT (sfx_u8)(0x30) |
#define | RF_ERR_API_SEND (sfx_u8)(0x31) |
#define | RF_ERR_API_CHANGE_FREQ (sfx_u8)(0x32) |
#define | RF_ERR_API_STOP (sfx_u8)(0x33) |
#define | RF_ERR_API_WAIT_FRAME (sfx_u8)(0x34) |
#define | RF_ERR_API_WAIT_CLEAR_CHANNEL (sfx_u8)(0x35) |
#define | RF_ERR_API_START_CONTINUOUS_TRANSMISSION (sfx_u8)(0x36) |
#define | RF_ERR_API_STOP_CONTINUOUS_TRANSMISSION (sfx_u8)(0x37) |
#define | RF_ERR_API_GET_VERSION (sfx_u8)(0x38) |
Functions | |
sfx_u8 | RF_API_init (sfx_rf_mode_t rf_mode) |
Init and configure Radio link in RX/TX. More... | |
sfx_u8 | RF_API_stop (void) |
Close Radio link. More... | |
sfx_u8 | RF_API_send (sfx_u8 *stream, sfx_modulation_type_t type, sfx_u8 size) |
BPSK Modulation of data stream (from synchro bit field to CRC) More... | |
sfx_u8 | RF_API_start_continuous_transmission (sfx_modulation_type_t type) |
Generate a signal with modulation type. All the configuration ( Init of the RF and Frequency have already been executed when this function is called. More... | |
sfx_u8 | RF_API_stop_continuous_transmission (void) |
Stop the current continuous transmisssion. More... | |
sfx_u8 | RF_API_change_frequency (sfx_u32 frequency) |
Change synthesizer carrier frequency. More... | |
sfx_u8 | RF_API_wait_frame (sfx_u8 *frame, sfx_s16 *rssi, sfx_rx_state_enum_t *state) |
Get all GFSK frames received in Rx buffer, structure of frame is : Synchro bit + Synchro frame + 15 Bytes. This function must be blocking state since data is received or timer of 25 s has elapsed. More... | |
sfx_u8 | RF_API_wait_for_clear_channel (sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_state_enum_t *state) |
This function is used in ARIB standard for the Listen Before Talk feature. It listens on a specific frequency band initialized through the RF_API_init(), during a sliding window set in the MCU_API_timer_start_carrier_sense(). If the channel is clear during the minimum carrier sense value (cs_min), under the limit of the cs_threshold, the functions returns with SFX_ERR_NONE (transmission allowed). Otherwise it continues to listen to the channel till the expiration of the carrier sense maximum window and then updates the state ( with timeout enum ). More... | |
sfx_u8 | RF_API_get_version (sfx_u8 **version, sfx_u8 *size) |
Returns current RF API version. More... | |
Sigfox manufacturer functions.
/ ___/ | | / ___| | ___| / _ \ \ \ / /
| |___ | | | | | |__ | | | | \ \/ /
___ \ | | | | _ | __| | | | | } {
___| | | | | |_| | | | | |_| | / /\ \ /_____/ |_| _____/ |_| _____/ /_/ _\
!!!! DO NOT MODIFY THIS FILE !!!!
This file defines the manufacturer's RF functions to be implemented for library usage.
sfx_u8 RF_API_change_frequency | ( | sfx_u32 | frequency | ) |
Change synthesizer carrier frequency.
[in] | sfx_u32 | frequency Frequency in Hz to program in the radio chipset |
[out] | none |
SFX_ERR_NONE | No error |
RF_ERR_API_CHANGE_FREQ | Change frequency error |
sfx_u8 RF_API_get_version | ( | sfx_u8 ** | version, |
sfx_u8 * | size | ||
) |
Returns current RF API version.
[out] | sfx_u8 | **version Pointer to Byte array (ASCII format) containing library version |
[out] | sfx_u8 | *size Size of the byte array pointed by *version |
SFX_ERR_NONE | No error |
RF_ERR_API_GET_VERSION | Get Version error |
sfx_u8 RF_API_init | ( | sfx_rf_mode_t | rf_mode | ) |
Init and configure Radio link in RX/TX.
[RX Configuration] To receive Sigfox Frame on your device, program the following:
[in] | sfx_rf_mode_t | rf_mode Init Radio link in Tx or RX |
[out] | none |
SFX_ERR_NONE | No error |
RF_ERR_API_INIT | Init Radio link error |
[RX Configuration] To receive Sigfox Frame on your device, program the following:
[in] | sfx_rf_mode_t | rf_mode Init Radio link in Tx or RX |
[out] | none |
SFX_ERRNONE | No error |
RF_ERR_API_INIT | Init Radio link error |
sfx_u8 RF_API_send | ( | sfx_u8 * | stream, |
sfx_modulation_type_t | type, | ||
sfx_u8 | size | ||
) |
BPSK Modulation of data stream (from synchro bit field to CRC)
NOTE : during this function, the voltage_tx needs to be retrieved and stored in a variable to be returned into the MCU_API_get_voltage_and_temperature or MCU_API_get_voltage functions.
[in] | sfx_u8 | *stream Complete stream to modulate |
[in] |
sfx_u8 RF_API_start_continuous_transmission | ( | sfx_modulation_type_t | type | ) |
Generate a signal with modulation type. All the configuration ( Init of the RF and Frequency have already been executed when this function is called.
[in] | sfx_modulation_type_t | Type of the modulation ( enum with baudrate and modulation information is contained in sigfox_api.h) |
SFX_ERR_NONE | No error |
RF_ERR_API_START_CONTINUOUS_TRANSMISSION | Continuous Transmission Start error |
sfx_u8 RF_API_stop | ( | void | ) |
Close Radio link.
[in] | none | |
[out] | none |
SFX_ERR_NONE | No error |
RF_ERR_API_STOP | Close Radio link error |
sfx_u8 RF_API_stop_continuous_transmission | ( | void | ) |
Stop the current continuous transmisssion.
SFX_ERR_NONE | No error |
RF_ERR_API_STOP_CONTINUOUS_TRANSMISSION | Continuous Transmission Stop error |
sfx_u8 RF_API_wait_for_clear_channel | ( | sfx_u8 | cs_min, |
sfx_s8 | cs_threshold, | ||
sfx_rx_state_enum_t * | state | ||
) |
This function is used in ARIB standard for the Listen Before Talk feature. It listens on a specific frequency band initialized through the RF_API_init(), during a sliding window set in the MCU_API_timer_start_carrier_sense(). If the channel is clear during the minimum carrier sense value (cs_min), under the limit of the cs_threshold, the functions returns with SFX_ERR_NONE (transmission allowed). Otherwise it continues to listen to the channel till the expiration of the carrier sense maximum window and then updates the state ( with timeout enum ).
[in] | sfx_u8 | cs_min Minimum Carrier Sense time in ms. |
[in] | sfx_s8 | cs_threshold Power threshold limit to declare the channel clear. i.e : cs_threshold value -80dBm in Japan / -65dBm in Korea |
[out] | sfx_rx_state_enum_t | state Indicate the final state of the carrier sense. Value can be DL_TIMEOUT or PASSED as per defined in sigfox_api.h file. |
SFX_ERR_NONE | No error |
sfx_u8 RF_API_wait_frame | ( | sfx_u8 * | frame, |
sfx_s16 * | rssi, | ||
sfx_rx_state_enum_t * | state | ||
) |
Get all GFSK frames received in Rx buffer, structure of frame is : Synchro bit + Synchro frame + 15 Bytes.
This function must be blocking state since data is received or timer of 25 s has elapsed.
[in] | none | |
[out] | sfx_s8 | *frame Receive buffer |
[out] | sfx_s16 | *rssi Chipset RSSI Warning: This is the 'raw' RSSI value. Do not add 100 as made in Library versions 1.x.x Resolution: 1 LSB = 1 dBm |
[out] | sfx_rx_state_enum_t | state Indicate the final state of the reception. Value can be DL_TIMEOUT or DL_PASSED if a frame has been received, as defined in sigfox_api.h file. |
SFX_ERR_NONE | No error |
[in] | none | |
[out] | sfx_s8 | *frame Receive buffer |
[out] | sfx_s16 | *rssi Chipset RSSI Warning: This is the 'raw' RSSI value. Do not add 100 as made in Library versions 1.x.x Resolution: 1 LSB = 1 dBm |
[out] | sfx_rx_state_enum_t | state Indicate the final state of the reception. Value can be TIMEOUT or PASSED if a frame has been received, as per defined in sigfox_api.h file. |
SFX_ERR_NONE | No error |
RF_ERR_API_WAIT_FRAME_TIMEOUT | Wait frame error |