usbtoi2c2 2.0.0.0
|
API for configuring and manipulating USB to I2C 2 Click driver. More...
Topics | |
USB to I2C 2 Registers Settings | |
Settings for registers of USB to I2C 2 Click driver. | |
USB to I2C 2 MikroBUS Map | |
MikroBUS pin mapping of USB to I2C 2 Click driver. | |
Functions | |
void | usbtoi2c2_cfg_setup (usbtoi2c2_cfg_t *cfg) |
USB to I2C 2 configuration object setup function. | |
err_t | usbtoi2c2_init (usbtoi2c2_t *ctx, usbtoi2c2_cfg_t *cfg) |
USB to I2C 2 initialization function. | |
err_t | usbtoi2c2_default_cfg (usbtoi2c2_t *ctx) |
USB to I2C 2 default configuration function. | |
err_t | usbtoi2c2_write_data (usbtoi2c2_t *ctx, uint8_t *tx_buf, uint8_t tx_len) |
USB to I2C 2 write data function. | |
err_t | usbtoi2c2_read_data (usbtoi2c2_t *ctx, uint8_t *rx_buf, uint8_t rx_len) |
USB to I2C 2 read data function. | |
void | usbtoi2c2_reset_device (usbtoi2c2_t *ctx) |
USB to I2C 2 reset device function. | |
err_t | usbtoi2c2_soft_reset (usbtoi2c2_t *ctx) |
USB to I2C 2 soft reset function. | |
err_t | usbtoi2c2_flush_data (usbtoi2c2_t *ctx) |
USB to I2C 2 flush data function. | |
API for configuring and manipulating USB to I2C 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 usbtoi2c2_cfg_setup | ( | usbtoi2c2_cfg_t * | cfg | ) |
USB to I2C 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See usbtoi2c2_cfg_t object definition for detailed explanation. |
err_t usbtoi2c2_default_cfg | ( | usbtoi2c2_t * | ctx | ) |
USB to I2C 2 default configuration function.
This function executes a default configuration of USB to I2C 2 click board.
[in] | ctx | : Click context object. See usbtoi2c2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t usbtoi2c2_flush_data | ( | usbtoi2c2_t * | ctx | ) |
USB to I2C 2 flush data function.
This function issues the flush data command.
[in] | ctx | : Click context object. See usbtoi2c2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbtoi2c2_init | ( | usbtoi2c2_t * | ctx, |
usbtoi2c2_cfg_t * | cfg ) |
USB to I2C 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See usbtoi2c2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See usbtoi2c2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t usbtoi2c2_read_data | ( | usbtoi2c2_t * | ctx, |
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
USB to I2C 2 read data function.
This function reads a desired number of data bytes by using I2C serial interface.
[in] | ctx | : Click context object. See usbtoi2c2_t object definition for detailed explanation. |
[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. void usbtoi2c2_reset_device | ( | usbtoi2c2_t * | ctx | ) |
USB to I2C 2 reset device function.
This function resets the device by toggling the RST pin state.
[in] | ctx | : Click context object. See usbtoi2c2_t object definition for detailed explanation. |
err_t usbtoi2c2_soft_reset | ( | usbtoi2c2_t * | ctx | ) |
USB to I2C 2 soft reset function.
This function issues the soft reset command.
[in] | ctx | : Click context object. See usbtoi2c2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbtoi2c2_write_data | ( | usbtoi2c2_t * | ctx, |
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
USB to I2C 2 write data function.
This function writes a desired number of data bytes by using I2C serial interface.
[in] | ctx | : Click context object. See usbtoi2c2_t object definition for detailed explanation. |
[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.