wirelesssun 2.1.0.0
Wireless SUN Click Driver

API for configuring and manipulating Wireless SUN Click driver. More...

Topics

 Wireless SUN Device Settings
 Settings for registers of Wireless SUN Click driver.
 
 Wireless SUN MikroBUS Map
 MikroBUS pin mapping of Wireless SUN Click driver.
 

Functions

void wirelesssun_cfg_setup (wirelesssun_cfg_t *cfg)
 Wireless SUN configuration object setup function.
 
err_t wirelesssun_init (wirelesssun_t *ctx, wirelesssun_cfg_t *cfg)
 Wireless SUN initialization function.
 
err_t wirelesssun_generic_write (wirelesssun_t *ctx, char *data_in, uint16_t len)
 Wireless SUN data writing function.
 
err_t wirelesssun_generic_read (wirelesssun_t *ctx, char *data_out, uint16_t len)
 Wireless SUN data reading function.
 
void wirelesssun_send_cmd (wirelesssun_t *ctx, char *cmd)
 Wireless SUN send cmd function.
 
void wirelesssun_send_cmd_with_parameter (wirelesssun_t *ctx, char *cmd, char *param_buf)
 Wireless SUN send cmd function.
 
void wirelesssun_reset_device (wirelesssun_t *ctx)
 Wireless SUN reset device function.
 
void wirelesssun_set_rst_pin (wirelesssun_t *ctx, uint8_t state)
 Wireless SUN set rst pin function.
 
void wirelesssun_set_cts_pin (wirelesssun_t *ctx, uint8_t state)
 Wireless SUN set cts pin function.
 
uint8_t wirelesssun_get_rts_pin (wirelesssun_t *ctx)
 Wireless SUN get rts pin function.
 

Detailed Description

API for configuring and manipulating Wireless SUN 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

◆ wirelesssun_cfg_setup()

void wirelesssun_cfg_setup ( wirelesssun_cfg_t * cfg)

Wireless SUN configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ wirelesssun_generic_read()

err_t wirelesssun_generic_read ( wirelesssun_t * ctx,
char * data_out,
uint16_t len )

Wireless SUN data reading function.

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

Parameters
[in]ctx: Click context object. See wirelesssun_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.

◆ wirelesssun_generic_write()

err_t wirelesssun_generic_write ( wirelesssun_t * ctx,
char * data_in,
uint16_t len )

Wireless SUN data writing function.

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

Parameters
[in]ctx: Click context object. See wirelesssun_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.

◆ wirelesssun_get_rts_pin()

uint8_t wirelesssun_get_rts_pin ( wirelesssun_t * ctx)

Wireless SUN get rts pin function.

This function returns the RTS pin logic state.

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

◆ wirelesssun_init()

err_t wirelesssun_init ( wirelesssun_t * ctx,
wirelesssun_cfg_t * cfg )

Wireless SUN initialization function.

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

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

◆ wirelesssun_reset_device()

void wirelesssun_reset_device ( wirelesssun_t * ctx)

Wireless SUN reset device function.

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

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

◆ wirelesssun_send_cmd()

void wirelesssun_send_cmd ( wirelesssun_t * ctx,
char * cmd )

Wireless SUN send cmd function.

This function sends a specified command to the click module.

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

◆ wirelesssun_send_cmd_with_parameter()

void wirelesssun_send_cmd_with_parameter ( wirelesssun_t * ctx,
char * cmd,
char * param_buf )

Wireless SUN send cmd function.

This function sends a specified command to the click module with desired parameters appended to.

Parameters
[in]ctx: Click context object. See wirelesssun_t object definition for detailed explanation.
[in]cmd: Command string to be send.
[in]param_buf: Command parameters string to be send.
Returns
None.
Note
None.

◆ wirelesssun_set_cts_pin()

void wirelesssun_set_cts_pin ( wirelesssun_t * ctx,
uint8_t state )

Wireless SUN set cts pin function.

This function sets the CTS pin logic state.

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

◆ wirelesssun_set_rst_pin()

void wirelesssun_set_rst_pin ( wirelesssun_t * ctx,
uint8_t state )

Wireless SUN set rst pin function.

This function sets the RST pin logic state.

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