i2cmux5 2.0.0.0
|
API for configuring and manipulating I2C MUX 5 Click driver. More...
Topics | |
I2C MUX 5 Registers List | |
List of registers of I2C MUX 5 Click driver. | |
I2C MUX 5 Registers Settings | |
Settings for registers of I2C MUX 5 Click driver. | |
I2C MUX 5 MikroBUS Map | |
MikroBUS pin mapping of I2C MUX 5 Click driver. | |
Sel_ch | |
Pin_state | |
Functions | |
void | i2cmux5_cfg_setup (i2cmux5_cfg_t *cfg) |
I2C MUX 5 configuration object setup function. | |
err_t | i2cmux5_init (i2cmux5_t *ctx, i2cmux5_cfg_t *cfg) |
I2C MUX 5 initialization function. | |
void | i2cmux5_default_cfg (i2cmux5_t *ctx) |
I2C MUX 5 default configuration function. | |
void | i2cmux5_hw_reset (i2cmux5_t *ctx) |
I2C MUX 5 HW reset function. | |
void | i2cmux5_dev_enable (i2cmux5_t *ctx) |
I2C MUX 5 enable the device function. | |
uint8_t | i2cmux5_check_rdy (i2cmux5_t *ctx) |
I2C MUX 5 check rdy function. | |
uint8_t | i2cmux5_check_alert (i2cmux5_t *ctx) |
I2C MUX 5 check alert function. | |
err_t | i2cmux5_generic_write (i2cmux5_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
I2C MUX 5 I2C writing function. | |
err_t | i2cmux5_generic_read (i2cmux5_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
I2C MUX 5 I2C reading function. | |
uint8_t | i2cmux5_check_ch_alert (i2cmux5_t *ctx, uint8_t n_channel) |
I2C MUX 5 check channel alert function. | |
void | i2cmux5_channel_write_byte (i2cmux5_t *ctx, uint8_t sel_ch, uint8_t ch_slave_addr, uint8_t reg, uint8_t tx_data) |
I2C MUX 5 I2C channel writing function. | |
uint8_t | i2cmux5_channel_read_byte (i2cmux5_t *ctx, uint8_t sel_ch, uint8_t ch_slave_addr, uint8_t reg) |
I2C MUX 5 I2C channel reading function. | |
API for configuring and manipulating I2C MUX 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void i2cmux5_cfg_setup | ( | i2cmux5_cfg_t * | cfg | ) |
I2C MUX 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See i2cmux5_cfg_t object definition for detailed explanation. |
uint8_t i2cmux5_channel_read_byte | ( | i2cmux5_t * | ctx, |
uint8_t | sel_ch, | ||
uint8_t | ch_slave_addr, | ||
uint8_t | reg ) |
I2C MUX 5 I2C channel 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 i2cmux5_t object definition for detailed explanation. |
[in] | sel_ch | : Number of the desired channel ( from 1 to 4 ). |
[in] | ch_slave_addr | : Slave address of the device connected to the desired channel. |
[in] | reg | : Start register address. |
See #err_t definition for detailed explanation.
void i2cmux5_channel_write_byte | ( | i2cmux5_t * | ctx, |
uint8_t | sel_ch, | ||
uint8_t | ch_slave_addr, | ||
uint8_t | reg, | ||
uint8_t | tx_data ) |
I2C MUX 5 I2C channel writing function.
This function writes via desired channel a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See i2cmux5_t object definition for detailed explanation. |
[in] | sel_ch | : Number of the desired channel ( from 1 to 4 ). |
[in] | ch_slave_addr | : Slave address of the device connected to the desired channel. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
uint8_t i2cmux5_check_alert | ( | i2cmux5_t * | ctx | ) |
I2C MUX 5 check alert function.
This function check fault alert output of I2C MUX 5 click board.
[in] | ctx | : Click context object. See i2cmux5_t object definition for detailed explanation. |
0
- A fault occurs to alert the host controller, 1
- Passes this information to the master on the upstream bus.uint8_t i2cmux5_check_ch_alert | ( | i2cmux5_t * | ctx, |
uint8_t | n_channel ) |
I2C MUX 5 check channel alert function.
This function reads a desired channel alert status of I2C MUX 5 click board.
[in] | ctx | : Click context object. See i2cmux5_t object definition for detailed explanation. |
[in] | ch_numb | : The number of the desired channel ( from 1 to 4 ). |
[in] | rx_len | : Number of bytes to be read. |
0
- Inactive, 1
- Active, 255
- Error, wrong channel selection.uint8_t i2cmux5_check_rdy | ( | i2cmux5_t * | ctx | ) |
I2C MUX 5 check rdy function.
This function check connection ready digital output of I2C MUX 5 click board.
[in] | ctx | : Click context object. See i2cmux5_t object definition for detailed explanation. |
0
- None of the downstream channels is connected, 1
- One or more downstream channels is connected.void i2cmux5_default_cfg | ( | i2cmux5_t * | ctx | ) |
I2C MUX 5 default configuration function.
This function executes a default configuration of I2C MUX 5 click board.
[in] | ctx | : Click context object. See i2cmux5_t object definition for detailed explanation. |
0
- Success, -1
- Error.void i2cmux5_dev_enable | ( | i2cmux5_t * | ctx | ) |
I2C MUX 5 enable the device function.
This function executes power-up of the device and enables I2C communication of I2C MUX 5 click board.
[in] | ctx | : Click context object. See i2cmux5_t object definition for detailed explanation. |
err_t i2cmux5_generic_read | ( | i2cmux5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
I2C MUX 5 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 i2cmux5_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.err_t i2cmux5_generic_write | ( | i2cmux5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
I2C MUX 5 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 i2cmux5_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.void i2cmux5_hw_reset | ( | i2cmux5_t * | ctx | ) |
I2C MUX 5 HW reset function.
This function executes a hardware reset of I2C MUX 5 click board.
[in] | ctx | : Click context object. See i2cmux5_t object definition for detailed explanation. |
err_t i2cmux5_init | ( | i2cmux5_t * | ctx, |
i2cmux5_cfg_t * | cfg ) |
I2C MUX 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See i2cmux5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See i2cmux5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.