![]() |
HT32SX Generic Push Button
Generic Push Button application for HT32SX
|
Sigfox manufacturer functions. More...
Go to the source code of this file.
Macros | |
#define | MONARCH_ERR_API_MALLOC (sfx_u8)(0x80) |
#define | MONARCH_ERR_API_FREE (sfx_u8)(0x81) |
#define | MONARCH_ERR_API_TIMER_START (sfx_u8)(0x82) |
#define | MONARCH_ERR_API_TIMER_STOP (sfx_u8)(0x83) |
#define | MONARCH_ERR_API_CONFIGURE_SEARCH_PATTERN (sfx_u8)(0x84) |
#define | MONARCH_ERR_API_STOP_SEARCH_PATTERN (sfx_u8)(0x85) |
#define | MONARCH_ERR_API_GET_VERSION (sfx_u8)(0x86) |
Functions | |
sfx_u8 | MONARCH_API_malloc (sfx_u16 size, sfx_u8 **returned_pointer) |
Allocate memory for MONARCH library usage (Memory usage = size (Bytes)) This function is only called once at RC Scan. More... | |
sfx_u8 | MONARCH_API_free (sfx_u8 *ptr) |
Free memory allocated to library with the MONARCH_API_malloc. More... | |
sfx_u8 | MONARCH_API_timer_start (sfx_u16 timer_value, sfx_timer_unit_enum_t unit, sfx_error_t(*timeout_callback_handler)(void)) |
This function starts a timer based on timer_value and the units. When the timer expires the manufacturer has to call the timer callback function (sigfox_callback_timeout_handler) More... | |
sfx_u8 | MONARCH_API_timer_stop (void) |
This function stops the timer. More... | |
sfx_u8 | MONARCH_API_configure_search_pattern (sfx_monarch_pattern_search_t list_freq_pattern[], sfx_u8 size, sfx_monarch_listening_mode_t mode, sfx_error_t(*monarch_pattern_freq_result_callback_handler)(sfx_u32 freq, sfx_pattern_enum_t pattern, sfx_s16 rssi)) |
This function is used to configure a search pattern action from on the MCU/RF side. The list of frequencies to scan and associated pattern is given as parameter. When a pattern is found or the timeout ( set with MONARCH_API_timer_start ) occurs, the callback function has to be called. More... | |
sfx_u8 | MONARCH_API_stop_search_pattern (void) |
This function stops the scan. More... | |
sfx_u8 | MONARCH_API_get_version (sfx_u8 **version, sfx_u8 *size) |
This function returns current MONARCH API version. More... | |
Sigfox manufacturer functions.
/ ___/ | | / ___| | ___| / _ \ \ \ / /
| |___ | | | | | |__ | | | | \ \/ /
___ \ | | | | _ | __| | | | | } {
___| | | | | |_| | | | | |_| | / /\ \ /_____/ |_| _____/ |_| _____/ /_/ _\
!!!! DO NOT MODIFY THIS FILE !!!!
This file defines the manufacturer's MONARCH functions to be implemented for library usage.
sfx_u8 MONARCH_API_configure_search_pattern | ( | sfx_monarch_pattern_search_t | list_freq_pattern[], |
sfx_u8 | size, | ||
sfx_monarch_listening_mode_t | mode, | ||
sfx_error_t(*)(sfx_u32 freq, sfx_pattern_enum_t pattern, sfx_s16 rssi) | monarch_pattern_freq_result_callback_handler | ||
) |
This function is used to configure a search pattern action from on the MCU/RF side. The list of frequencies to scan and associated pattern is given as parameter. When a pattern is found or the timeout ( set with MONARCH_API_timer_start ) occurs, the callback function has to be called.
There are 2 modes that can be used : LISTENING_SWEEP and LISTENING_WINDOW modes. They are detailed in the sfx_monarch_listening_mode_t description
[in] | sfx_monarch_pattern_search_t | list_freq_pattern[] Tab of the frequencies / patterns to check |
[in] | sfx_u8 | size Size of the list (list_freq_pattern) |
[in] | sfx_monarch_listening_mode_t | mode Mode of the scan |
[in] | monarch_pattern_freq_result_callback_handler | Callback function when a pattern is found or when the timer expires with the following parameters : |
[in] | sfx_u32 | freq Report the Frequency on which the pattern has been found |
[in] | sfx_pattern_enum_t | pattern Pattern which has been found |
[in] | sfx_s16 | rssi RSSI level of the found pattern |
SFX_ERR_NONE | No error |
MONARCH_ERR_API_CONFIGURE_SEARCH_PATTERN | Search pattern error |
sfx_u8 MONARCH_API_free | ( | sfx_u8 * | ptr | ) |
Free memory allocated to library with the MONARCH_API_malloc.
[in] | sfx_u8 | *ptr pointer to buffer |
[out] | none |
SFX_ERR_NONE | No error |
MONARCH_ERR_API_FREE | Free error |
sfx_u8 MONARCH_API_get_version | ( | sfx_u8 ** | version, |
sfx_u8 * | size | ||
) |
This function returns current MONARCH 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 |
MONARCH_ERR_API_GET_VERSION | Get Version error |
sfx_u8 MONARCH_API_malloc | ( | sfx_u16 | size, |
sfx_u8 ** | returned_pointer | ||
) |
Allocate memory for MONARCH library usage (Memory usage = size (Bytes)) This function is only called once at RC Scan.
The address reported need to be aligned with architecture of the microprocessor used. For a Microprocessor of:
[in] | sfx_u16 | size size of buffer to allocate in bytes |
[out] | sfx_u8 | **returned_pointer pointer to buffer (can be static) |
SFX_ERR_NONE | No error |
MONARCH_ERR_API_MALLOC | Malloc error |
sfx_u8 MONARCH_API_stop_search_pattern | ( | void | ) |
This function stops the scan.
SFX_ERR_NONE | No error |
MONARCH_ERR_API_STOP_SEARCH_PATTERN | Stop seach pattern error |
sfx_u8 MONARCH_API_timer_start | ( | sfx_u16 | timer_value, |
sfx_timer_unit_enum_t | unit, | ||
sfx_error_t(*)(void) | sigfox_callback_timeout_handler | ||
) |
This function starts a timer based on timer_value and the units. When the timer expires the manufacturer has to call the timer callback function (sigfox_callback_timeout_handler)
[in] | sfx_u16 | timer_value Scan duration value ( with the unit parameter information ) |
[in] | sfx_timer_unit_enum_t | unit Unit to be considered for the scan time computation |
[in] | timeout_callback_handler | This is the function that needs to be called when the timer expires ( either when RC Found or when Timeout ) |
SFX_ERR_NONE | No error |
MONARCH_ERR_API_TIMER_START | Timer Start error |
sfx_u8 MONARCH_API_timer_stop | ( | void | ) |
This function stops the timer.
SFX_ERR_NONE | No error |
MONARCH_ERR_API_TIMER_STOP | Stop Timer error |