Initial commit: TXW82x FPV v2.7.0.7-42229 SDK + project sources
This commit is contained in:
71
sdk/include/lib/common/atcmd.h
Normal file
71
sdk/include/lib/common/atcmd.h
Normal file
@@ -0,0 +1,71 @@
|
||||
|
||||
#ifndef _COMMON_ATCMD_H_
|
||||
#define _COMMON_ATCMD_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int32 sys_atcmd_loaddef(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_atcmd_reset(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_atcmd_jtag(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_syscfg_dump_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_atcmd_errlog(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_atcmd_sysdbg(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_atcmd_disprintf(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 xmodem_fwupgrade_hdl(const char *cmd, char *argv[], uint32 count);
|
||||
int32 sys_heap_dump_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_atcmd_watchdog(const char *cmd, char *argv[], uint32 argc);
|
||||
|
||||
int32 sys_wifi_atcmd_set_channel(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_set_bssid(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_set_encrypt(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_set_ssid(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_set_key(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_set_rssid(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_set_rkey(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_set_rmode(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_set_wifimode(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_loaddef(const char *cmd, char *argv[], uint32 argc);
|
||||
|
||||
int32 sys_wifi_atcmd_scan(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_pair(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_aphide(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_hwmode(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_ft(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_passwd(const char *cmd, char *argv[], uint32 argc);
|
||||
|
||||
int32 sys_ble_atcmd_blenc(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_ble_atcmd_set_coexist_en(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_ble_start_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_ble_tx_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_ble_rx_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_ble_rx_cnt_clr_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_ble_rx_cnt_get_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_ble_tx_delay_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_ble_chan_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_ble_rx_timeout_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_ble_tx_gain_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_write_ble_tx_gain_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_write_mac_addr2_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_io_test_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 atcmd_io_test_res_get_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
|
||||
int32 sys_atcmd_ping(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_atcmd_icmp_mntr(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_atcmd_iperf2(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_atcmd_goto_boot(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_atcmd_reboot_test_mode(const char *cmd, char *argv[], uint32 argc);
|
||||
|
||||
int32 sys_wifi_atcmd_pcap(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_wifi_atcmd_wificsa(const char *cmd, char *argv[], uint32 argc);
|
||||
|
||||
int32 udp_test_atcmd_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 tcp_test_atcmd_hdl(const char *cmd, char *argv[], uint32 argc);
|
||||
|
||||
int32 sys_get_gpio_imap(const char *cmd, char *argv[], uint32 argc);
|
||||
int32 sys_get_gpio_omap(const char *cmd, char *argv[], uint32 argc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
34
sdk/include/lib/common/common.h
Normal file
34
sdk/include/lib/common/common.h
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
#ifndef _HGIC_COMMON_H_
|
||||
#define _HGIC_COMMON_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void do_global_ctors(void);
|
||||
void do_global_dtors(void);
|
||||
|
||||
void cpu_loading_print(uint8 all, struct os_task_info *tsk_info, uint32 size);
|
||||
|
||||
void sys_wakeup_host(void);
|
||||
|
||||
void module_version_show(void);
|
||||
|
||||
extern const uint32 sdk_version;
|
||||
extern const uint32 svn_version;
|
||||
extern const uint32 app_version;
|
||||
|
||||
uint32 scatter_size(scatter_data *data, uint32 count);
|
||||
uint8 *scatter_offset(scatter_data *data, uint32 count, uint32 off);
|
||||
void trap_data_set(int8 id, void *addr, uint32 len);
|
||||
void trap_hdl_set(int8 id, void (*hdl)(void *), void *arg);
|
||||
void trap_data_dump(void);
|
||||
void trap_hdl_run(void);
|
||||
void set_errno(int32 err);
|
||||
int32 get_errno(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
31
sdk/include/lib/common/dsleepdata.h
Normal file
31
sdk/include/lib/common/dsleepdata.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef _HGIC_DSLEEP_DATA_H_
|
||||
#define _HGIC_DSLEEP_DATA_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum system_sleepdata_id {
|
||||
SYSTEM_SLEEPDATA_ID_LMAC,
|
||||
SYSTEM_SLEEPDATA_ID_UMAC,
|
||||
SYSTEM_SLEEPDATA_ID_PSALIVE,
|
||||
SYSTEM_SLEEPDATA_ID_PSCONNECT,
|
||||
SYSTEM_SLEEPDATA_ID_WKDATA,
|
||||
SYSTEM_SLEEPDATA_ID_USER,
|
||||
SYSTEM_SLEEPDATA_ID_SLEEPLOG,
|
||||
SYSTEM_SLEEPDATA_ID_MAX,
|
||||
};
|
||||
|
||||
extern void sys_sleepdata_init(void);
|
||||
extern void *sys_sleepdata_request(uint8 id, uint32 size);
|
||||
extern void sys_sleepdata_reset(void);
|
||||
extern uint32 sys_sleepdata_freesize(void);
|
||||
extern void *sys_sleepdata_get(uint8 id);
|
||||
extern int32 dsleeplog_int(uint32 size);
|
||||
extern void dsleeplog_print(void);
|
||||
extern void dsleeplog_save(char c);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
187
sdk/include/lib/common/rbuffer.h
Normal file
187
sdk/include/lib/common/rbuffer.h
Normal file
@@ -0,0 +1,187 @@
|
||||
#ifndef __RBUFFER_H__
|
||||
#define __RBUFFER_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define RB_NPOS(rb, pos, i) ({ \
|
||||
uint32 __pos__ = (rb)->pos;\
|
||||
((__pos__+(i)>=(rb)->qsize) ? (__pos__+(i)-(rb)->qsize) : (__pos__+(i))); \
|
||||
})
|
||||
|
||||
/* rpos == wpos 表示 rbuffer 为空 */
|
||||
#define RB_EMPTY(rb) ((rb)->wpos == (rb)->rpos)
|
||||
|
||||
/* wpos+1 == rpos 表示 rbuffer 已满 */
|
||||
#define RB_FULL(rb) ({ \
|
||||
uint32 _rpos_ = ((rb)->rpos);\
|
||||
uint32 _wpos_ = ((rb)->wpos)+1;\
|
||||
((_wpos_>=(rb)->qsize) ? (_wpos_-(rb)->qsize) : (_wpos_)) == (_rpos_);\
|
||||
})
|
||||
|
||||
/* rbuffer 中未被读取的数据长度 */
|
||||
#define RB_COUNT(rb) ({ \
|
||||
uint32 _rpos_ = ((rb)->rpos);\
|
||||
uint32 _wpos_ = ((rb)->wpos);\
|
||||
((_rpos_<=_wpos_)? (_wpos_-_rpos_): ((rb)->qsize-_rpos_+_wpos_));\
|
||||
})
|
||||
|
||||
/* rbuffer中剩余空间长度 */
|
||||
#define RB_IDLE(rb) ({ \
|
||||
uint32 _rpos_ = ((rb)->rpos);\
|
||||
uint32 _wpos_ = ((rb)->wpos);\
|
||||
((_wpos_<_rpos_)? (_rpos_-_wpos_-1): ((rb)->qsize-_wpos_+_rpos_-1));\
|
||||
})
|
||||
|
||||
/*ringbuffer define*/
|
||||
#define RBUFFER_DEF(name, type, size) \
|
||||
struct {\
|
||||
uint32 rpos, wpos, qsize;\
|
||||
type rbq[(size)+1];\
|
||||
}name
|
||||
|
||||
/*ringbuffer define (refference)*/
|
||||
#define RBUFFER_DEF_R(name, type) \
|
||||
struct {\
|
||||
uint32 rpos, wpos, qsize;\
|
||||
type *rbq;\
|
||||
}name
|
||||
|
||||
/*get a value from ringbuffer*/
|
||||
#define RB_GET(rb, val) ({\
|
||||
uint8 __ret__ = 0;\
|
||||
if(!RB_EMPTY(rb)){\
|
||||
val = (rb)->rbq[(rb)->rpos];\
|
||||
(rb)->rpos = RB_NPOS((rb), rpos, 1);\
|
||||
__ret__ = 1;\
|
||||
}\
|
||||
__ret__;\
|
||||
})
|
||||
|
||||
/*set a value into ringbuffer*/
|
||||
#define RB_SET(rb, val) ({\
|
||||
uint8 __ret__ = 0;\
|
||||
if(!RB_FULL(rb)){\
|
||||
(rb)->rbq[(rb)->wpos] = val;\
|
||||
(rb)->wpos = RB_NPOS((rb), wpos, 1);\
|
||||
__ret__ = 1;\
|
||||
}\
|
||||
__ret__;\
|
||||
})
|
||||
|
||||
#define RB_SET_F(rb, val) ({\
|
||||
if(RB_FULL(rb)) (rb)->rpos = RB_NPOS((rb), rpos, 1);\
|
||||
(rb)->rbq[(rb)->wpos] = val;\
|
||||
(rb)->wpos = RB_NPOS((rb), wpos, 1);\
|
||||
1;\
|
||||
})
|
||||
|
||||
/*get a value from ringbuffer in interrupt*/
|
||||
#define RB_INT_GET(rb, val) ({\
|
||||
uint8 __ret__ = 0;\
|
||||
uint32 flag = disable_irq(); \
|
||||
if(!RB_EMPTY(rb)){\
|
||||
val = (rb)->rbq[(rb)->rpos];\
|
||||
(rb)->rpos = RB_NPOS((rb), rpos, 1);\
|
||||
__ret__ = 1;\
|
||||
}\
|
||||
enable_irq(flag);\
|
||||
__ret__;\
|
||||
})
|
||||
|
||||
/*set a value into ringbuffer in interrupt*/
|
||||
#define RB_INT_SET(rb, val) ({\
|
||||
uint8 __ret__ = 0;\
|
||||
uint32 flag = disable_irq(); \
|
||||
if(!RB_FULL(rb)){\
|
||||
(rb)->rbq[(rb)->wpos] = val;\
|
||||
(rb)->wpos = RB_NPOS((rb), wpos, 1);\
|
||||
__ret__ = 1;\
|
||||
}\
|
||||
enable_irq(flag);\
|
||||
__ret__;\
|
||||
})
|
||||
|
||||
#define RB_INT_SET_F(rb, val) ({\
|
||||
uint32 flag = disable_irq(); \
|
||||
if(RB_FULL(rb)) (rb)->rpos = RB_NPOS((rb), rpos, 1);\
|
||||
(rb)->rbq[(rb)->wpos] = val;\
|
||||
(rb)->wpos = RB_NPOS((rb), wpos, 1);\
|
||||
enable_irq(flag);\
|
||||
1;\
|
||||
})
|
||||
|
||||
/*ringbuffer init*/
|
||||
#define RB_INIT(rb, size) do{\
|
||||
(rb)->qsize = (size)+1;\
|
||||
(rb)->rpos = 0;\
|
||||
(rb)->wpos = 0;\
|
||||
} while (0)
|
||||
|
||||
/*ringbuffer init (referrence mode)*/
|
||||
#define RB_INIT_R(rb, size, buff) do{\
|
||||
(rb)->qsize = (size);\
|
||||
(rb)->rpos = 0;\
|
||||
(rb)->wpos = 0;\
|
||||
(rb)->rbq = buff;\
|
||||
} while (0)
|
||||
|
||||
#define RB_RESET(rb) do{\
|
||||
uint32 flag = disable_irq(); \
|
||||
(rb)->rpos = 0;\
|
||||
(rb)->wpos = 0;\
|
||||
enable_irq(flag);\
|
||||
}while(0)
|
||||
|
||||
#define RB_INIT_ALLOC(rb, size) rbuffer_alloc((struct rbuffer *)(rb), size)
|
||||
#define RB_FREE(rb) rbuffer_free((struct rbuffer *)(rb))
|
||||
|
||||
struct rbuffer {
|
||||
uint32 rpos, wpos, qsize, bpos;
|
||||
char *rbq;
|
||||
};
|
||||
int32 rbuffer_init(struct rbuffer *rb, uint32 size, void *buff);
|
||||
int32 rbuffer_set(struct rbuffer *rb, void *data, uint32 length);
|
||||
int32 rbuffer_set_force(struct rbuffer *rb, void *data, uint32 length);
|
||||
int32 rbuffer_get(struct rbuffer *rb, void *buff, uint32 size);
|
||||
void rbuffer_destroy(struct rbuffer *rb);
|
||||
void rbuffer_reset(struct rbuffer *rb);
|
||||
int32 rbuffer_alloc(struct rbuffer *rb, uint32 size);
|
||||
void rbuffer_free(struct rbuffer *rb);
|
||||
|
||||
int32 rbuffer_set_block(struct rbuffer *rb, void *data, uint32 length, uint8 block);
|
||||
int32 rbuffer_get_block(struct rbuffer *rb, void *buff, uint32 size, uint8 *block);
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// 硬件模块可使用的ringbuffer, 默认仅支持 "1读-1写" 模式
|
||||
// 如果要支持 "多读-多写" 模式,需要打开 HWRB_IRQ 宏定义: 关中断后访问ringbuffer
|
||||
// 可支持 2~N 个小buffer乒乓使用,max_size 决定了每个乒乓小buffer的大小
|
||||
//#define HWRB_IRQ
|
||||
struct hwrbuffer {
|
||||
uint32 rpos, wpos, qsize, ipos;
|
||||
uint16 min_size, max_size;
|
||||
uint8 *buff;
|
||||
};
|
||||
|
||||
//初始化 ringbuffer:
|
||||
// max_size: 可写数据的buffer最大长度,大于此长度,则切分buffer使用
|
||||
// min_size: 可写数据的buffer最小长度,小于此长度,则忽略调过此buffer,使用下一块buffer
|
||||
void hwrbuffer_init(struct hwrbuffer *rb, uint8 *buff, uint32 size, uint16 max_size, uint16 min_size);
|
||||
|
||||
//更新写地址 并 获取下一个可写的buffer地址 和 长度
|
||||
//buff: 需要更新的buffer地址,并输出 下一个可写的buffer地址
|
||||
//size: 需要更新的buffer长度,并输出 下一个可写的buffer长度
|
||||
void hwrbuffer_update_wpos(struct hwrbuffer *rb, uint8 **buff, uint32 *size);
|
||||
|
||||
//更新读地址
|
||||
//buff: 更新已读取数据的buffer地址
|
||||
//size: 更新已读取数据的buffer长度
|
||||
void hwrbuffer_update_rpos(struct hwrbuffer *rb, uint8 *buff, uint32 size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
45
sdk/include/lib/common/sleep_api.h
Normal file
45
sdk/include/lib/common/sleep_api.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* @file sleep_api.h
|
||||
* @author HUGE-IC Application Team
|
||||
* @brief Dsleep mode function library
|
||||
* @version 1.0.0
|
||||
* @date 2021-9-6
|
||||
*
|
||||
* @copyright Copyright (c) 2021 HUGE-IC
|
||||
*/
|
||||
#ifndef _HGIC_SLEEP_API_H_
|
||||
#define _HGIC_SLEEP_API_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum sleep_setcfg_cmd {
|
||||
SLEEP_SETCFG_GPIOA_RESV,
|
||||
SLEEP_SETCFG_GPIOB_RESV,
|
||||
SLEEP_SETCFG_GPIOC_RESV,
|
||||
SLEEP_SETCFG_SLEEP_US,
|
||||
SLEEP_SETCFG_BOOT_MODE,
|
||||
SLEEP_SETCFG_DSLEEP_EN,
|
||||
SLEEP_SETCFG_WKSRC_DETECT,
|
||||
SLEEP_SETCFG_IO_LEVEL_WK,
|
||||
};
|
||||
|
||||
void system_sleep_enter_hook(void);
|
||||
void system_sleep_wakeup_hook(void);
|
||||
int32 system_sleep_rxdata_hook(uint8 *data, uint32 len);
|
||||
void system_sleep_config(uint32 cmd, uint32 param1, uint32 param2);
|
||||
void system_sleep_reset(void);
|
||||
|
||||
void dsleep_gpio_set_val(uint32 pin, uint32 val);
|
||||
uint32 dsleep_gpio_get_val(uint32 pin);
|
||||
|
||||
void dsleep_itoa(int32 n);
|
||||
void dsleep_print(char *buff);
|
||||
|
||||
//void delay_us(uint32 n);
|
||||
//uint32 io_input_meas_mv(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif // _HGIC_SLEEP_API_H_
|
||||
144
sdk/include/lib/common/sysevt.h
Normal file
144
sdk/include/lib/common/sysevt.h
Normal file
@@ -0,0 +1,144 @@
|
||||
#ifndef _SDK_SYSEVT_H_
|
||||
#define _SDK_SYSEVT_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
SYSEVT_CONTINUE = 0,
|
||||
SYSEVT_CONSUMED = 1,
|
||||
} sysevt_hdl_res;
|
||||
|
||||
typedef sysevt_hdl_res(*sysevt_hdl)(uint32 event_id, uint32 data, uint32 priv);
|
||||
|
||||
int32 sys_event_init(uint16 evt_max_cnt);
|
||||
int32 sys_event_new(uint32 event_id, uint32 data);
|
||||
int32 sys_event_take(uint32 event_id, sysevt_hdl hdl, uint32 priv);
|
||||
void sys_event_untake(uint32 event_id, sysevt_hdl hdl);
|
||||
|
||||
#define SYS_EVENT(main, sub) ((main)<<16|(sub&0xffff))
|
||||
|
||||
enum SYSEVT_MAINID { /* uint16 */
|
||||
SYS_EVENT_NETWORK = 1,
|
||||
SYS_EVENT_WIFI,
|
||||
SYS_EVENT_LMAC,
|
||||
SYS_EVENT_SYSTEM,
|
||||
SYS_EVENT_BLE,
|
||||
SYS_EVENT_LTE,
|
||||
SYS_EVENT_MEDIA,
|
||||
SYS_EVENT_USB,
|
||||
|
||||
////////////////////////////////////
|
||||
SYSEVT_MAINID_ID,
|
||||
};
|
||||
|
||||
//////////////////////////////////////////
|
||||
enum SYSEVT_SYSTEM_SUBEVT { /* uint16 */
|
||||
SYSEVT_SYSTEM_RESUME = 1,
|
||||
SYSEVT_SYSTEM_SD_MOUNT,
|
||||
SYSEVT_SYSTEM_SD_UNMOUNT,
|
||||
SYSEVT_TASK_DELETE,
|
||||
};
|
||||
#define SYSEVT_NEW_SYSTEM_EVT(subevt, data) sys_event_new(SYS_EVENT(SYS_EVENT_SYSTEM, subevt), data)
|
||||
|
||||
//////////////////////////////////////////
|
||||
enum SYSEVT_LMAC_SUBEVT { /* uint16 */
|
||||
SYSEVT_LMAC_ACS_DONE = 1,
|
||||
SYSEVT_LMAC_TX_STATUS = 2,
|
||||
SYSEVT_LMAC_APP_HBDATA_DETECT = 3, //检测到应用心跳包
|
||||
};
|
||||
#define SYSEVT_NEW_LMAC_EVT(subevt, data) sys_event_new(SYS_EVENT(SYS_EVENT_LMAC, subevt), data)
|
||||
|
||||
//////////////////////////////////////////
|
||||
enum SYSEVT_WIFI_SUBEVT { /* uint16 */
|
||||
SYSEVT_WIFI_CONNECT_START = 1, //STA start connect, event data: 0
|
||||
SYSEVT_WIFI_CONNECTTED, //STA connect success, event data: my AID.
|
||||
SYSEVT_WIFI_CONNECT_FAIL, //STA connect fail, event data: status code.
|
||||
SYSEVT_WIFI_DISCONNECT, //unused.
|
||||
SYSEVT_WIFI_SCAN_START, //Start Scanning, event data: 0
|
||||
SYSEVT_WIFI_SCAN_DONE, //Scan done, event data: 0
|
||||
SYSEVT_WIFI_STA_DISCONNECT, //STA disconnect, event data: STA's AID.
|
||||
SYSEVT_WIFI_STA_CONNECTTED, //STA connected, event data: STA's AID.
|
||||
SYSEVT_WIFI_STA_PS_START, //STA enter ps mode, event data: STA's AID.
|
||||
SYSEVT_WIFI_STA_PS_END, //STA exit ps mode, event data: STA's AID.
|
||||
SYSEVT_WIFI_PAIR_DONE, //pair done, event data: 1:success, 0:fail.
|
||||
SYSEVT_WIFI_TX_SUCCESS, //wifi tx success, event data: data tag setted by ieee80211_conf_set_datatag.
|
||||
SYSEVT_WIFI_TX_FAIL, //wifi tx fail, event data: data tag setted by ieee80211_conf_set_datatag.
|
||||
SYSEVT_WIFI_UNPAIR, //unpaired, event data:0
|
||||
SYSEVT_WIFI_WRONG_KEY, //wifi password is wrong. event data:0
|
||||
SYSEVT_WIFI_P2P_DONE, //p2p wsc done. update wifi syscfg
|
||||
};
|
||||
#define SYSEVT_NEW_WIFI_EVT(subevt, data) sys_event_new(SYS_EVENT(SYS_EVENT_WIFI, subevt), data)
|
||||
|
||||
//////////////////////////////////////////
|
||||
enum SYSEVT_NETWORK_SUBEVT { /* uint16 */
|
||||
SYSEVT_GMAC_LINK_UP = 1,
|
||||
SYSEVT_GMAC_LINK_DOWN,
|
||||
SYSEVT_LWIP_DHCPC_START,
|
||||
SYSEVT_LWIP_DHCPC_DONE,
|
||||
SYSEVT_WIFI_DHCPC_START,
|
||||
SYSEVT_WIFI_DHCPC_DONE,
|
||||
SYSEVT_DHCPD_NEW_IP,
|
||||
SYSEVT_DHCPD_IPPOOL_FULL,
|
||||
SYSEVT_NTP_UPDATE,
|
||||
};
|
||||
#define SYSEVT_NEW_NETWORK_EVT(subevt, data) sys_event_new(SYS_EVENT(SYS_EVENT_NETWORK, subevt), data)
|
||||
|
||||
//////////////////////////////////////////
|
||||
enum SYSEVT_BLE_SUBEVT { /* uint16 */
|
||||
SYSEVT_BLE_CONNECTED = 1,
|
||||
SYSEVT_BLE_DISCONNECT,
|
||||
SYSEVT_BLE_NETWORK_CONFIGURED,
|
||||
SYSEVT_BLE_EXCHANGE_MTU,
|
||||
};
|
||||
#define SYSEVT_NEW_BLE_EVT(subevt, data) sys_event_new(SYS_EVENT(SYS_EVENT_BLE, subevt), data)
|
||||
|
||||
//////////////////////////////////////////
|
||||
enum SYSEVT_LTE_SUBEVT { /* uint16 */
|
||||
SYSEVT_LTE_CONNECTED = 1,
|
||||
SYSEVT_LTE_DISCONNECT,
|
||||
SYSEVT_LTE_NETWORK_CONFIGURED,
|
||||
SYSEVT_LTE_OVERLAP_WIFI,
|
||||
};
|
||||
#define SYSEVT_NEW_LTE_EVT(subevt, data) sys_event_new(SYS_EVENT(SYS_EVENT_LTE, subevt), data)
|
||||
|
||||
|
||||
//////////////////////////////////////////
|
||||
enum SYSEVT_MEDIA_SUBEVT { /* uint16 */
|
||||
SYSEVT_MEDIA_PLAY_START = 1, //启动播放
|
||||
SYSEVT_MEDIA_PLAY_STOP, //停止播放
|
||||
SYSEVT_MEDIA_PLAYING, //进入播放状态
|
||||
SYSEVT_MEDIA_PLAY_PAUSE, //暂停播放
|
||||
SYSEVT_MEDIA_PLAY_SPEED, //播放速度改变
|
||||
SYSEVT_MEDIA_PLAY_SEEK_ERR, //播放跳转失败
|
||||
SYSEVT_MEDIA_PLAY_CLOSE, //播放器关闭
|
||||
|
||||
SYSEVT_MEDIA_OPEN_SUCCESS, //数据流打开成功
|
||||
SYSEVT_MEDIA_OPEN_FAIL, //数据流打开失败
|
||||
SYSEVT_MEDIA_READ_EOF, //数据流读取完成
|
||||
SYSEVT_MEDIA_READ_ERROR, //数据流读取出错
|
||||
SYSEVT_MEDIA_BUFFERING_DATA, //数据流缓冲等待
|
||||
|
||||
SYSEVT_MEDIA_UNKNOWN_CONTAINER, //未支持的container类型
|
||||
SYSEVT_MEDIA_UNKNOWN_DECODER, //未支持的decoder类型
|
||||
|
||||
SYSEVT_MEDIA_DECODER_MATCH, //decoder成功匹配
|
||||
SYSEVT_MEDIA_DECODER_ERROR, //decoder解码异常
|
||||
|
||||
SYSEVT_MEDIA_CONTAINER_MATCH, //container成功匹配
|
||||
SYSEVT_MEDIA_CONTAINER_OPEN_ERROR, //container打开失败
|
||||
SYSEVT_MEDIA_CONTAINER_DEMUX_ERROR, //container解码异常
|
||||
};
|
||||
#define SYSEVT_NEW_MEDIA_EVT(subevt, data) sys_event_new(SYS_EVENT(SYS_EVENT_MEDIA, subevt), data)
|
||||
|
||||
//////////////////////////////////////////
|
||||
enum SYSEVT_USB_SUBEVT { /* uint16 */
|
||||
SYSEVT_USB_DEVICE_CONNECT = 1, //USB设备连接
|
||||
SYSEVT_USB_DEVICE_DISCONNECT, //USB设备断开
|
||||
};
|
||||
#define SYSEVT_NEW_USB_EVT(subevt, data) sys_event_new(SYS_EVENT(SYS_EVENT_USB, subevt), data)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
12
sdk/include/lib/common/ticker_api.h
Normal file
12
sdk/include/lib/common/ticker_api.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef _HGIC_TICKER_API_H_
|
||||
#define _HGIC_TICKER_API_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void delay_us(uint32 n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user