calypso  2.1.0.0
Modules | Functions
Calypso Click Driver

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

Modules

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

Functions

void calypso_cfg_setup (calypso_cfg_t *cfg)
 Calypso configuration object setup function. More...
 
err_t calypso_init (calypso_t *ctx, calypso_cfg_t *cfg)
 Calypso initialization function. More...
 
err_t calypso_default_cfg (calypso_t *ctx)
 Calypso default configuration function. More...
 
err_t calypso_generic_write (calypso_t *ctx, uint8_t *data_in, uint16_t len)
 Calypso data writing function. More...
 
err_t calypso_generic_read (calypso_t *ctx, uint8_t *data_out, uint16_t len)
 Calypso data reading function. More...
 
err_t calypso_port_expander_write (calypso_t *ctx, uint8_t reg, uint8_t data_in)
 Calypso port expander data writing function. More...
 
err_t calypso_port_expander_read (calypso_t *ctx, uint8_t reg, uint8_t *data_out)
 Calypso port expander data reading function. More...
 
err_t calypso_set_pins (calypso_t *ctx, uint8_t set_mask, uint8_t clr_mask)
 Calypso set port expander pin function. More...
 
err_t calypso_set_app_mode (calypso_t *ctx, uint8_t mode_sel)
 Calypso set app mode function. More...
 
void calypso_set_rst_pin (calypso_t *ctx, uint8_t pin_state)
 Calypso set RST pin function. More...
 
void calypso_set_cts_pin (calypso_t *ctx, uint8_t pin_state)
 Calypso set CTS pin function. More...
 
void calypso_set_wup_pin (calypso_t *ctx, uint8_t pin_state)
 Calypso set WUP pin function. More...
 
uint8_t calypso_get_rts_pin (calypso_t *ctx)
 Calypso get RTS pin state function. More...
 
uint8_t calypso_get_rm0_pin (calypso_t *ctx)
 Calypso get RM0 pin state function. More...
 
void calypso_hw_reset (calypso_t *ctx)
 Calypso HW reset function. More...
 
void calypso_send_cmd (calypso_t *ctx, uint8_t *at_cmd_buf)
 Calypso send command function. More...
 
void calypso_send_cmd_with_par (calypso_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
 Calypso send command with parameter function. More...
 
void calypso_send_cmd_check (calypso_t *ctx, uint8_t *at_cmd_buf)
 Calypso send command check function. More...
 

Detailed Description

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

◆ calypso_cfg_setup()

void calypso_cfg_setup ( calypso_cfg_t cfg)

Calypso configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ calypso_default_cfg()

err_t calypso_default_cfg ( calypso_t ctx)

Calypso default configuration function.

This function executes a default configuration of CALYPSO Click board.

Parameters
[in]ctx: Click context object. See calypso_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ calypso_generic_read()

err_t calypso_generic_read ( calypso_t ctx,
uint8_t *  data_out,
uint16_t  len 
)

Calypso data reading function.

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

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

◆ calypso_generic_write()

err_t calypso_generic_write ( calypso_t ctx,
uint8_t *  data_in,
uint16_t  len 
)

Calypso data writing function.

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

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

◆ calypso_get_rm0_pin()

uint8_t calypso_get_rm0_pin ( calypso_t ctx)

Calypso get RM0 pin state function.

This function is used to get RM0 pin state.

Parameters
[in]ctx: Click context object. See calypso_t object definition for detailed explanation.
Returns
State of the RM0 pin.
Note
None.

◆ calypso_get_rts_pin()

uint8_t calypso_get_rts_pin ( calypso_t ctx)

Calypso get RTS pin state function.

This function is used to get RTS pin state.

Parameters
[in]ctx: Click context object. See calypso_t object definition for detailed explanation.
Returns
State of the RTS pin.
Note
None.

◆ calypso_hw_reset()

void calypso_hw_reset ( calypso_t ctx)

Calypso HW reset function.

This function is used to perform HW reset.

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

◆ calypso_init()

err_t calypso_init ( calypso_t ctx,
calypso_cfg_t cfg 
)

Calypso initialization function.

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

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

◆ calypso_port_expander_read()

err_t calypso_port_expander_read ( calypso_t ctx,
uint8_t  reg,
uint8_t *  data_out 
)

Calypso port expander data reading function.

This function reads a data byte from the selected register.

Parameters
[in]ctx: Click context object. See calypso_t object definition for detailed explanation.
[in]reg: Register to be read.
[out]data_out: Read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ calypso_port_expander_write()

err_t calypso_port_expander_write ( calypso_t ctx,
uint8_t  reg,
uint8_t  data_in 
)

Calypso port expander data writing function.

This function writes a data byte into the selected register.

Parameters
[in]ctx: Click context object. See calypso_t object definition for detailed explanation.
[in]reg: Register to be written.
[in]data_in: Data for sending.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ calypso_send_cmd()

void calypso_send_cmd ( calypso_t ctx,
uint8_t *  at_cmd_buf 
)

Calypso send command function.

This function is used to send a desired command.

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

◆ calypso_send_cmd_check()

void calypso_send_cmd_check ( calypso_t ctx,
uint8_t *  at_cmd_buf 
)

Calypso send command check function.

This function sends a desired command with the question mark for checking parameters.

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

◆ calypso_send_cmd_with_par()

void calypso_send_cmd_with_par ( calypso_t ctx,
uint8_t *  at_cmd_buf,
uint8_t *  param_buf 
)

Calypso send command with parameter function.

This function sends a desired command with the parameter.

Parameters
[in]ctx: Click context object. See calypso_t object definition for detailed explanation.
[in]at_cmd_buf: Command string.
[in]param_buf: Parameters string.
Returns
Nothing.
Note
None.

◆ calypso_set_app_mode()

err_t calypso_set_app_mode ( calypso_t ctx,
uint8_t  mode_sel 
)

Calypso set app mode function.

This function is used to set selected APP mode of CALYPSO Click board.

Parameters
[in]ctx: Click context object. See calypso_t object definition for detailed explanation.
[in]mode_sel: Selected APP mode.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ calypso_set_cts_pin()

void calypso_set_cts_pin ( calypso_t ctx,
uint8_t  pin_state 
)

Calypso set CTS pin function.

This function is used to set CTS pin state.

Parameters
[in]ctx: Click context object. See calypso_t object definition for detailed explanation.
[in]pin_state: State of the CTS pin.
Returns
Nothing.
Note
None.

◆ calypso_set_pins()

err_t calypso_set_pins ( calypso_t ctx,
uint8_t  set_mask,
uint8_t  clr_mask 
)

Calypso set port expander pin function.

This function is used to set port expander pin state.

Parameters
[in]ctx: Click context object. See calypso_t object definition for detailed explanation.
[in]set_mask: Pin set HIGH.
[in]clr_mask: Pin set LOW.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ calypso_set_rst_pin()

void calypso_set_rst_pin ( calypso_t ctx,
uint8_t  pin_state 
)

Calypso set RST pin function.

This function is used to set RST pin state.

Parameters
[in]ctx: Click context object. See calypso_t object definition for detailed explanation.
[in]pin_state: State of the RST pin.
Returns
Nothing.
Note
None.

◆ calypso_set_wup_pin()

void calypso_set_wup_pin ( calypso_t ctx,
uint8_t  pin_state 
)

Calypso set WUP pin function.

This function is used to set WUP pin state.

Parameters
[in]ctx: Click context object. See calypso_t object definition for detailed explanation.
[in]pin_state: State of the WUP pin.
Returns
Nothing.
Note
None.