39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define USBTOI2C2_CMD_SOFT_RESET 0x06
74#define USBTOI2C2_CMD_FLUSH_DATA 0x0E
81#define USBTOI2C2_GENERAL_CALL_ADDRESS 0x00
82#define USBTOI2C2_DEVICE_SLAVE_ADDRESS 0x22
100#define USBTOI2C2_MAP_MIKROBUS( cfg, mikrobus ) \
101 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
102 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
103 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
104 cfg.tx_ind = MIKROBUS( mikrobus, MIKROBUS_AN ); \
105 cfg.rx_ind = MIKROBUS( mikrobus, MIKROBUS_INT )
err_t usbtoi2c2_init(usbtoi2c2_t *ctx, usbtoi2c2_cfg_t *cfg)
USB to I2C 2 initialization 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_cfg_setup(usbtoi2c2_cfg_t *cfg)
USB to I2C 2 configuration object setup function.
err_t usbtoi2c2_flush_data(usbtoi2c2_t *ctx)
USB to I2C 2 flush data function.
void usbtoi2c2_reset_device(usbtoi2c2_t *ctx)
USB to I2C 2 reset device function.
err_t usbtoi2c2_default_cfg(usbtoi2c2_t *ctx)
USB to I2C 2 default configuration function.
err_t usbtoi2c2_soft_reset(usbtoi2c2_t *ctx)
USB to I2C 2 soft reset function.
USB to I2C 2 Click configuration object.
Definition usbtoi2c2.h:136
pin_name_t tx_ind
Definition usbtoi2c2.h:142
pin_name_t rx_ind
Definition usbtoi2c2.h:143
uint32_t i2c_speed
Definition usbtoi2c2.h:145
pin_name_t scl
Definition usbtoi2c2.h:137
pin_name_t sda
Definition usbtoi2c2.h:138
pin_name_t rst
Definition usbtoi2c2.h:140
uint8_t i2c_address
Definition usbtoi2c2.h:146
USB to I2C 2 Click context object.
Definition usbtoi2c2.h:115
digital_in_t tx_ind
Definition usbtoi2c2.h:120
digital_in_t rx_ind
Definition usbtoi2c2.h:121
i2c_master_t i2c
Definition usbtoi2c2.h:124
digital_out_t rst
Definition usbtoi2c2.h:117
uint8_t slave_address
Definition usbtoi2c2.h:127
usbtoi2c2_return_value_t
USB to I2C 2 Click return value data.
Definition usbtoi2c2.h:155
@ USBTOI2C2_OK
Definition usbtoi2c2.h:156
@ USBTOI2C2_ERROR
Definition usbtoi2c2.h:157