C:/Users/jutiron/Desktop/Bitbucket_repository/wf200_driver/wf200.h File Reference

contains the definitions of the FMAC driver functions.

Functions

sl_status_t wf200_init (wf200_context_t *context)
 Init wf200.
 
sl_status_t wf200_deinit (void)
 Deinit wf200.
 
sl_status_t wf200_enable_irq (void)
 Enable wf200 irq.
 
sl_status_t wf200_disable_irq (void)
 Disable wf200 irq.
 
sl_status_t wf200_shutdown (void)
 Shutdown wf200.
 
sl_status_t wf200_receive_frame (uint32_t *frame_size)
 Receive available frame from wf200.
 
sl_status_t wf200_send_configuration (const char *pds_data, uint32_t pds_data_length)
 Function to send PDS chunks.
 
sl_status_t wf200_get_opn (uint8_t **opn)
 Get wf200 opn.
 
sl_status_t wf200_send_ethernet_frame (wf200_frame_t *frame, uint32_t data_length, wf200_interface_t interface)
 Send an Ethernet frame.
 
sl_status_t wf200_send_command (uint32_t command_id, void *data, uint32_t data_size, wf200_interface_t interface)
 Send a command to WF200.
 
sl_status_t wf200_set_access_mode_message (void)
 Set access mode message.
 
sl_status_t wf200_set_mac_address (const wf200_mac_address_t *mac, wf200_interface_t interface)
 Set the MAC address used by wf200.
 
sl_status_t wf200_set_power_mode (WfmPmMode mode, uint16_t interval)
 Set the power mode used as a station.
 
sl_status_t wf200_set_wake_up_bit (uint8_t state)
 Set wf200 wake up bit.
 
sl_status_t wf200_get_signal_strength (uint32_t *rcpi)
 Get the signal strength of the last packets received.
 
sl_status_t wf200_set_max_ap_client (uint32_t max_clients)
 Configure the maximum number of clients supported in softap mode.
 
sl_status_t wf200_add_multicast_address (const wf200_mac_address_t *mac_address, wf200_interface_t interface)
 Configure the maximum number of clients supported in softap mode //TODO.
 
sl_status_t wf200_send_join_command (const uint8_t *ssid, uint32_t ssid_length, uint16_t security_mode, const uint8_t *passkey, uint32_t passkey_length)
 As a station, send a command to join a Wi-Fi network.
 
sl_status_t wf200_send_disconnect_command (void)
 As a station, send a disconnection request to the AP.
 
sl_status_t wf200_send_scan_command (uint16_t scan_mode, const uint8_t *channel_list, uint16_t channel_list_count, const WfmHiSsidDef_t *ssid_list, uint16_t ssid_list_count, const uint8_t *ie_data, uint16_t ie_data_length)
 send a scan command
 
sl_status_t wf200_start_ap_command (uint32_t channel, uint8_t *ssid, uint32_t ssid_length, WfmSecurityMode security, const uint8_t *passkey, uint8_t passkey_length)
 Send a command to start the softap mode.
 
sl_status_t wf200_update_ap_command (uint16_t beacon_iedata_length, uint16_t proberesp_iedata_length, uint32_t *beacon_iedata, uint32_t *proberesp_iedata)
 Update AP settings.
 
sl_status_t wf200_stop_ap_command (void)
 Send a command to stop the softap mode.
 
sl_status_t wf200_disconnect_ap_client_command (const wf200_mac_address_t *client)
 In AP mode, disconnect the specified client.
 
sl_status_t wf200_set_antenna_config (wf200_antenna_config_t config)
 Configure the antenna setting of wf200.

contains the definitions of the FMAC driver functions.

Definition in file wf200.h.

Function Documentation

◆ wf200_deinit()

sl_status_t wf200_deinit ( void  )

Deinit wf200.

Returns
SL_SUCCESS if the deinitialization is successful, SL_ERROR otherwise

Definition at line 174 of file wf200.c.

References wf200_disable_irq().

◆ wf200_disable_irq()

