solidswitch2 2.1.0.0
SolidSwitch 2 Click Driver

API for configuring and manipulating SolidSwitch 2 Click driver. More...

Topics

 SolidSwitch 2 Registers List
 List of registers of SolidSwitch 2 Click driver.
 
 SolidSwitch 2 Registers Settings
 Settings for registers of SolidSwitch 2 Click driver.
 
 SolidSwitch 2 MikroBUS Map
 MikroBUS pin mapping of SolidSwitch 2 Click driver.
 

Functions

void solidswitch2_cfg_setup (solidswitch2_cfg_t *cfg)
 SolidSwitch 2 configuration object setup function.
 
err_t solidswitch2_init (solidswitch2_t *ctx, solidswitch2_cfg_t *cfg)
 SolidSwitch 2 initialization function.
 
err_t solidswitch2_default_cfg (solidswitch2_t *ctx)
 SolidSwitch 2 default configuration function.
 
err_t solidswitch2_write_register (solidswitch2_t *ctx, uint8_t reg, uint8_t data_in)
 SolidSwitch 2 data writing function.
 
err_t solidswitch2_read_register (solidswitch2_t *ctx, uint8_t reg, uint8_t *data_out)
 SolidSwitch 2 data reading function.
 
err_t solidswitch2_check_communication (solidswitch2_t *ctx)
 SolidSwitch 2 check communication function.
 
void solidswitch2_set_idle_pin (solidswitch2_t *ctx, uint8_t state)
 SolidSwitch 2 set idle pin function.
 
void solidswitch2_set_in0_pin (solidswitch2_t *ctx, uint8_t state)
 SolidSwitch 2 set in0 pin function.
 
void solidswitch2_set_in1_pin (solidswitch2_t *ctx, uint8_t state)
 SolidSwitch 2 set in1 pin function.
 
void solidswitch2_toggle_in0_pin (solidswitch2_t *ctx)
 SolidSwitch 2 toggle in0 pin function.
 
void solidswitch2_toggle_in1_pin (solidswitch2_t *ctx)
 SolidSwitch 2 toggle in1 pin function.
 
err_t solidswitch2_soft_reset (solidswitch2_t *ctx)
 SolidSwitch 2 soft reset function.
 

Detailed Description

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

◆ solidswitch2_cfg_setup()

void solidswitch2_cfg_setup ( solidswitch2_cfg_t * cfg)

SolidSwitch 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ solidswitch2_check_communication()

err_t solidswitch2_check_communication ( solidswitch2_t * ctx)

SolidSwitch 2 check communication function.

This function checks the communication by reading and verifying the chip ID value.

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

◆ solidswitch2_default_cfg()

err_t solidswitch2_default_cfg ( solidswitch2_t * ctx)

SolidSwitch 2 default configuration function.

This function executes a default configuration of SolidSwitch 2 click board.

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

◆ solidswitch2_init()

err_t solidswitch2_init ( solidswitch2_t * ctx,
solidswitch2_cfg_t * cfg )

SolidSwitch 2 initialization function.

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

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

◆ solidswitch2_read_register()

err_t solidswitch2_read_register ( solidswitch2_t * ctx,
uint8_t reg,
uint8_t * data_out )

SolidSwitch 2 data reading function.

This function reads data from the selected register by using SPI serial interface.

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

◆ solidswitch2_set_idle_pin()

void solidswitch2_set_idle_pin ( solidswitch2_t * ctx,
uint8_t state )

SolidSwitch 2 set idle pin function.

This function sets the IDLE pin logic state.

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

◆ solidswitch2_set_in0_pin()

void solidswitch2_set_in0_pin ( solidswitch2_t * ctx,
uint8_t state )

SolidSwitch 2 set in0 pin function.

This function sets the IN0 pin logic state.

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

◆ solidswitch2_set_in1_pin()

void solidswitch2_set_in1_pin ( solidswitch2_t * ctx,
uint8_t state )

SolidSwitch 2 set in1 pin function.

This function sets the IN1 pin logic state.

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

◆ solidswitch2_soft_reset()

err_t solidswitch2_soft_reset ( solidswitch2_t * ctx)

SolidSwitch 2 soft reset function.

This function performs the software reset by setting a desired bit in the CFG_1 register.

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

◆ solidswitch2_toggle_in0_pin()

void solidswitch2_toggle_in0_pin ( solidswitch2_t * ctx)

SolidSwitch 2 toggle in0 pin function.

This function toggles the IN0 pin logic state.

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

◆ solidswitch2_toggle_in1_pin()

void solidswitch2_toggle_in1_pin ( solidswitch2_t * ctx)

SolidSwitch 2 toggle in1 pin function.

This function toggles the IN1 pin logic state.

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

◆ solidswitch2_write_register()

err_t solidswitch2_write_register ( solidswitch2_t * ctx,
uint8_t reg,
uint8_t data_in )

SolidSwitch 2 data writing function.

This function writes a desired data to the selected register by using SPI serial interface.

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