usbtoi2c2 2.0.0.0
USB to I2C 2 Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ usbtoi2c2_cfg_setup()

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.

Parameters
[out]cfg: Click configuration structure. See usbtoi2c2_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ usbtoi2c2_default_cfg()

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.

Parameters
[in]ctx: Click context object. See usbtoi2c2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ usbtoi2c2_flush_data()

err_t usbtoi2c2_flush_data ( usbtoi2c2_t * ctx)

USB to I2C 2 flush data function.

This function issues the flush data command.

Parameters
[in]ctx: Click context object. See usbtoi2c2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ usbtoi2c2_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ usbtoi2c2_read_data()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
CBUS1 signal must be configured as I2C_TXE# via USB using FT PROG application.

◆ usbtoi2c2_reset_device()

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.

Parameters
[in]ctx: Click context object. See usbtoi2c2_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ usbtoi2c2_soft_reset()

err_t usbtoi2c2_soft_reset ( usbtoi2c2_t * ctx)

USB to I2C 2 soft reset function.

This function issues the soft reset command.

Parameters
[in]ctx: Click context object. See usbtoi2c2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ usbtoi2c2_write_data()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
CBUS0 signal must be configured as I2C_RXF# via USB using FT PROG application.