XCORE SDK
XCORE Software Development Kit
sl_wfx_host.h
1 // Copyright 2021 XMOS LIMITED. This Software is subject to the terms of the
2 // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3 
4 #ifndef SL_WFX_HOST_H_
5 #define SL_WFX_HOST_H_
6 
7 #include "FreeRTOS.h"
8 #include "event_groups.h"
9 
10 #include "rtos_spi_master.h"
11 #include "rtos_gpio.h"
12 
17 #define SL_WFX_HIF_GPIO_WUP 0
18 
23 #define SL_WFX_HIF_GPIO_RESET 1
24 
31 #define SL_WFX_NORMAL_FRAME_PAD_LENGTH 2
32 
37 #define SL_WFX_INTERRUPT ( 1 << 0 )
38 #define SL_WFX_CONNECT ( 1 << 1 )
39 #define SL_WFX_DISCONNECT ( 1 << 2 )
40 #define SL_WFX_START_AP ( 1 << 3 )
41 #define SL_WFX_STOP_AP ( 1 << 4 )
42 #define SL_WFX_SCAN_COMPLETE ( 1 << 5 )
43 #define SL_WFX_CONNECT_FAIL ( 1 << 6 )
44 #define SL_WFX_START_AP_FAIL ( 1 << 7 )
45 #define SL_WFX_INITIALIZED ( 1 << 8 )
46 #define SL_WFX_DEINITIALIZED ( 1 << 9 )
47 #define SL_WFX_WAKEUP ( 1 << 10 )
50 extern EventGroupHandle_t sl_wfx_event_group;
51 
70 void sl_wfx_host_set_hif(rtos_spi_master_device_t *spi_dev,
71  rtos_gpio_t *gpio_dev,
72  rtos_gpio_port_id_t wirq_gpio_port, int wirq_bit,
73  rtos_gpio_port_id_t wup_gpio_port, int wup_bit,
74  rtos_gpio_port_id_t reset_gpio_port, int reset_bit);
75 
83 void sl_wfx_host_set_pds(const char * const pds_data[],
84  uint16_t pds_size);
85 
94 void sl_wfx_host_reset(void);
95 
100 void sl_wfx_scan_result_callback(sl_wfx_scan_result_ind_body_t* scan_result);
101 void sl_wfx_scan_complete_callback(sl_wfx_fmac_status_t status);
102 void sl_wfx_connect_callback(uint8_t* mac, sl_wfx_fmac_status_t status);
103 void sl_wfx_disconnect_callback(uint8_t* mac, sl_wfx_disconnected_reason_t reason);
104 void sl_wfx_start_ap_callback(sl_wfx_fmac_status_t status);
105 void sl_wfx_stop_ap_callback(void);
106 void sl_wfx_client_connected_callback(uint8_t* mac);
107 void sl_wfx_ap_client_rejected_callback(sl_wfx_reason_t reason, uint8_t* mac);
108 void sl_wfx_ap_client_disconnected_callback(sl_wfx_reason_t reason, uint8_t* mac);
109 void sl_wfx_host_received_frame_callback(sl_wfx_received_ind_t* rx_buffer);
110 void sl_wfx_reset_request_callback(void);
113 #endif /* SL_WFX_HOST_H_ */
enum sl_wfx_reason_e sl_wfx_reason_t
Reasons for AP to reject or disconnect a client.
enum sl_wfx_fmac_status_e sl_wfx_fmac_status_t
Full MAC (UMAC) confirmation possible values for a returned 'status' field.
enum sl_wfx_disconnected_reason_e sl_wfx_disconnected_reason_t
Reasons for STA disconnection.
rtos_gpio_port_id_t
Definition: rtos_gpio.h:24
Definition: rtos_gpio.h:106
Definition: rtos_spi_master.h:63
Indication message used to signal a received packet.
Definition: sl_wfx_cmd_api.h:1674
Indication message body for sl_wfx_scan_result_ind_t.
Definition: sl_wfx_cmd_api.h:1822