solidswitch 2.0.0.0
SolidSwitch Click Driver

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

Topics

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

Functions

void solidswitch_cfg_setup (solidswitch_cfg_t *cfg)
 SolidSwitch configuration object setup function.
 
err_t solidswitch_init (solidswitch_t *ctx, solidswitch_cfg_t *cfg)
 SolidSwitch initialization function.
 
err_t solidswitch_default_cfg (solidswitch_t *ctx)
 SolidSwitch default configuration function.
 
err_t solidswitch_write_single (solidswitch_t *ctx, uint8_t logic_state)
 SolidSwitch I2C writing logic state function.
 
err_t solidswitch_write_two_bytes (solidswitch_t *ctx, uint8_t logic_state, uint8_t int_mask)
 SolidSwitch I2C writing logic state and interrupt mask function.
 
err_t solidswitch_read_single (solidswitch_t *ctx, uint8_t *logic_state)
 SolidSwitch I2C reading logic state function.
 
err_t solidswitch_read_two_bytes (solidswitch_t *ctx, uint8_t *logic_state, uint8_t *transition_flags)
 SolidSwitch I2C reading logic state and transition flags function.
 
void solidswitch_reset (solidswitch_t *ctx)
 SolidSwitch reset function.
 
uint8_t solidswitch_get_int_state (solidswitch_t *ctx)
 SolidSwitch get int pin state function.
 

Detailed Description

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

◆ solidswitch_cfg_setup()

void solidswitch_cfg_setup ( solidswitch_cfg_t * cfg)

SolidSwitch configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ solidswitch_default_cfg()

err_t solidswitch_default_cfg ( solidswitch_t * ctx)

SolidSwitch default configuration function.

This function executes a default configuration of SolidSwitch click board.

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

◆ solidswitch_get_int_state()

uint8_t solidswitch_get_int_state ( solidswitch_t * ctx)

SolidSwitch get int pin state function.

This function reads the state of int pin.

Parameters
[in]ctx: Click context object. See solidswitch_t object definition for detailed explanation.
Returns
INT pin state.
Note
None.

◆ solidswitch_init()

err_t solidswitch_init ( solidswitch_t * ctx,
solidswitch_cfg_t * cfg )

SolidSwitch initialization function.

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

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

◆ solidswitch_read_single()

err_t solidswitch_read_single ( solidswitch_t * ctx,
uint8_t * logic_state )

SolidSwitch I2C reading logic state function.

This function reads a single byte by using I2C serial interface.

Parameters
[in]ctx: Click context object. See solidswitch_t object definition for detailed explanation.
[out]logic_state: Logic state output.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ solidswitch_read_two_bytes()

err_t solidswitch_read_two_bytes ( solidswitch_t * ctx,
uint8_t * logic_state,
uint8_t * transition_flags )

SolidSwitch I2C reading logic state and transition flags function.

This function reads two bytes by using I2C serial interface.

Parameters
[in]ctx: Click context object. See solidswitch_t object definition for detailed explanation.
[out]logic_state: Logic state output.
[out]transition_flags: Transition flags output.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ solidswitch_reset()

void solidswitch_reset ( solidswitch_t * ctx)

SolidSwitch reset function.

This function resets the device via rst pin.

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

◆ solidswitch_write_single()

err_t solidswitch_write_single ( solidswitch_t * ctx,
uint8_t logic_state )

SolidSwitch I2C writing logic state function.

This function writes a single byte by using I2C serial interface.

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

◆ solidswitch_write_two_bytes()

err_t solidswitch_write_two_bytes ( solidswitch_t * ctx,
uint8_t logic_state,
uint8_t int_mask )

SolidSwitch I2C writing logic state and interrupt mask function.

This function writes two bytes by using I2C serial interface.

Parameters
[in]ctx: Click context object. See solidswitch_t object definition for detailed explanation.
[in]logic_state: Logic state mask.
[in]int_mask: Interrupt mask.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.