solidswitch3 2.0.0.0
|
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. | |
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.
void solidswitch3_cfg_setup | ( | solidswitch3_cfg_t * | cfg | ) |
SolidSwitch 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See solidswitch3_cfg_t object definition for detailed explanation. |
err_t solidswitch3_default_cfg | ( | solidswitch3_t * | ctx | ) |
SolidSwitch 3 default configuration function.
This function executes a default configuration of SolidSwitch 3 click board.
[in] | ctx | : Click context object. See solidswitch3_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t solidswitch3_disable_output | ( | solidswitch3_t * | ctx, |
uint8_t | channel ) |
SolidSwitch 3 disable output function.
This function disables the specified output channel.
[in] | ctx | : Click context object. See solidswitch3_t object definition for detailed explanation. |
[in] | channel | : Bit mask representing the channel number. |
0
- Success, -1
- Error.err_t solidswitch3_enable_output | ( | solidswitch3_t * | ctx, |
uint8_t | channel ) |
SolidSwitch 3 enable output function.
This function enables the specified output channel.
[in] | ctx | : Click context object. See solidswitch3_t object definition for detailed explanation. |
[in] | channel | : Bit mask representing the channel number. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.void solidswitch3_reset | ( | solidswitch3_t * | ctx | ) |
SolidSwitch 3 reset function.
This function resets the device by toggling the reset pin.
[in] | ctx | : Click context object. See solidswitch3_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See solidswitch3_t object definition for detailed explanation. |
[in] | dir_mode | :
|
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See solidswitch3_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[in] | ctx | : Click context object. See solidswitch3_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[in] | ctx | : Click context object. See solidswitch3_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[in] | ctx | : Click context object. See solidswitch3_t object definition for detailed explanation. |
[in] | data_in | : 16bit data input. |
0
- Success, -1
- Error.