lpwifi 2.0.0.0
LP WiFi Click Driver

API for configuring and manipulating LP WiFi Click driver. More...

Topics

 LP WiFi Commands List
 List of commands of LP WiFi Click driver.
 
 LP WiFi Device Settings
 Settings for registers of LP WiFi Click driver.
 
 LP WiFi MikroBUS Map
 MikroBUS pin mapping of LP WiFi Click driver.
 

Functions

void lpwifi_cfg_setup (lpwifi_cfg_t *cfg)
 LP WiFi configuration object setup function.
 
err_t lpwifi_init (lpwifi_t *ctx, lpwifi_cfg_t *cfg)
 LP WiFi initialization function.
 
void lpwifi_default_cfg (lpwifi_t *ctx)
 LP WiFi default configuration function.
 
err_t lpwifi_generic_write (lpwifi_t *ctx, char *data_buf, uint16_t len)
 LP WiFi data writing function.
 
err_t lpwifi_generic_read (lpwifi_t *ctx, char *data_buf, uint16_t max_len)
 LP WiFi data reading function.
 
void lpwifi_factory_reset_device (lpwifi_t *ctx)
 Device factory reset function.
 
void lpwifi_send_cmd (lpwifi_t *ctx, char *cmd)
 Send command function.
 
void lpwifi_send_cmd_with_parameter (lpwifi_t *ctx, char *at_cmd_buf, char *param_buf)
 Send command function with parameter.
 
void lpwifi_send_cmd_check (lpwifi_t *ctx, char *at_cmd_buf)
 Send command to check commands current value.
 
void lpwifi_connect_to_ap (lpwifi_t *ctx, char *ssid, char *password)
 Connect to AP function.
 
void lpwifi_set_wifi_mode (lpwifi_t *ctx, uint8_t mode)
 Set WiFi mode function.
 
void lpwifi_create_tcp_server (lpwifi_t *ctx, uint16_t port)
 Create TCP server function.
 
void lpwifi_create_udp_socket (lpwifi_t *ctx, uint16_t port)
 Create UDP socket function.
 

Detailed Description

API for configuring and manipulating LP WiFi Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ lpwifi_cfg_setup()

void lpwifi_cfg_setup ( lpwifi_cfg_t * cfg)

LP WiFi configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See lpwifi_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ lpwifi_connect_to_ap()

void lpwifi_connect_to_ap ( lpwifi_t * ctx,
char * ssid,
char * password )

Connect to AP function.

This function connects to the desired AP.

Parameters
[in]ctx: Click context object. See lpwifi_t object definition for detailed explanation.
[in]ssidSSID of AP.
[in]passwordAP password ( NULL - if the AP is OPEN ).
Returns
Nothing.

◆ lpwifi_create_tcp_server()

void lpwifi_create_tcp_server ( lpwifi_t * ctx,
uint16_t port )

Create TCP server function.

This function creates TCP server on the desired port.

Parameters
[in]ctx: Click context object. See lpwifi_t object definition for detailed explanation.
[in]portLocal port: 1-65535.
Returns
Nothing.

◆ lpwifi_create_udp_socket()

void lpwifi_create_udp_socket ( lpwifi_t * ctx,
uint16_t port )

Create UDP socket function.

This function creates UDP socket on the desired port.

Parameters
[in]ctx: Click context object. See lpwifi_t object definition for detailed explanation.
[in]portLocal port: 1-65535.
Returns
Nothing.

◆ lpwifi_default_cfg()

void lpwifi_default_cfg ( lpwifi_t * ctx)

LP WiFi default configuration function.

This function executes a default configuration of LP WiFi click board.

Parameters
[in]ctx: Click context object. See lpwifi_t object definition for detailed explanation.
Returns
None.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ lpwifi_factory_reset_device()

void lpwifi_factory_reset_device ( lpwifi_t * ctx)

Device factory reset function.

This function factory resets the device.

Parameters
ctxClick object. See lpwifi_t object definition for detailed explanation.
Returns
Nothing.

◆ lpwifi_generic_read()

err_t lpwifi_generic_read ( lpwifi_t * ctx,
char * data_buf,
uint16_t max_len )

LP WiFi data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See lpwifi_t object definition for detailed explanation.
[out]data_buf: Output read data.
[in]max_len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer.
See #err_t definition for detailed explanation.
Note
None.

◆ lpwifi_generic_write()

err_t lpwifi_generic_write ( lpwifi_t * ctx,
char * data_buf,
uint16_t len )

LP WiFi data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See lpwifi_t object definition for detailed explanation.
[in]data_buf: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ lpwifi_init()

err_t lpwifi_init ( lpwifi_t * ctx,
lpwifi_cfg_t * cfg )

LP WiFi initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See lpwifi_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See lpwifi_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ lpwifi_send_cmd()

void lpwifi_send_cmd ( lpwifi_t * ctx,
char * cmd )

Send command function.

This function sends the specified command to the click module.

Parameters
[in]ctx: Click context object. See lpwifi_t object definition for detailed explanation.
[in]cmdCommand variable.
Returns
Nothing.

◆ lpwifi_send_cmd_check()

void lpwifi_send_cmd_check ( lpwifi_t * ctx,
char * at_cmd_buf )

Send command to check commands current value.

Send AT command (at_cmd_buf) and appends '?' to check commands value.

Parameters
[in]ctx: Click context object. See lpwifi_t object definition for detailed explanation.
[in]at_cmd_buf: AT command.
Returns
Nothing.

◆ lpwifi_send_cmd_with_parameter()

void lpwifi_send_cmd_with_parameter ( lpwifi_t * ctx,
char * at_cmd_buf,
char * param_buf )

Send command function with parameter.

This function sends commands to the click module.

Parameters
[in]ctx: Click context object. See lpwifi_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
[in]param_bufParameter buffer.
Returns
Nothing.

◆ lpwifi_set_wifi_mode()

void lpwifi_set_wifi_mode ( lpwifi_t * ctx,
uint8_t mode )

Set WiFi mode function.

This function sets WiFi mode to STA or Soft-AP depending on the mode value.

Parameters
[in]ctx: Click context object. See lpwifi_t object definition for detailed explanation.
[in]mode0 - STA, 1 - Soft-AP.
Returns
Nothing.