|
struct rst_info * | system_get_rst_info (void) |
| Get the reason of restart. More...
|
|
const char * | system_get_sdk_version (void) |
| Get information of the SDK version. More...
|
|
void | system_restore (void) |
| Reset to default settings. More...
|
|
void | system_restart (void) |
| Restart system. More...
|
|
void | system_deep_sleep (uint32 time_in_us) |
| Set the chip to deep-sleep mode. More...
|
|
bool | system_deep_sleep_set_option (uint8 option) |
| Call this API before system_deep_sleep to set the activity after the next deep-sleep wakeup. More...
|
|
uint32 | system_get_time (void) |
| Get system time, unit: microsecond. More...
|
|
void | system_print_meminfo (void) |
| Print the system memory distribution, including data/rodata/bss/heap. More...
|
|
uint32 | system_get_free_heap_size (void) |
| Get the size of available heap. More...
|
|
uint32 | system_get_chip_id (void) |
| Get the chip ID. More...
|
|
uint32 | system_rtc_clock_cali_proc (void) |
| Get the RTC clock cycle. More...
|
|
uint32 | system_get_rtc_time (void) |
| Get RTC time, unit: RTC clock cycle. More...
|
|
bool | system_rtc_mem_read (uint8 src, void *dst, uint16 n) |
| Read user data from the RTC memory. More...
|
|
bool | system_rtc_mem_write (uint8 dst, const void *src, uint16 n) |
| Write user data to the RTC memory. More...
|
|
void | system_uart_swap (void) |
| UART0 swap. More...
|
|
void | system_uart_de_swap (void) |
| Disable UART0 swap. More...
|
|
uint16 | system_adc_read (void) |
| Measure the input voltage of TOUT pin 6, unit : 1/1024 V. More...
|
|
uint16 | system_get_vdd33 (void) |
| Measure the power voltage of VDD3P3 pin 3 and 4, unit : 1/1024 V. More...
|
|
bool | system_param_save_with_protect (uint16 start_sec, void *param, uint16 len) |
| Write data into flash with protection. More...
|
|
bool | system_param_load (uint16 start_sec, uint16 offset, void *param, uint16 len) |
| Read the data saved into flash with the read/write protection. More...
|
|
void | system_phy_set_max_tpw (uint8 max_tpw) |
| Set the maximum value of RF TX Power, unit : 0.25dBm. More...
|
|
void | system_phy_set_tpw_via_vdd33 (uint16 vdd33) |
| Adjust the RF TX Power according to VDD33, unit : 1/1024 V. More...
|
|
void | system_phy_set_rfoption (uint8 option) |
| Enable RF or not when wakeup from deep-sleep. More...
|
|
System APIs.
bool system_param_load |
( |
uint16 |
start_sec, |
|
|
uint16 |
offset, |
|
|
void * |
param, |
|
|
uint16 |
len |
|
) |
| |
Read the data saved into flash with the read/write protection.
Flash read/write has to be 4-bytes aligned.
Read/write protection of flash: use 3 sectors (4KB per sector) to save 4KB data with protect, sector 0 and sector 1 are data sectors, back up each other, save data alternately, sector 2 is flag sector, point out which sector is keeping the latest data, sector 0 or sector 1.
- Parameters
-
uint16 | start_sec : start sector (sector 0) of the 3 sectors used for flash read/write protection. It cannot be sector 1 or sector 2.
- For example, in IOT_Demo, the 3 sectors (3 * 4KB) starting from flash 0x3D000 can be used for flash read/write protection. The parameter start_sec is 0x3D, and it cannot be 0x3E or 0x3F.
|
uint16 | offset : offset of data saved in sector |
void | *param : data pointer |
uint16 | len : data length, offset + len =< 4 * 1024 |
- Returns
- true : succeed
-
false : fail
bool system_param_save_with_protect |
( |
uint16 |
start_sec, |
|
|
void * |
param, |
|
|
uint16 |
len |
|
) |
| |
Write data into flash with protection.
Flash read/write has to be 4-bytes aligned.
Protection of flash read/write : use 3 sectors (4KBytes per sector) to save 4KB data with protect, sector 0 and sector 1 are data sectors, back up each other, save data alternately, sector 2 is flag sector, point out which sector is keeping the latest data, sector 0 or sector 1.
- Parameters
-
uint16 | start_sec : start sector (sector 0) of the 3 sectors which are used for flash read/write protection.
- For example, in IOT_Demo we can use the 3 sectors (3 * 4KB) starting from flash 0x3D000 for flash read/write protection, so the parameter start_sec should be 0x3D
|
void | *param : pointer of the data to be written |
uint16 | len : data length, should be less than a sector, which is 4 * 1024 |
- Returns
- true : succeed
-
false : fail
void system_restore |
( |
void |
| ) |
|
Reset to default settings.
Reset to default settings of the following APIs : wifi_station_set_auto_connect, wifi_set_phy_mode, wifi_softap_set_config related, wifi_station_set_config related, and wifi_set_opmode.
- Parameters
-
- Returns
- null