spirit 2.0.0.0
SPIRIT Click Driver

API for configuring and manipulating SPIRIT Click driver. More...

Functions

void spirit_cfg_setup (spirit_cfg_t *cfg)
 SPIRIT configuration object setup function.
 
err_t spirit_init (spirit_t *ctx, spirit_cfg_t *cfg)
 SPIRIT initialization function.
 
void spirit_power_module (spirit_t *ctx, uint8_t power_state)
 Power module function.
 
void spirit_reset (spirit_t *ctx)
 Software reset function.
 
void spirit_set_mode (spirit_t *ctx, uint8_t mode)
 Set mode function.
 
void spirit_generic_write (spirit_t *ctx, char *data_buf, uint16_t len)
 SPIRIT data writing function.
 
int32_t spirit_generic_read (spirit_t *ctx, char *data_buf, uint16_t max_len)
 SPIRIT data reading function.
 
void spirit_send_cmd (spirit_t *ctx, char *cmd)
 Send command function.
 
void spirit_send_cmd_with_parameter (spirit_t *ctx, char *at_cmd_buf, char *param_buf)
 Send command function with parameter.
 
void spirit_send_cmd_check (spirit_t *ctx, char *at_cmd_buf)
 Check the sent command.
 
void spirit_send_cmd_parameter_check (spirit_t *ctx, char *at_cmd_buf)
 Check the command parameters.
 

Detailed Description

API for configuring and manipulating SPIRIT Click driver.

Function Documentation

◆ spirit_cfg_setup()

void spirit_cfg_setup ( spirit_cfg_t * cfg)

SPIRIT configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ spirit_generic_read()

int32_t spirit_generic_read ( spirit_t * ctx,
char * data_buf,
uint16_t max_len )

SPIRIT data reading function.

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

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

◆ spirit_generic_write()

void spirit_generic_write ( spirit_t * ctx,
char * data_buf,
uint16_t len )

SPIRIT data writing function.

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

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

◆ spirit_init()

err_t spirit_init ( spirit_t * ctx,
spirit_cfg_t * cfg )

SPIRIT initialization function.

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

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

◆ spirit_power_module()

void spirit_power_module ( spirit_t * ctx,
uint8_t power_state )

Power module function.

Function for power mode of SPIRIT click.

Parameters
ctxClick object.
power_stateState of PWM pin
Returns
Nothing.
Note
None.

◆ spirit_reset()

void spirit_reset ( spirit_t * ctx)

Software reset function.

Function for reseting SPIRIT click.

Parameters
ctxClick object.
Returns
Nothing.
Note
None.

◆ spirit_send_cmd()

void spirit_send_cmd ( spirit_t * ctx,
char * cmd )

Send command function.

This function sends the specified command to the click module.

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

◆ spirit_send_cmd_check()

void spirit_send_cmd_check ( spirit_t * ctx,
char * at_cmd_buf )

Check the sent command.

This function checks the command that is sent.

Parameters
[in]ctx: Click context object. See spirit_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
Returns
Nothing.
Note
None.

◆ spirit_send_cmd_parameter_check()

void spirit_send_cmd_parameter_check ( spirit_t * ctx,
char * at_cmd_buf )

Check the command parameters.

This function checks the command that is sent.

Parameters
[in]ctx: Click context object. See spirit_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
Returns
Nothing.
Note
None.

◆ spirit_send_cmd_with_parameter()

void spirit_send_cmd_with_parameter ( spirit_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 spirit_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
[in]param_bufParameter buffer.
Returns
Nothing.
Note
None.

◆ spirit_set_mode()

void spirit_set_mode ( spirit_t * ctx,
uint8_t mode )

Set mode function.

Function for setting mode of SPIRIT click.

Parameters
ctxClick object.
modeSet mode.
Returns
Nothing.
Note
None.