sl_status_t wf200_disable_irq ( void  )

Disable wf200 irq.

Note
Disable the host irq and set wf200 register accordingly
Returns
SL_SUCCESS if the irq is disabled correctly, SL_ERROR otherwise

Definition at line 863 of file wf200.c.

Referenced by wf200_deinit().

◆ wf200_enable_irq()

sl_status_t wf200_enable_irq ( void  )

Enable wf200 irq.

Note
Enable the host irq and set wf200 register accordingly
Returns
SL_SUCCESS if the irq is enabled correctly, SL_ERROR otherwise

Definition at line 836 of file wf200.c.

◆ wf200_get_opn()

sl_status_t wf200_get_opn ( uint8_t **  opn)

Get wf200 opn.

Parameters
opn?? TODO
Returns
SL_SUCCESS if the value is retrieved correctly, SL_ERROR otherwise

Definition at line 1296 of file wf200.c.

◆ wf200_init()

sl_status_t wf200_init ( wf200_context_t context)

Init wf200.

Note
Actions performed by wf200_init(): Reset -> load firmware -> send PDS
Parameters
contextwf200 context to maintain wf200 information
Returns
SL_SUCCESS if the initialization is successful, SL_ERROR otherwise

Definition at line 95 of file wf200.c.

◆ wf200_receive_frame()

sl_status_t wf200_receive_frame ( uint32_t *  frame_size)

Receive available frame from wf200.

Parameters
frame_sizeframe size to be read from WF200. If 0, the driver will read the control register to retrieve the frame size.
Returns
SL_SUCCESS if the request has been sent correctly, SL_ERROR otherwise

Definition at line 791 of file wf200.c.

◆ wf200_send_command()

sl_status_t wf200_send_command ( uint32_t  command_id,
void *  data,
uint32_t  data_size,
wf200_interface_t  interface 
)

Send a command to WF200.

Parameters
command_idID of the command to be sent (cf. wfm_fm_api.h)
dataPointer to the data to be sent by the command
data_sizeSize of the data to be sent
interfaceInterface used to send the ethernet frame. wf200_interface_t.
  • WF200_STA_INTERFACE
  • WF200_SOFTAP_INTERFACE
Returns
SL_SUCCESS if the command is sent correctly, SL_ERROR otherwise

Definition at line 731 of file wf200.c.

Referenced by wf200_disconnect_ap_client_command(), wf200_send_disconnect_command(), wf200_send_stop_scan_command(), wf200_set_mac_address(), wf200_set_power_mode(), wf200_shutdown(), wf200_start_ap_command(), wf200_stop_ap_command(), and wf200_update_ap_command().

◆ wf200_set_access_mode_message()

sl_status_t wf200_set_access_mode_message ( void  )

Set access mode message.

Returns
SL_SUCCESS if the message mode is enabled correctly, SL_ERROR otherwise

Definition at line 888 of file wf200.c.

◆ wf200_set_antenna_config()

sl_status_t wf200_set_antenna_config ( wf200_antenna_config_t  config)

Configure the antenna setting of wf200.

Note
May require a re-init of the wf200 to change antenna again. Seems to be required to change antenna more than once.
Parameters
configantenna configuration to be used.
  • WF200_ANTENNA_1_ONLY
  • WF200_ANTENNA_2_ONLY
  • WF200_ANTENNA_TX1_RX2
  • WF200_ANTENNA_TX2_RX1
  • WF200_ANTENNA_DIVERSITY
Returns
SL_SUCCESS if the setting is applied correctly, SL_ERROR otherwise

Definition at line 1247 of file wf200.c.

◆ wf200_set_wake_up_bit()

sl_status_t wf200_set_wake_up_bit ( uint8_t  state)

Set wf200 wake up bit.

Note
Depending on the state parameter, set or reset the wake up bit
Parameters
state0 to reset the wake up bit, set the wake up bit otherwise
Returns
SL_SUCCESS if the bit has been set correctly, SL_ERROR otherwise

Definition at line 911 of file wf200.c.