platform_sdk.h
Go to the documentation of this file.
1
47 #ifndef _PLATFORM_SDK_H
48 #define _PLATFORM_SDK_H
49
50 #include <stdint.h>
51 #include <stdbool.h>
52 #include <stdio.h>
53 #include "system_gr55xx.h"
54 #include "gr55xx_hal_def.h"
55
60 typedef enum
61 {
62 XIP_64M = 0,
63 XIP_48M,
64 XIP_XO16M,
65 XIP_24M,
66 XIP_16M,
67 XIP_32M,
68 MIRROR_64M,
69 MIRROR_48M,
70 MIRROR_XO16M,
71 MIRROR_24M,
72 MIRROR_16M,
73 MIRROR_32M,
74 } run_mode_t;
75
77 typedef enum
78 {
79 RNG_OSC_CLK = 0,
80 RTC_OSC_CLK,
81 RNG_OSC_CLK2,
82 } sdk_clock_type_t;
83
84
86 typedef enum
87 {
88 MEM_POWER_FULL_MODE = 0,
89 MEM_POWER_AUTO_MODE,
90 } mem_power_t;
102 void platform_sdk_init(void);
103
111 void mem_pwr_mgmt_full_power_set(void);
112
121 void mem_pwr_mgmt_mode_set_from(uint32_t start_addr, uint32_t size);
122
129 void mem_pwr_mgmt_init(void);
130
139 void system_lp_counter_set(uint8_t cnt_a, uint8_t cnt_b);
140
149 void ble_wakeup_osc_time_set(run_mode_t run_mode, uint16_t osc_us);
150
158 uint16_t ble_wakeup_osc_time_get(run_mode_t run_mode);
159
167 uint32_t nvds_get_start_addr(void);
168
177 void ble_program_delay_set(run_mode_t run_mode, uint8_t hslot);
178
187 void ble_sleep_algo_dur_set(run_mode_t run_mode, uint16_t dur_hus);
188
197 void ble_max_push_frame_time_set(run_mode_t run_mode, uint16_t max_push_hus);
198
207 void sys_min_sleep_threshold_set(run_mode_t run_mode, uint32_t min_sleep_us);
208
219 void platform_clock_init(mcu_clock_type_t sys_clock, sdk_clock_type_t clock, uint16_t accuracy, uint16_t xo_offset);
220
231 void platform_clock_init_rng(mcu_clock_type_t sys_clock, sdk_clock_type_t clock, uint16_t accuracy, uint16_t xo_offset);
232
239 void platform_rng2_calibration_start(void);
240
248 void platform_rng2_calibration_stop(bool wait);
249
257 bool platform_rng2_calibration_is_busy(void);
258
267 uint32_t platform_rng2_calibration_get(bool wait_result, bool allow_cached);
268
275 void platform_init(void);
276
283 void warm_boot_first(void);
284
291 void warm_boot_second(void);
292
300 void system_pmu_init(mcu_clock_type_t clock_type);
301
308 void system_pmu_deinit(void);
309
316 void warm_boot(void);
317
326 void warm_boot_set_exflash_readid_delay(uint32_t delay_us);
327
334 uint32_t warm_boot_get_exflash_readid_delay(void);
335
343 void pmu_calibration_handler(void* p_arg);
344
345
352 void platform_init_push(void);
353
360 void platform_init_pop(void);
361
368 hal_status_t platform_flash_enable_quad(void);
369
378 hal_status_t platform_flash_protection(uint32_t base_priority);
379
386 hal_status_t platform_interrupt_protection_push(void);
387
394 hal_status_t platform_interrupt_protection_pop(void);
395
402 void pwr_mgmt_warm_boot(void);
403
406 #endif
407
mem_pwr_mgmt_full_power_set
void mem_pwr_mgmt_full_power_set(void)
set the memory power state to full. This function is mainly used in some scenarios where all SRAMs ne...
delay_us
__STATIC_FORCEINLINE void delay_us(uint32_t number_of_us)
Function for delaying execution for number of microseconds.
Definition: gr55xx_delay.h:80
MIRROR_32M
@ MIRROR_32M
Definition: platform_sdk.h:73
MIRROR_24M
@ MIRROR_24M
Definition: platform_sdk.h:71
platform_clock_init_rng
void platform_clock_init_rng(mcu_clock_type_t sys_clock, sdk_clock_type_t clock, uint16_t accuracy, uint16_t xo_offset)
Platform low power clock init function.
ble_max_push_frame_time_set
void ble_max_push_frame_time_set(run_mode_t run_mode, uint16_t max_push_hus)
Set Maximum BLE Pushing Frame Time.
RNG_OSC_CLK
@ RNG_OSC_CLK
Definition: platform_sdk.h:79
platform_clock_init
void platform_clock_init(mcu_clock_type_t sys_clock, sdk_clock_type_t clock, uint16_t accuracy, uint16_t xo_offset)
Platform low power clock init function.
mem_pwr_mgmt_mode_set_from
void mem_pwr_mgmt_mode_set_from(uint32_t start_addr, uint32_t size)
Control the memory power supply by specifying start address and length.
platform_interrupt_protection_push
hal_status_t platform_interrupt_protection_push(void)
protection interrupt handler during writing/erasing flash.
platform_rng2_calibration_is_busy
bool platform_rng2_calibration_is_busy(void)
Check whether RNG2 OSC calibration is on going.
MEM_POWER_AUTO_MODE
@ MEM_POWER_AUTO_MODE
Definition: platform_sdk.h:89
XIP_32M
@ XIP_32M
Definition: platform_sdk.h:67
platform_init_pop
void platform_init_pop(void)
protection platform timeout through watchdog.
mem_pwr_mgmt_init
void mem_pwr_mgmt_init(void)
memory check process
XIP_XO16M
@ XIP_XO16M
Definition: platform_sdk.h:64
platform_sdk_init
void platform_sdk_init(void)
platform sdk init function.
MIRROR_XO16M
@ MIRROR_XO16M
Definition: platform_sdk.h:70
platform_flash_enable_quad
hal_status_t platform_flash_enable_quad(void)
write flash QE
mem_power_t
mem_power_t
memory power setting mode.
Definition: platform_sdk.h:87
RNG_OSC_CLK2
@ RNG_OSC_CLK2
Definition: platform_sdk.h:81
nvds_get_start_addr
uint32_t nvds_get_start_addr(void)
Get NVDS Start Address.
XIP_64M
@ XIP_64M
Definition: platform_sdk.h:62
sys_min_sleep_threshold_set
void sys_min_sleep_threshold_set(run_mode_t run_mode, uint32_t min_sleep_us)
Set Minimum System Sleep Time.
platform_rng2_calibration_stop
void platform_rng2_calibration_stop(bool wait)
Stop RNG2 OSC calibration.
MIRROR_48M
@ MIRROR_48M
Definition: platform_sdk.h:69
run_mode_t
run_mode_t
system clock and run mode.
Definition: platform_sdk.h:61
platform_init
void platform_init(void)
Platform init function.
ble_wakeup_osc_time_get
uint16_t ble_wakeup_osc_time_get(run_mode_t run_mode)
Get Time to wakeup oscillator before BLE Activity.
system_pmu_init
void system_pmu_init(mcu_clock_type_t clock_type)
PMU init function.
ble_program_delay_set
void ble_program_delay_set(run_mode_t run_mode, uint8_t hslot)
Set BLE Program Delay.
MIRROR_64M
@ MIRROR_64M
Definition: platform_sdk.h:68
platform_flash_protection
hal_status_t platform_flash_protection(uint32_t base_priority)
During Flash erase/write operation, Disable external interrupts with a priority less than or equal to...
warm_boot_second
void warm_boot_second(void)
the second warm boot stage..
XIP_48M
@ XIP_48M
Definition: platform_sdk.h:63
RTC_OSC_CLK
@ RTC_OSC_CLK
Definition: platform_sdk.h:80
warm_boot_set_exflash_readid_delay
void warm_boot_set_exflash_readid_delay(uint32_t delay_us)
Set delay time between flash wakeup and read chip id in warm boot. Please referrent the time of Flash...
MIRROR_16M
@ MIRROR_16M
Definition: platform_sdk.h:72
hal_status_t
hal_status_t
HAL Status structures definition.
Definition: gr55xx_hal_def.h:70
ble_wakeup_osc_time_set
void ble_wakeup_osc_time_set(run_mode_t run_mode, uint16_t osc_us)
Set Time to wakeup oscillator before BLE Activity.
MEM_POWER_FULL_MODE
@ MEM_POWER_FULL_MODE
Definition: platform_sdk.h:88
platform_rng2_calibration_get
uint32_t platform_rng2_calibration_get(bool wait_result, bool allow_cached)
Get RNG2 OSC calibration result.
platform_interrupt_protection_pop
hal_status_t platform_interrupt_protection_pop(void)
protection interrupt handler during writing/erasing flash.
warm_boot_first
void warm_boot_first(void)
the first warm boot stage.
pwr_mgmt_warm_boot
void pwr_mgmt_warm_boot(void)
Power Management warm boot.
platform_init_push
void platform_init_push(void)
protection platform timeout through watchdog.
system_lp_counter_set
void system_lp_counter_set(uint8_t cnt_a, uint8_t cnt_b)
update the counter A and counter B.
warm_boot
void warm_boot(void)
Warm boot process.
platform_rng2_calibration_start
void platform_rng2_calibration_start(void)
Start RNG2 OSC calibration.
XIP_16M
@ XIP_16M
Definition: platform_sdk.h:66
XIP_24M
@ XIP_24M
Definition: platform_sdk.h:65
system_pmu_deinit
void system_pmu_deinit(void)
PMU deinit function.
warm_boot_get_exflash_readid_delay
uint32_t warm_boot_get_exflash_readid_delay(void)
Get delay time between flash wakeup and read chip id in warm boot.
ble_sleep_algo_dur_set
void ble_sleep_algo_dur_set(run_mode_t run_mode, uint16_t dur_hus)
Set BLE Sleep Algorithm Duration.
gr55xx_hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.
pmu_calibration_handler
void pmu_calibration_handler(void *p_arg)
PMU calibration handler.
sdk_clock_type_t
sdk_clock_type_t
sdk clock type.
Definition: platform_sdk.h:78