i2cmux7 2.0.0.0
|
API for configuring and manipulating I2C MUX 7 Click driver. More...
Topics | |
I2C MUX 7 Settings | |
Settings of I2C MUX 7 Click driver. | |
I2C MUX 7 MikroBUS Map | |
MikroBUS pin mapping of I2C MUX 7 Click driver. | |
Functions | |
void | i2cmux7_cfg_setup (i2cmux7_cfg_t *cfg) |
I2C MUX 7 configuration object setup function. | |
err_t | i2cmux7_init (i2cmux7_t *ctx, i2cmux7_cfg_t *cfg) |
I2C MUX 7 initialization function. | |
err_t | i2cmux7_set_channel (i2cmux7_t *ctx, uint8_t ch_sel, uint8_t ch_slave_addr) |
I2C MUX 7 set channel function. | |
err_t | i2cmux7_read_channel (i2cmux7_t *ctx, uint8_t *ch_sel) |
I2C MUX 7 read channel function. | |
void | i2cmux7_reset_device (i2cmux7_t *ctx) |
I2C MUX 7 reset device function. | |
err_t | i2cmux7_generic_write (i2cmux7_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
I2C MUX 7 I2C writing function. | |
err_t | i2cmux7_generic_read (i2cmux7_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
I2C MUX 7 I2C reading function. | |
API for configuring and manipulating I2C MUX 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 i2cmux7_cfg_setup | ( | i2cmux7_cfg_t * | cfg | ) |
I2C MUX 7 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See i2cmux7_cfg_t object definition for detailed explanation. |
err_t i2cmux7_generic_read | ( | i2cmux7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
I2C MUX 7 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See i2cmux7_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t i2cmux7_generic_write | ( | i2cmux7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
I2C MUX 7 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See i2cmux7_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t i2cmux7_init | ( | i2cmux7_t * | ctx, |
i2cmux7_cfg_t * | cfg ) |
I2C MUX 7 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See i2cmux7_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See i2cmux7_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t i2cmux7_read_channel | ( | i2cmux7_t * | ctx, |
uint8_t * | ch_sel ) |
I2C MUX 7 read channel function.
This function reads the currently selected channel value.
[in] | ctx | : Click context object. See i2cmux7_t object definition for detailed explanation. |
[out] | ch_sel | : Channel selection bit mask. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void i2cmux7_reset_device | ( | i2cmux7_t * | ctx | ) |
I2C MUX 7 reset device function.
This function resets the device by toggling the RST pin state.
[in] | ctx | : Click context object. See i2cmux7_t object definition for detailed explanation. |
err_t i2cmux7_set_channel | ( | i2cmux7_t * | ctx, |
uint8_t | ch_sel, | ||
uint8_t | ch_slave_addr ) |
I2C MUX 7 set channel function.
This function sets the desired channel active and configures its slave address.
[in] | ctx | : Click context object. See i2cmux7_t object definition for detailed explanation. |
[in] | ch_sel | : Channel selection bit mask. |
[in] | ch_slave_addr | : 7-bit slave address of the device connected to the channel. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.