relay7
2.1.0.0
|
API for configuring and manipulating Relay 7 Click driver. More...
Modules | |
Relay 7 Registers List | |
List of registers of Relay 7 Click driver. | |
Relay 7 Registers Settings | |
Settings for registers of Relay 7 Click driver. | |
Relay 7 MikroBUS Map | |
MikroBUS pin mapping of Relay 7 Click driver. | |
Functions | |
void | relay7_cfg_setup (relay7_cfg_t *cfg) |
Relay 7 configuration object setup function. More... | |
err_t | relay7_init (relay7_t *ctx, relay7_cfg_t *cfg) |
Relay 7 initialization function. More... | |
err_t | relay7_default_cfg (relay7_t *ctx) |
Relay 7 default configuration function. More... | |
void | relay7_reset_device (relay7_t *ctx) |
Relay 7 reset device function. More... | |
err_t | relay7_generic_write (relay7_t *ctx, uint8_t reg, uint8_t data_in) |
Relay 7 I2C writing function. More... | |
err_t | relay7_generic_read (relay7_t *ctx, uint8_t reg, uint8_t *data_out) |
Relay 7 I2C reading function. More... | |
err_t | relay7_set_port_expander (relay7_t *ctx, uint8_t set_mask, uint8_t pin_state) |
Relay 7 set port expander function. More... | |
err_t | relay7_set_relay (relay7_t *ctx, uint8_t relay_sel, relay7_relay_state_t state) |
Relay 7 set relay function. More... | |
uint8_t | relay7_get_interrupt (relay7_t *ctx) |
Relay 7 get interrupt function. More... | |
API for configuring and manipulating Relay 7 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void relay7_cfg_setup | ( | relay7_cfg_t * | cfg | ) |
Relay 7 configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See relay7_cfg_t object definition for detailed explanation. |
err_t relay7_default_cfg | ( | relay7_t * | ctx | ) |
Relay 7 default configuration function.
This function executes a default configuration of Relay 7 Click board.
[in] | ctx | : Click context object. See relay7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t relay7_generic_read | ( | relay7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Relay 7 I2C reading function.
This function reads the data bytes from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See relay7_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t relay7_generic_write | ( | relay7_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Relay 7 I2C writing function.
This function writes a data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See relay7_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t relay7_get_interrupt | ( | relay7_t * | ctx | ) |
Relay 7 get interrupt function.
This function returns the interrupt pin logic state.
[in] | ctx | : Click context object. See relay7_t object definition for detailed explanation. |
err_t relay7_init | ( | relay7_t * | ctx, |
relay7_cfg_t * | cfg | ||
) |
Relay 7 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
[out] | ctx | : Click context object. See relay7_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See relay7_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void relay7_reset_device | ( | relay7_t * | ctx | ) |
Relay 7 reset device function.
This function performs a hardware reset of the of the PCA9538A, Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on the Relay 7 Click board.
[in] | ctx | : Click context object. See relay7_t object definition for detailed explanation. |
err_t relay7_set_port_expander | ( | relay7_t * | ctx, |
uint8_t | set_mask, | ||
uint8_t | pin_state | ||
) |
Relay 7 set port expander function.
This function sets the output logic levels of the pins by using I2C serial interface.
[in] | ctx | : Click context object. See relay7_t object definition for detailed explanation. |
[in] | set_mask | : Set pin mask. |
[in] | pin_state | : Pin state. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t relay7_set_relay | ( | relay7_t * | ctx, |
uint8_t | relay_sel, | ||
relay7_relay_state_t | state | ||
) |
Relay 7 set relay function.
This function sets the desired state of the selected relay by using I2C serial interface.
[in] | ctx | : Click context object. See relay7_t object definition for detailed explanation. |
[in] | relay_sel | : Relay selection [1-4]. |
[in] | state | : Relay state. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.