Commit ad966146 authored by funshine's avatar funshine
Browse files

migrate to sdk 0.9.5 release version

parent 360fb59e
...@@ -43,11 +43,15 @@ struct rst_info{ ...@@ -43,11 +43,15 @@ struct rst_info{
void system_restore(void); void system_restore(void);
void system_restart(void); void system_restart(void);
bool system_deep_sleep_set_option(uint8 option);
void system_deep_sleep(uint32 time_in_us); void system_deep_sleep(uint32 time_in_us);
uint8 system_upgrade_userbin_check(void); uint8 system_upgrade_userbin_check(void);
void system_upgrade_reboot(void); void system_upgrade_reboot(void);
uint8 system_upgrade_flag_check(); uint8 system_upgrade_flag_check();
void system_upgrade_flag_set(uint8 flag); void system_upgrade_flag_set(uint8 flag);
void system_timer_reinit(void); void system_timer_reinit(void);
uint32 system_get_time(void); uint32 system_get_time(void);
...@@ -59,13 +63,14 @@ enum { ...@@ -59,13 +63,14 @@ enum {
USER_TASK_PRIO_MAX USER_TASK_PRIO_MAX
}; };
void system_os_task(os_task_t task, uint8 prio, os_event_t *queue, uint8 qlen); bool system_os_task(os_task_t task, uint8 prio, os_event_t *queue, uint8 qlen);
void system_os_post(uint8 prio, os_signal_t sig, os_param_t par); bool system_os_post(uint8 prio, os_signal_t sig, os_param_t par);
void system_print_meminfo(void); void system_print_meminfo(void);
uint32 system_get_free_heap_size(void); uint32 system_get_free_heap_size(void);
void system_set_os_print(uint8 onoff); void system_set_os_print(uint8 onoff);
uint8 system_get_os_print();
uint64 system_mktime(uint32 year, uint32 mon, uint32 day, uint32 hour, uint32 min, uint32 sec); uint64 system_mktime(uint32 year, uint32 mon, uint32 day, uint32 hour, uint32 min, uint32 sec);
...@@ -92,6 +97,15 @@ const char *system_get_sdk_version(void); ...@@ -92,6 +97,15 @@ const char *system_get_sdk_version(void);
#define SOFTAP_MODE 0x02 #define SOFTAP_MODE 0x02
#define STATIONAP_MODE 0x03 #define STATIONAP_MODE 0x03
typedef enum _auth_mode {
AUTH_OPEN = 0,
AUTH_WEP,
AUTH_WPA_PSK,
AUTH_WPA2_PSK,
AUTH_WPA_WPA2_PSK,
AUTH_MAX
} AUTH_MODE;
uint8 wifi_get_opmode(void); uint8 wifi_get_opmode(void);
bool wifi_set_opmode(uint8 opmode); bool wifi_set_opmode(uint8 opmode);
...@@ -102,7 +116,7 @@ struct bss_info { ...@@ -102,7 +116,7 @@ struct bss_info {
uint8 ssid[32]; uint8 ssid[32];
uint8 channel; uint8 channel;
sint8 rssi; sint8 rssi;
uint8 authmode; AUTH_MODE authmode;
uint8 is_hidden; uint8 is_hidden;
}; };
...@@ -120,7 +134,8 @@ typedef void (* scan_done_cb_t)(void *arg, STATUS status); ...@@ -120,7 +134,8 @@ typedef void (* scan_done_cb_t)(void *arg, STATUS status);
struct station_config { struct station_config {
uint8 ssid[32]; uint8 ssid[32];
uint8 password[64]; uint8 password[64];
uint8 bssid_set; uint8 bssid_set; // Note: If bssid_set is 1, station will just connect to the router
// with both ssid[] and bssid[] matched. Please check about this.
uint8 bssid[6]; uint8 bssid[6];
}; };
...@@ -131,10 +146,10 @@ bool wifi_station_connect(void); ...@@ -131,10 +146,10 @@ bool wifi_station_connect(void);
bool wifi_station_disconnect(void); bool wifi_station_disconnect(void);
struct scan_config { struct scan_config {
uint8 *ssid; uint8 *ssid; // Note: ssid == NULL, don't filter ssid.
uint8 *bssid; uint8 *bssid; // Note: bssid == NULL, don't filter bssid.
uint8 channel; uint8 channel; // Note: channel == 0, scan all channels, otherwise scan set channel.
uint8 show_hidden; uint8 show_hidden; // Note: show_hidden == 1, can get hidden ssid routers' info.
}; };
bool wifi_station_scan(struct scan_config *config, scan_done_cb_t cb); bool wifi_station_scan(struct scan_config *config, scan_done_cb_t cb);
...@@ -166,22 +181,15 @@ bool wifi_station_dhcpc_start(void); ...@@ -166,22 +181,15 @@ bool wifi_station_dhcpc_start(void);
bool wifi_station_dhcpc_stop(void); bool wifi_station_dhcpc_stop(void);
enum dhcp_status wifi_station_dhcpc_status(void); enum dhcp_status wifi_station_dhcpc_status(void);
typedef enum _auth_mode {
AUTH_OPEN = 0,
AUTH_WEP,
AUTH_WPA_PSK,
AUTH_WPA2_PSK,
AUTH_WPA_WPA2_PSK
} AUTH_MODE;
struct softap_config { struct softap_config {
uint8 ssid[32]; uint8 ssid[32];
uint8 password[64]; uint8 password[64];
uint8 ssid_len; uint8 ssid_len; // Note: Recommend to set it according to your ssid
uint8 channel; uint8 channel; // Note: support 1 ~ 13
uint8 authmode; AUTH_MODE authmode; // Note: Don't support AUTH_WEP in softAP mode.
uint8 ssid_hidden; uint8 ssid_hidden; // Note: default 0
uint8 max_connection; uint8 max_connection; // Note: default 4, max 4
uint8 beacon_interval; // Note: support 100 ~ 60000 ms, default 100
}; };
bool wifi_softap_get_config(struct softap_config *config); bool wifi_softap_get_config(struct softap_config *config);
...@@ -220,6 +228,7 @@ uint8 wifi_get_channel(void); ...@@ -220,6 +228,7 @@ uint8 wifi_get_channel(void);
bool wifi_set_channel(uint8 channel); bool wifi_set_channel(uint8 channel);
void wifi_status_led_install(uint8 gpio_id, uint32 gpio_name, uint8 gpio_func); void wifi_status_led_install(uint8 gpio_id, uint32 gpio_name, uint8 gpio_func);
void wifi_status_led_uninstall();
/** Get the absolute difference between 2 u32_t values (correcting overflows) /** Get the absolute difference between 2 u32_t values (correcting overflows)
* 'a' is expected to be 'higher' (without overflow) than 'b'. */ * 'a' is expected to be 'higher' (without overflow) than 'b'. */
......
...@@ -18,6 +18,7 @@ PROVIDE ( SHA1Transform = 0x4000a364 ); ...@@ -18,6 +18,7 @@ PROVIDE ( SHA1Transform = 0x4000a364 );
PROVIDE ( SHA1Update = 0x4000b5a8 ); PROVIDE ( SHA1Update = 0x4000b5a8 );
PROVIDE ( SPI_read_status = 0x400043c8 ); PROVIDE ( SPI_read_status = 0x400043c8 );
PROVIDE ( SPI_write_status = 0x40004400 ); PROVIDE ( SPI_write_status = 0x40004400 );
PROVIDE ( SPI_write_enable = 0x4000443c );
PROVIDE ( Wait_SPI_Idle = 0x4000448c ); PROVIDE ( Wait_SPI_Idle = 0x4000448c );
PROVIDE ( SPIEraseArea = 0x40004b44 ); PROVIDE ( SPIEraseArea = 0x40004b44 );
PROVIDE ( SPIEraseBlock = 0x400049b4 ); PROVIDE ( SPIEraseBlock = 0x400049b4 );
......
File added
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment