ninaw152
2.1.0.0
|
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... | |
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.
void ninaw152_cfg_setup | ( | ninaw152_cfg_t * | cfg | ) |
NINA-W152 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ninaw152_cfg_t object definition for detailed explanation. |
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.
[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. |
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.
[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. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. See #err_t definition for detailed explanation. 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.
[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. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See ninaw152_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See ninaw152_t object definition for detailed explanation. |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void ninaw152_reset_device | ( | ninaw152_t * | ctx | ) |
NINA-W152 reset device function.
This function resets the device by toggling the RST pin state.
[in] | ctx | : Click context object. See ninaw152_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See ninaw152_t object definition for detailed explanation. |
[in] | cmd | : Command string. |
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.
[in] | ctx | : Click context object. See ninaw152_t object definition for detailed explanation. |
[in] | at_cmd_buf | : Command buffer. |
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.
[in] | ctx | : Click context object. See ninaw152_t object definition for detailed explanation. |
[in] | at_cmd_buf | : Command buffer. |
[in] | param_buf | : Parameter buffer. |
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.
[in] | ctx | : Click context object. See ninaw152_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[in] | ctx | : Click context object. See ninaw152_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[in] | ctx | : Click context object. See ninaw152_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |