solidswitch2 2.1.0.0
|
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. | |
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.
void solidswitch2_cfg_setup | ( | solidswitch2_cfg_t * | cfg | ) |
SolidSwitch 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See solidswitch2_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See solidswitch2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t solidswitch2_default_cfg | ( | solidswitch2_t * | ctx | ) |
SolidSwitch 2 default configuration function.
This function executes a default configuration of SolidSwitch 2 click board.
[in] | ctx | : Click context object. See solidswitch2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See solidswitch2_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See solidswitch2_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[in] | ctx | : Click context object. See solidswitch2_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[in] | ctx | : Click context object. See solidswitch2_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[in] | ctx | : Click context object. See solidswitch2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void solidswitch2_toggle_in0_pin | ( | solidswitch2_t * | ctx | ) |
SolidSwitch 2 toggle in0 pin function.
This function toggles the IN0 pin logic state.
[in] | ctx | : Click context object. See solidswitch2_t object definition for detailed explanation. |
void solidswitch2_toggle_in1_pin | ( | solidswitch2_t * | ctx | ) |
SolidSwitch 2 toggle in1 pin function.
This function toggles the IN1 pin logic state.
[in] | ctx | : Click context object. See solidswitch2_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See solidswitch2_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.