Functions | |
void | sys_app_printf (const char *format,...) |
Output debug logs. More... | |
void | sys_delay_us (uint32_t us) |
Delay the function execution. More... | |
void | sys_delay_ms (uint32_t ms) |
Delay the function execution. More... | |
void * | sys_malloc (uint32_t size) |
Memory allocation. More... | |
void | sys_free (void *p_mem) |
Free allocated memory. More... | |
void | sys_signal_handler_register (callback_t isr_handler) |
Register signal handler. More... | |
void | sys_sdk_verison_get (sdk_version_t *p_version) |
Get SDK version. More... | |
void | sys_context_save (void) |
Save system context. More... | |
void | restore_sys_context (void) |
Load system context. More... | |
void | sys_regs_save (volatile uint32_t *p_address, uint32_t value) |
Save system registers. More... | |
void | sys_context_checksum_gen (void) |
Generate checksum info for system context. More... | |
void | sys_security_data_use_present (uint32_t addr, uint8_t *input, uint32_t size, uint8_t *output) |
Encrypt and decrypt data using Present. More... | |
uint32_t | sys_security_enable_status_check (void) |
Check the chip's security level. More... | |
uint16_t | sys_rf_trim_get (rf_trim_info_t *p_rf_trim) |
Get the RF trim information. More... | |
uint16_t | sys_adc_trim_get (adc_trim_info_t *p_adc_trim) |
Get the ADC trim information. More... | |
uint16_t | sys_pmu_trim_get (pmu_trim_info_t *p_pmu_trim) |
Get the PMU trim information. More... | |
uint16_t | sys_crystal_trim_get (uint16_t *p_crystal_trim) |
Get the crystal trim information. More... | |
void | app_boot_turn_on_encrypt_clock (void) |
app boot project turn on the encrypt clock. More... | |
void | app_boot_security_clock_set (void) |
app boot project set the security clock. More... | |
void | sys_firmware_jump (dfu_boot_info_t *p_boot_info) |
jump to app firmware. More... | |
uint16_t | sys_trim_sum_get (uint16_t *p_trim_sum) |
Get the trim checksum. More... | |
uint16_t | sys_device_addr_get (uint8_t *p_device_addr) |
Get the device address information. More... | |
uint16_t | sys_device_uid_get (uint8_t *p_device_uid) |
Get the device UID information. More... | |
uint16_t | sys_device_lp_gain_offset_2m_get (uint8_t *p_offset) |
Get the LP gain offset 2M information. More... | |
uint16_t | sys_device_sram_get (sram_size_t *p_sram_size) |
Get the RAM size information. More... | |
uint16_t | sys_device_package_get (package_type_t *p_package_type) |
Get the chip's package type. More... | |
uint16_t | sys_get_efuse_io_ldo (uint16_t *io_ldo) |
Get the chip's IO LDO voltage. More... | |
void | sys_lpclk_set (uint32_t user_lpclk) |
Set low power CLK frequency. More... | |
uint32_t | sys_us_2_lpcycles (uint32_t us) |
Convert a duration in us into a duration in lp cycles. More... | |
uint32_t | sys_lpcycles_2_hus (uint32_t lpcycles, uint32_t *error_corr) |
Convert a duration in lp cycles into a duration in half us. More... | |
void | sys_ble_static_addr_policy_reverse (void) |
Reverse the policy for static address created by chip uuid . More... | |
uint16_t | sys_ble_heartbeat_period_set (uint32_t period_hus) |
Set BLE Sleep HeartBeat Period. More... | |
uint16_t | sys_ble_heartbeat_period_get (uint32_t *p_period_hus) |
Get BLE Sleep HeartBeat Period. More... | |
void | sys_max_msg_usage_ratio_set (uint8_t usage_ratio) |
Set system maximum usage ratio of message heap. More... | |
void | sys_lld_max_msg_usage_ratio_set (uint8_t usage_ratio) |
Set system lld layer maximum usage ratio of message heap. More... | |
uint8_t | sys_msg_usage_ratio_get (void) |
Get system message heap usage ratio. More... | |
uint8_t | sys_env_usage_ratio_get (void) |
Get system environment heap usage ratio. More... | |
uint8_t | sys_attdb_usage_ratio_get (void) |
Get system attriute database heap usage ratio. More... | |
uint8_t | sys_nonret_usage_ratio_get (void) |
Get system non retention heap usage ratio. More... | |
uint8_t | sys_link_quality_get (uint8_t conn_idx, link_rx_info_t *rx_info) |
Get link quality info. More... | |
void | sys_link_quality_clear (uint8_t conn_idx) |
Clear link quality info. More... | |
void | sys_lpclk_update_func_register (void_func_t func_update_lpclk) |
Register low power clock update function. More... | |
void | sys_lpclk_update_func_with_return_register (int_func_t func_update_lpclk) |
Register low power clock update function with int return. More... | |
uint32_t | sys_lpclk_get (void) |
Get low power CLK frequency. More... | |
uint32_t | sys_lpper_get (void) |
Get low power CLK period. More... | |
void | sys_assert_cb_register (sys_assert_cb_t *p_assert_cb) |
Register assert callbacks. More... | |
bool | sys_ke_sleep_check (void) |
Get status of ke_event list. More... | |
void | sys_swd_enable (void) |
Enable swd function. More... | |
void | sys_swd_disable (void) |
Diable swd function. More... | |
void | rtc_calibration (void) |
RTC calibration function. More... | |
void | rng_calibration (void) |
RNG calibration function. More... | |
uint32_t | sys_reverse_word (uint32_t value) |
Reverse byte order (32 bit). More... | |
uint16_t | sys_reverse_hword (uint16_t value) |
Reverse byte order (16 bit). More... | |
void app_boot_security_clock_set | ( | void | ) |
app boot project set the security clock.
void app_boot_turn_on_encrypt_clock | ( | void | ) |
app boot project turn on the encrypt clock.
void restore_sys_context | ( | void | ) |
Load system context.
void rng_calibration | ( | void | ) |
RNG calibration function.
void rtc_calibration | ( | void | ) |
RTC calibration function.
uint16_t sys_adc_trim_get | ( | adc_trim_info_t * | p_adc_trim | ) |
Get the ADC trim information.
[out] | p_adc_trim | The pointer to struct of adc_trim_info_t. |
void sys_app_printf | ( | const char * | format, |
... | |||
) |
Output debug logs.
[in] | format | Pointer to the log information. |
void sys_assert_cb_register | ( | sys_assert_cb_t * | p_assert_cb | ) |
Register assert callbacks.
[in] | p_assert_cb | Pointer to assert callbacks. |
uint8_t sys_attdb_usage_ratio_get | ( | void | ) |
Get system attriute database heap usage ratio.
The function will used to get attriute database ratio of attriute database heap. This ratio is heap used percent in full attriute database size.
uint16_t sys_ble_heartbeat_period_get | ( | uint32_t * | p_period_hus | ) |
Get BLE Sleep HeartBeat Period.
[in] | p_period_hus | Pointer to the wake up duration. Range 0x00000000-0xFFFFFFFF (in unit of us). |
SDK_SUCCESS | Operation is Success. |
uint16_t sys_ble_heartbeat_period_set | ( | uint32_t | period_hus | ) |
Set BLE Sleep HeartBeat Period.
[in] | period_hus | The wake up duration of BLE when BLE is IDEL. Range 0x00000000-0xFFFFFFFF (in unit of us). |
SDK_SUCCESS | Operation is Success. |
void sys_ble_static_addr_policy_reverse | ( | void | ) |
Reverse the policy for static address created by chip uuid .
void sys_context_checksum_gen | ( | void | ) |
Generate checksum info for system context.
void sys_context_save | ( | void | ) |
Save system context.
uint16_t sys_crystal_trim_get | ( | uint16_t * | p_crystal_trim | ) |
Get the crystal trim information.
[out] | p_crystal_trim | offset information for crystal. |
void sys_delay_ms | ( | uint32_t | ms | ) |
Delay the function execution.
[in] | ms | Millisecond. |
void sys_delay_us | ( | uint32_t | us | ) |
Delay the function execution.
[in] | us | Microsecond. |
uint16_t sys_device_addr_get | ( | uint8_t * | p_device_addr | ) |
Get the device address information.
[out] | p_device_addr | Bluetooth address by default. |
uint16_t sys_device_lp_gain_offset_2m_get | ( | uint8_t * | p_offset | ) |
Get the LP gain offset 2M information.
[out] | p_offset | the offset of LP gain. |
uint16_t sys_device_package_get | ( | package_type_t * | p_package_type | ) |
Get the chip's package type.
[out] | p_package_type | The pointer to enumeration of package_type_t. |
uint16_t sys_device_sram_get | ( | sram_size_t * | p_sram_size | ) |
Get the RAM size information.
[out] | p_sram_size | The pointer to enumeration of sram_size_t. |
uint16_t sys_device_uid_get | ( | uint8_t * | p_device_uid | ) |
Get the device UID information.
[out] | p_device_uid | Device chip UID. |
uint8_t sys_env_usage_ratio_get | ( | void | ) |
Get system environment heap usage ratio.
The function will used to get environment ratio of environment heap. This ratio is heap used percent in full environment size.
void sys_firmware_jump | ( | dfu_boot_info_t * | p_boot_info | ) |
jump to app firmware.
69
[in] | p_boot_info | Firmware system firmware information 71 |
void sys_free | ( | void * | p_mem | ) |
Free allocated memory.
[in] | p_mem | Pointer to memory block. |
uint16_t sys_get_efuse_io_ldo | ( | uint16_t * | io_ldo | ) |
Get the chip's IO LDO voltage.
This function is an API interface for special users.
[out] | io_ldo | The IO LDO voltage. |
bool sys_ke_sleep_check | ( | void | ) |
Get status of ke_event list.
void sys_link_quality_clear | ( | uint8_t | conn_idx | ) |
Clear link quality info.
[in] | conn_idx | Connect index. |
uint8_t sys_link_quality_get | ( | uint8_t | conn_idx, |
link_rx_info_t * | rx_info | ||
) |
Get link quality info.
[in] | conn_idx | Connect index. |
[in,out] | rx_info | RX detailed information. |
void sys_lld_max_msg_usage_ratio_set | ( | uint8_t | usage_ratio | ) |
Set system lld layer maximum usage ratio of message heap.
The function will used to set message ratio of message heap. Valid ratio range is 50 - 100 percent in full message size.
[in] | usage_ratio | Usage ratio of message heap size. |
uint32_t sys_lpclk_get | ( | void | ) |
Get low power CLK frequency.
This function is used to get the low power clock frequency.
void sys_lpclk_set | ( | uint32_t | user_lpclk | ) |
Set low power CLK frequency.
[in] | user_lpclk | CLK frequency. |
void sys_lpclk_update_func_register | ( | void_func_t | func_update_lpclk | ) |
Register low power clock update function.
[in] | func_update_lpclk | function pointer to update_lpclk. |
void sys_lpclk_update_func_with_return_register | ( | int_func_t | func_update_lpclk | ) |
Register low power clock update function with int return.
[in] | func_update_lpclk | function pointer to update_lpclk. |
uint32_t sys_lpcycles_2_hus | ( | uint32_t | lpcycles, |
uint32_t * | error_corr | ||
) |
Convert a duration in lp cycles into a duration in half us.
The function converts a duration in lp cycles into a duration in half us, according to the low power clock frequency (32768Hz or 32000Hz).
[in] | lpcycles | Duration in lp cycles. |
[in,out] | error_corr | Insert and retrieve error created by truncating the LP Cycle Time to a half us (in half us). |
uint32_t sys_lpper_get | ( | void | ) |
Get low power CLK period.
This function is used to get the low power CLK period.
void* sys_malloc | ( | uint32_t | size | ) |
Memory allocation.
[in] | size | Requested memory size. |
void sys_max_msg_usage_ratio_set | ( | uint8_t | usage_ratio | ) |
Set system maximum usage ratio of message heap.
The function will used to set message ratio of message heap. Valid ratio range is 50 - 100 percent in full message size.
[in] | usage_ratio | Usage ratio of message heap size. |
uint8_t sys_msg_usage_ratio_get | ( | void | ) |
Get system message heap usage ratio.
The function will used to get message ratio of message heap. This ratio is heap used percent in full message size.
uint8_t sys_nonret_usage_ratio_get | ( | void | ) |
Get system non retention heap usage ratio.
The function will used to get non retention ratio of non retention heap. This ratio is heap used percent in full non retention size.
uint16_t sys_pmu_trim_get | ( | pmu_trim_info_t * | p_pmu_trim | ) |
Get the PMU trim information.
[out] | p_pmu_trim | The pointer to struct of pmu_trim_info_t. |
void sys_regs_save | ( | volatile uint32_t * | p_address, |
uint32_t | value | ||
) |
Save system registers.
[in] | p_address | The pointer to register address. |
[in] | value | The register value to be saved, it will be restored when system wakes up. |
uint16_t sys_reverse_hword | ( | uint16_t | value | ) |
Reverse byte order (16 bit).
For example, 0x1234 becomes 0x3412.
uint32_t sys_reverse_word | ( | uint32_t | value | ) |
Reverse byte order (32 bit).
For example, 0x12345678 becomes 0x78563412.
uint16_t sys_rf_trim_get | ( | rf_trim_info_t * | p_rf_trim | ) |
Get the RF trim information.
[out] | p_rf_trim | The pointer to struct of rf_trim_info_t. |
void sys_sdk_verison_get | ( | sdk_version_t * | p_version | ) |
Get SDK version.
[out] | p_version | The pointer to struct of sdk_version_t. |
void sys_security_data_use_present | ( | uint32_t | addr, |
uint8_t * | input, | ||
uint32_t | size, | ||
uint8_t * | output | ||
) |
Encrypt and decrypt data using Present.
[in] | addr | Operation address (Flash address minus Flash start address). |
[in] | input | Data before encryption and decryption. |
[in] | size | Data size. |
[out] | output | Data after encryption and decryption. |
uint32_t sys_security_enable_status_check | ( | void | ) |
Check the chip's security level.
void sys_signal_handler_register | ( | callback_t | isr_handler | ) |
Register signal handler.
[in] | isr_handler | callback function which to be registered. |
void sys_swd_disable | ( | void | ) |
Diable swd function.
void sys_swd_enable | ( | void | ) |
Enable swd function.
uint16_t sys_trim_sum_get | ( | uint16_t * | p_trim_sum | ) |
Get the trim checksum.
[out] | p_trim_sum | The pointer to the buffer for trim checksum. |
uint32_t sys_us_2_lpcycles | ( | uint32_t | us | ) |
Convert a duration in us into a duration in lp cycles.
The function converts a duration in us into a duration in lp cycles, according to the low power clock frequency (32768Hz or 32000Hz).
[in] | us | Duration in us. |