Go to the documentation of this file.
51 #ifndef __GR55XX_SYS_H__
52 #define __GR55XX_SYS_H__
69 #define SYS_INVALID_TIMER_ID 0xFF
70 #define SYS_BD_ADDR_LEN BLE_GAP_ADDR_LEN
71 #define SYS_CHIP_UID_LEN 0x10
72 #define SYS_SET_BD_ADDR(BD_ADDR_ARRAY) nvds_put(0xC001, SYS_BD_ADDR_LEN, BD_ADDR_ARRAY)
73 #define SYS_ROM_VERSION_ADDR 0x45000
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.
sram_size_t
Definition of Device SRAM Size Enumerations.
void(* assert_warn_cb_t)(int param0, int param1, const char *file, int line)
Warning assert callback type.
void(* callback_t)(int)
The function pointers to register event callback.
uint16_t offset_int_1p2
Internal reference 1.2v.
int(* vprintf_callback_t)(const char *fmt, va_list argp)
Printf callback type.
uint8_t io_ldo_vout
IO LDO Vout.
uint8_t major
Major version.
uint16_t offset_int_2p0
Internal reference 2.0v.
uint16_t slope_int_1p6
Internal reference 1.6v.
void(* assert_err_cb_t)(const char *expr, const char *file, int line)
Error assert callback type.
void sys_lld_max_msg_usage_ratio_set(uint8_t usage_ratio)
Set system lld layer maximum usage ratio of message heap.
uint32_t sys_reverse_word(uint32_t value)
Reverse byte order (32 bit).
void sys_context_checksum_gen(void)
Generate checksum info for system context.
uint16_t sys_rf_trim_get(rf_trim_info_t *p_rf_trim)
Get the RF trim information.
void app_boot_turn_on_encrypt_clock(void)
app boot project turn on the encrypt clock.
uint32_t rx_other_err_cnt
Counts of RX other error times.
uint32_t sys_lpclk_get(void)
Get low power CLK frequency.
RF trim parameter information definition.
uint8_t minor
Minor version.
uint8_t sys_attdb_usage_ratio_get(void)
Get system attriute database heap usage ratio.
void sys_max_msg_usage_ratio_set(uint8_t usage_ratio)
Set system maximum usage ratio of message heap.
uint16_t offset_int_0p8
Internal reference 0.8v.
void app_boot_security_clock_set(void)
app boot project set the security clock.
@ PACKAGE_NONE
Package unused.
uint16_t slope_ext_1p0
External reference 1.0v.
uint16_t sys_device_addr_get(uint8_t *p_device_addr)
Get the device address information.
void sys_lpclk_update_func_with_return_register(int_func_t func_update_lpclk)
Register low power clock update function with int return.
void sys_signal_handler_register(callback_t isr_handler)
Register signal handler.
void(* timer_callback_t)(uint8_t timer_id)
Timer callback type.
uint32_t rx_crc_err_cnt
Counts of RX crc error times.
@ PACKAGE_GR5513BEND
QFN40 + 128KB RAM + 512KB flash packet.
uint32_t rx_mic_err_cnt
Counts of mic CRC error times.
void(* sys_context_func_t)(void)
Function type for saving user context before deep sleep.
@ PACKAGE_GR5515I0ND
QFN56 + no flash package, support external high voltage flash only.
@ PACKAGE_GR5515BEND
QFN40 + 256KB RAM + 512KB flash packet.
uint16_t slope_int_0p8
Internal reference 0.8v.
assert_warn_cb_t assert_warn_cb
Assert warning type callback.
PMU trim parameter information definition.
@ SYS_DEV_SRAM_128K
Supported 128K SRAM.
@ PACKAGE_GR5515GGBD
BGA55 package.
uint32_t rx_normal_cnt
Counts of RX normal times.
void sys_free(void *p_mem)
Free allocated memory.
void sys_app_printf(const char *format,...)
Output debug logs.
void(* assert_param_cb_t)(int param0, int param1, const char *file, int line)
Parameter assert callback type.
Define the chip configuration.
void sys_link_quality_clear(uint8_t conn_idx)
Clear link quality info.
Boot information definition.
void restore_sys_context(void)
Load system context.
void(* void_func_t)(void)
Low power clock update function type.
uint16_t sys_device_package_get(package_type_t *p_package_type)
Get the chip's package type.
uint16_t slope_int_2p0
Internal reference 2.0v.
uint8_t sys_msg_usage_ratio_get(void)
Get system message heap usage ratio.
uint16_t sys_crystal_trim_get(uint16_t *p_crystal_trim)
Get the crystal trim information.
uint32_t rx_sn_err_cnt
Counts of sn CRC error times.
uint8_t sys_link_quality_get(uint8_t conn_idx, link_rx_info_t *rx_info)
Get link quality info.
void sys_context_save(void)
Save system context.
uint16_t sys_get_efuse_io_ldo(uint16_t *io_ldo)
Get the chip's IO LDO voltage.
GR55XX Platform Power Manager Module API.
void sys_security_data_use_present(uint32_t addr, uint8_t *input, uint32_t size, uint8_t *output)
Encrypt and decrypt data using Present.
uint8_t sys_env_usage_ratio_get(void)
Get system environment heap usage ratio.
uint16_t adc_temp
ADC TEMP.
int(* int_func_t)(void)
Low power clock update function type with resturn.
uint16_t sys_ble_heartbeat_period_set(uint32_t period_hus)
Set BLE Sleep HeartBeat Period.
@ PACKAGE_GR5515I0NDA
QFN56 + no flash package, support external high/low voltage flash
void sys_delay_ms(uint32_t ms)
Delay the function execution.
void sys_firmware_jump(dfu_boot_info_t *p_boot_info)
jump to app firmware.
void sys_delay_us(uint32_t us)
Delay the function execution.
@ PACKAGE_GR5515IENDU
QFN56 + 512KB flash package.
package_type_t
package type.
uint16_t sys_pmu_trim_get(pmu_trim_info_t *p_pmu_trim)
Get the PMU trim information.
uint8_t io_ldo_bypass
IO LDO bypass.
uint16_t sys_device_uid_get(uint8_t *p_device_uid)
Get the device UID information.
void sys_lpclk_update_func_register(void_func_t func_update_lpclk)
Register low power clock update function.
int8_t rssi_cali
RSSI calibration.
void sys_ble_static_addr_policy_reverse(void)
Reverse the policy for static address created by chip uuid .
void sys_swd_disable(void)
Diable swd function.
uint16_t sys_adc_trim_get(adc_trim_info_t *p_adc_trim)
Get the ADC trim information.
@ PACKAGE_GR5513BENDU
QFN40 + 128KB RAM + 512KB flash packet @1.7V ~ 3.6V.
uint32_t rx_total_cnt
Counts of RX times.
void sys_sdk_verison_get(sdk_version_t *p_version)
Get SDK version.
@ SYS_DEV_SRAM_64K
Supported 64K SRAM.
uint16_t offset_ext_1p0
External reference 1.0v.
void rng_calibration(void)
RNG calibration function.
uint16_t sys_device_lp_gain_offset_2m_get(uint8_t *p_offset)
Get the LP gain offset 2M information.
uint16_t sys_trim_sum_get(uint16_t *p_trim_sum)
Get the trim checksum.
Device Firmware Update API.
uint16_t sys_device_sram_get(sram_size_t *p_sram_size)
Get the RAM size information.
void rtc_calibration(void)
RTC calibration function.
assert_param_cb_t assert_param_cb
Assert parameter error type callback.
@ PACKAGE_GR5515IGND
QFN56 + 1024KB flash package.
Link RX information definition.
void sys_swd_enable(void)
Enable swd function.
uint8_t sys_nonret_usage_ratio_get(void)
Get system non retention heap usage ratio.
ADC trim parameter information definition.
uint32_t commit_id
commit ID.
uint16_t build
Build number.
uint16_t slope_int_1p2
Internal reference 1.2v.
void sys_lpclk_set(uint32_t user_lpclk)
Set low power CLK frequency.
uint8_t dcdc_vout
DCDC Vout.
@ SYS_DEV_SRAM_256K
Supported 256K SRAM.
uint8_t dig_ldo_64m
DIG LDO 64m.
void sys_assert_cb_register(sys_assert_cb_t *p_assert_cb)
Register assert callbacks.
uint16_t sys_reverse_hword(uint16_t value)
Reverse byte order (16 bit).
void sys_regs_save(volatile uint32_t *p_address, uint32_t value)
Save system registers.
uint16_t sys_ble_heartbeat_period_get(uint32_t *p_period_hus)
Get BLE Sleep HeartBeat Period.
void * sys_malloc(uint32_t size)
Memory allocation.
uint32_t sys_security_enable_status_check(void)
Check the chip's security level.
uint32_t rx_sync_err_cnt
Counts of RX sync error times.
uint32_t sys_lpper_get(void)
Get low power CLK period.
uint32_t sys_us_2_lpcycles(uint32_t us)
Convert a duration in us into a duration in lp cycles.
uint16_t offset_int_1p6
Internal reference 1.6v.
uint8_t dig_ldo_16m
DIG LDO 16m.
assert_err_cb_t assert_err_cb
Assert error type callback.
include all ble sdk header files
@ PACKAGE_GR5515RGBD
BGA68 package.
bool sys_ke_sleep_check(void)
Get status of ke_event list.