ninaw152  2.1.0.0
Modules | Functions
NINA-W152 Click Driver

API for configuring and manipulating NINA-W152 Click driver. More...

Modules

 NINA-W152 Device Settings
 Settings for registers of NINA-W152 Click driver.
 
 NINA-W152 MikroBUS Map
 MikroBUS pin mapping of NINA-W152 Click driver.
 

Functions

void ninaw152_cfg_setup (ninaw152_cfg_t *cfg)
 NINA-W152 configuration object setup function. More...
 
err_t ninaw152_init (ninaw152_t *ctx, ninaw152_cfg_t *cfg)
 NINA-W152 initialization function. More...
 
void ninaw152_drv_interface_sel (ninaw152_cfg_t *cfg, ninaw152_drv_t drv_sel)
 NINA-W152 driver interface setup function. More...
 
err_t ninaw152_generic_write (ninaw152_t *ctx, uint8_t *data_in, uint16_t len)
 NINA-W152 data writing function. More...
 
err_t ninaw152_generic_read (ninaw152_t *ctx, uint8_t *data_out, uint16_t len)
 NINA-W152 data reading function. More...
 
void ninaw152_set_rst_pin (ninaw152_t *ctx, uint8_t state)
 NINA-W152 set rst pin function. More...
 
void ninaw152_reset_device (ninaw152_t *ctx)
 NINA-W152 reset device function. More...
 
void ninaw152_set_cts_pin (ninaw152_t *ctx, uint8_t state)
 NINA-W152 set cts pin function. More...
 
void ninaw152_set_esc_pin (ninaw152_t *ctx, uint8_t state)
 NINA-W152 set esc pin function. More...
 
uint8_t ninaw152_get_rts_pin (ninaw152_t *ctx)
 NINA-W152 get rts pin function. More...
 
uint8_t ninaw152_get_sry_pin (ninaw152_t *ctx)
 NINA-W152 get sry pin function. More...
 
void ninaw152_send_cmd (ninaw152_t *ctx, uint8_t *cmd)
 NINA-W152 send command function. More...
 
void ninaw152_send_cmd_with_par (ninaw152_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
 NINA-W152 send command with parameter function. More...
 
void ninaw152_send_cmd_check (ninaw152_t *ctx, uint8_t *at_cmd_buf)
 NINA-W152 send command check function. More...
 

Detailed Description

API for configuring and manipulating NINA-W152 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

◆ ninaw152_cfg_setup()

void ninaw152_cfg_setup ( ninaw152_cfg_t cfg)

NINA-W152 configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ ninaw152_drv_interface_sel()

void ninaw152_drv_interface_sel ( ninaw152_cfg_t cfg,
ninaw152_drv_t  drv_sel 
)

NINA-W152 driver interface setup function.

This function sets a serial driver interface which will be used further in the Click driver.

Parameters
[out]cfg: Click configuration structure. See ninaw152_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See ninaw152_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be called before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ ninaw152_generic_read()

err_t ninaw152_generic_read ( ninaw152_t ctx,
uint8_t *  data_out,
uint16_t  len 
)

NINA-W152 data reading function.

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

Parameters
[in]ctx: Click context object. See ninaw152_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]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.

◆ ninaw152_generic_write()

err_t ninaw152_generic_write ( ninaw152_t ctx,
uint8_t *  data_in,
uint16_t  len 
)

NINA-W152 data writing function.

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

Parameters
[in]ctx: Click context object. See ninaw152_t object definition for detailed explanation.
[in]data_in: 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.

◆ ninaw152_get_rts_pin()

uint8_t ninaw152_get_rts_pin ( ninaw152_t ctx)

NINA-W152 get rts pin function.

This function returns the UART request to send (RTS) pin logic state.

Parameters
[in]ctx: Click context object. See ninaw152_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ ninaw152_get_sry_pin()

uint8_t ninaw152_get_sry_pin ( ninaw152_t ctx)

NINA-W152 get sry pin function.

This function returns the SPI data ready signal (SRY) pin logic state.

Parameters
[in]ctx: Click context object. See ninaw152_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ ninaw152_init()

err_t ninaw152_init ( ninaw152_t ctx,
ninaw152_cfg_t cfg 
)

NINA-W152 initialization function.

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

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

◆ ninaw152_reset_device()

void ninaw152_reset_device ( ninaw152_t ctx)

NINA-W152 reset device function.

This function resets the device by toggling the RST pin state.

Parameters
[in]ctx: Click context object. See ninaw152_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ninaw152_send_cmd()

void ninaw152_send_cmd ( ninaw152_t ctx,
uint8_t *  cmd 
)

NINA-W152 send command function.

This function sends a specified command to the Click module.

Parameters
[in]ctx: Click context object. See ninaw152_t object definition for detailed explanation.
[in]cmd: Command string.
Returns
None.
Note
None.

◆ ninaw152_send_cmd_check()

void ninaw152_send_cmd_check ( ninaw152_t ctx,
uint8_t *  at_cmd_buf 
)

NINA-W152 send command check function.

This function sends a desired command with appended checkmark.

Parameters
[in]ctx: Click context object. See ninaw152_t object definition for detailed explanation.
[in]at_cmd_buf: Command buffer.
Returns
None.
Note
None.

◆ ninaw152_send_cmd_with_par()

void ninaw152_send_cmd_with_par ( ninaw152_t ctx,
uint8_t *  at_cmd_buf,
uint8_t *  param_buf 
)

NINA-W152 send command with parameter function.

This function sends a command with specified parameter to the Click module.

Parameters
[in]ctx: Click context object. See ninaw152_t object definition for detailed explanation.
[in]at_cmd_buf: Command buffer.
[in]param_buf: Parameter buffer.
Returns
None.
Note
None.

◆ ninaw152_set_cts_pin()

void ninaw152_set_cts_pin ( ninaw152_t ctx,
uint8_t  state 
)

NINA-W152 set cts pin function.

This function sets the UART clear to send (CTS) pin logic state.

Parameters
[in]ctx: Click context object. See ninaw152_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ ninaw152_set_esc_pin()

void ninaw152_set_esc_pin ( ninaw152_t ctx,
uint8_t  state 
)

NINA-W152 set esc pin function.

This function sets the UART DSR or escape from data mode (ESC) pin logic state.

Parameters
[in]ctx: Click context object. See ninaw152_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ ninaw152_set_rst_pin()

void ninaw152_set_rst_pin ( ninaw152_t ctx,
uint8_t  state 
)

NINA-W152 set rst pin function.

This function sets the reset (RST) pin logic state.

Parameters
[in]ctx: Click context object. See ninaw152_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.