solidswitch3 2.0.0.0
SolidSwitch 3 Click Driver

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

Topics

 SolidSwitch 3 Settings
 Settings of SolidSwitch 3 Click driver.
 
 SolidSwitch 3 MikroBUS Map
 MikroBUS pin mapping of SolidSwitch 3 Click driver.
 

Functions

void solidswitch3_cfg_setup (solidswitch3_cfg_t *cfg)
 SolidSwitch 3 configuration object setup function.
 
err_t solidswitch3_init (solidswitch3_t *ctx, solidswitch3_cfg_t *cfg)
 SolidSwitch 3 initialization function.
 
err_t solidswitch3_default_cfg (solidswitch3_t *ctx)
 SolidSwitch 3 default configuration function.
 
err_t solidswitch3_write_data (solidswitch3_t *ctx, uint16_t data_in)
 SolidSwitch 3 write data function.
 
err_t solidswitch3_enable_output (solidswitch3_t *ctx, uint8_t channel)
 SolidSwitch 3 enable output function.
 
err_t solidswitch3_disable_output (solidswitch3_t *ctx, uint8_t channel)
 SolidSwitch 3 disable output function.
 
void solidswitch3_reset (solidswitch3_t *ctx)
 SolidSwitch 3 reset function.
 
void solidswitch3_set_dir_mode (solidswitch3_t *ctx, uint8_t dir_mode)
 SolidSwitch 3 set dir mode function.
 
void solidswitch3_set_rst_pin (solidswitch3_t *ctx, uint8_t state)
 SolidSwitch 3 set rst pin function.
 
void solidswitch3_set_in1_pin (solidswitch3_t *ctx, uint8_t state)
 SolidSwitch 3 set in1 pin function.
 
void solidswitch3_set_in2_pin (solidswitch3_t *ctx, uint8_t state)
 SolidSwitch 3 set in2 pin function.
 

Detailed Description

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

◆ solidswitch3_cfg_setup()

void solidswitch3_cfg_setup ( solidswitch3_cfg_t * cfg)

SolidSwitch 3 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ solidswitch3_default_cfg()

err_t solidswitch3_default_cfg ( solidswitch3_t * ctx)

SolidSwitch 3 default configuration function.

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

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

◆ solidswitch3_disable_output()

err_t solidswitch3_disable_output ( solidswitch3_t * ctx,
uint8_t channel )

SolidSwitch 3 disable output function.

This function disables the specified output channel.

Parameters
[in]ctx: Click context object. See solidswitch3_t object definition for detailed explanation.
[in]channel: Bit mask representing the channel number.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ solidswitch3_enable_output()

err_t solidswitch3_enable_output ( solidswitch3_t * ctx,
uint8_t channel )

SolidSwitch 3 enable output function.

This function enables the specified output channel.

Parameters
[in]ctx: Click context object. See solidswitch3_t object definition for detailed explanation.
[in]channel: Bit mask representing the channel number.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ solidswitch3_init()

err_t solidswitch3_init ( solidswitch3_t * ctx,
solidswitch3_cfg_t * cfg )

SolidSwitch 3 initialization function.

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

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

◆ solidswitch3_reset()

void solidswitch3_reset ( solidswitch3_t * ctx)

SolidSwitch 3 reset function.

This function resets the device by toggling the reset pin.

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

◆ solidswitch3_set_dir_mode()

void solidswitch3_set_dir_mode ( solidswitch3_t * ctx,
uint8_t dir_mode )

SolidSwitch 3 set dir mode function.

This function sets the communication protocol via the DIR pin.

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

◆ solidswitch3_set_in1_pin()

void solidswitch3_set_in1_pin ( solidswitch3_t * ctx,
uint8_t state )

SolidSwitch 3 set in1 pin function.

This function sets the input 1 pin logic state.

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

◆ solidswitch3_set_in2_pin()

void solidswitch3_set_in2_pin ( solidswitch3_t * ctx,
uint8_t state )

SolidSwitch 3 set in2 pin function.

This function sets the input 2 pin logic state.

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

◆ solidswitch3_set_rst_pin()

void solidswitch3_set_rst_pin ( solidswitch3_t * ctx,
uint8_t state )

SolidSwitch 3 set rst pin function.

This function sets the reset pin logic state.

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

◆ solidswitch3_write_data()

err_t solidswitch3_write_data ( solidswitch3_t * ctx,
uint16_t data_in )

SolidSwitch 3 write data function.

This function writes a desired data and verifies if it is written correctly by reading it back by using SPI serial interface. The read data will be stored in ctx->output_state.

Parameters
[in]ctx: Click context object. See solidswitch3_t object definition for detailed explanation.
[in]data_in: 16bit data input.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.