Go to the documentation of this file.
51 #ifndef __GR5405_SYS_SDK_H__
52 #define __GR5405_SYS_SDK_H__
57 #include "gr5xx_fpb.h"
68 #define SYS_BOOT_SETTING_PATTERN 0x474F4F44
69 #define SYS_BOOT_SETTING_RSV_MAGIC 0xFFFFFFFF
70 #define SYS_BOOT_SETTING_SWD_ENABLE 0xFF
71 #define SYS_BOOT_SETTING_SWD_DISABLE 0xA5
72 #define SYS_SCA_SETTING_ADDR 0x0027F000
73 #define SYS_INVALID_TIMER_ID 0xFF
74 #define SYS_BD_ADDR_LEN BLE_GAP_ADDR_LEN
75 #define SYS_CHIP_UID_LEN 0x10
76 #define SYS_SET_BD_ADDR(BD_ADDR_ARRAY) nvds_put(0xC001, SYS_BD_ADDR_LEN, BD_ADDR_ARRAY)
77 #define SYS_ROM_VERSION_ADDR ((uint32_t)(0x200))
78 #define CHECK_IS_ON_FPGA() (MCU_SUB->FPGA_CTRL & MCU_SUB_FPGA_CTRL_REG_EXIST)
231 uint32_t fw_check_sum;
237 uint8_t comments[20];
238 uint8_t reserved[15];
239 uint32_t setting_check_sum;
uint8_t sys_attdb_usage_ratio_get(void)
Get system attriute database heap usage ratio.
int(* vprintf_callback_t)(const char *fmt, va_list argp)
Printf callback type.
void(* assert_warn_cb_t)(int param0, int param1, const char *file, int line)
Warning assert callback type.
RF trim parameter information definition.
uint16_t sys_device_package_get(package_type_t *p_package_type)
Get the chip's package type.
void restore_sys_context(void)
Load system context.
void set_io_ldo_use_3p3_v(bool flag)
Set s_io_ldo_use_3p3_v function.
uint32_t sys_lpcycles_2_hus(uint32_t lpcycles, uint32_t *error_corr)
Convert a duration in lp cycles into a duration in half μs.
hw_version_type_t
package type.
void sys_swd_disable(void)
Disable swd function.
uint16_t sys_adc_trim_get(adc_trim_info_t *p_adc_trim)
Get the ADC trim information.
Ringo trim information definition.
uint16_t sys_ringo_trim_get(ringo_trim_info_t *p_ringo_trim)
Get the chip ringo trim value.
uint16_t sys_device_addr_get(uint8_t *p_device_addr)
Get the device address information.
Warm boot timing parameters(unit: us).
assert_warn_cb_t assert_warn_cb
void sys_lpclk_set(uint32_t user_lpclk)
Set low power CLK frequency.
void sys_sdk_verison_get(sdk_version_t *p_version)
Get SDK version.
PMU trim parameter information definition.
Define the chip configuration.
uint8_t sys_env_usage_ratio_get(void)
Get system environment heap usage ratio.
void sys_app_heap_size_set(uint16_t max_size)
Set max heap size used by app layer.
void sys_max_msg_usage_ratio_set(uint8_t usage_ratio)
Set system maximum usage ratio of message heap.
void ble_stack_em_base_init(uint32_t address)
Set ble exchange memory base address.
void(* assert_err_cb_t)(const char *expr, const char *file, int line)
Error assert callback type.
void delay_us(uint32_t us)
Delay the function execution.
void(* callback_t)(int)
The function pointers to register event callback.
uint16_t(* raw_log_send_cb_t)(uint8_t *p_data, uint16_t length)
raw log callback type.
package_type_t
package type.
void sys_firmware_jump(uint32_t fw_addr, uint32_t fw_bin_size)
jump to app firmware.
void sys_app_free(void *p_data)
Free memory for app layer.
uint8_t sys_sdk_ultra_conn_update(uint8_t conn_idx, uint16_t interval, uint16_t latency, uint16_t superv_to)
Register the callback function of the extended llcp process.
uint32_t sys_lpper_get(void)
Get low power CLK period.
uint16_t sys_rf_trim_get(rf_trim_info_t *p_rf_trim)
Get the RF trim information.
void sys_free(void *mem_ptr)
free memory.
void sys_swd_enable(void)
Enable swd function.
void sys_context_save(void)
Save system context.
uint16_t sys_ble_heartbeat_period_get(uint32_t *p_period_hus)
Get BLE Sleep HeartBeat Period.
bool sys_ke_sleep_check(void)
Get status of ke_event list.
int32_t(* int_func_t)(void)
Low power clock update function type.
uint16_t sys_trim_sum_get(uint16_t *p_trim_sum)
Get the trim checksum.
sram_size_t
Definition of Device SRAM Size Enumerations.
uint8_t dig_ldo_1p05_coarse
uint8_t sys_nonret_usage_ratio_get(void)
Get system non retention heap usage ratio.
uint16_t sys_ble_heartbeat_period_set(uint32_t period_hus)
Set BLE Sleep HeartBeat Period.
uint16_t sys_pmu_trim_get(pmu_trim_info_t *p_pmu_trim)
Get the PMU trim information.
void sys_app_printf(const char *format,...)
Output debug logs.
void sys_assert_cb_register(sys_assert_cb_t *p_assert_cb)
Register assert callbacks.
uint16_t sys_device_sram_get(sram_size_t *p_sram_size)
Get the RAM size information.
void ble_em_addr_offset_set(uint16_t offset)
Set ble exchange memory buffer address common offset.
void * sys_app_malloc(uint16_t buf_size)
Allocate memory for app layer.
uint32_t sys_lpclk_get(void)
Get low power CLK frequency.
uint8_t dig_ldo_1p05_fine
void(* timer_callback_t)(uint8_t timer_id)
Timer callback type.
uint16_t sys_device_uid_get(uint8_t *p_device_uid)
Get the device UID information.
struct __attribute((packed))
void delay_ms(uint32_t ms)
Delay the function execution.
assert_param_cb_t assert_param_cb
GR5405 Platform Power Manager Module API.
uint32_t sys_swd_is_enabled(void)
Check if swd function is enabled.
void * sys_malloc_db(uint32_t size)
Malloc size memory prefer to use db heap.
ADC trim parameter information definition.
uint16_t sys_app_used_heap_size_get(void)
Get used heap size by app layer.
void(* void_func_t)(void)
Low power clock update function type.
uint8_t dig_ldo_0p9_coarse
uint16_t sys_device_lp_gain_offset_2m_get(uint8_t *p_offset)
Get the LP gain offset 2M information.
uint8_t sys_msg_usage_ratio_get(void)
Get system message heap usage ratio.
void sys_signal_handler_register(callback_t isr_handler)
Register signal handler.
void sys_security_data_use_present(uint32_t addr, uint8_t *input, uint32_t size, uint8_t *output)
Encrypt and decrypt data using Present.
uint32_t sys_us_2_lpcycles(uint32_t us)
Convert a duration in μs into a duration in lp cycles.
uint16_t sys_crystal_trim_get(uint16_t *p_crystal_trim)
Get the crystal trim information.
void(* sys_context_func_t)(void)
Function type for saving user context before deep sleep.
uint16_t sys_hw_version_get(hw_version_type_t *p_hw_version)
Get the HW version information.
void(* assert_param_cb_t)(int param0, int param1, const char *file, int line)
Parameter assert callback type.
assert_err_cb_t assert_err_cb
void sys_lld_max_msg_usage_ratio_set(uint8_t usage_ratio)
Set system lld layer maximum usage ratio of message heap.
void * sys_malloc(uint32_t size)
Malloc size memory.