42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
66#define I2CISOLATOR2_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
69 cfg.pdis = MIKROBUS( mikrobus, MIKROBUS_PWM )
76#define I2CISOLATOR2_OK 0
77#define I2CISOLATOR2_ERROR -1
84#define I2CISOLATOR2_POWER_ENABLE 0
85#define I2CISOLATOR2_POWER_DISABLE 1
219 uint8_t *data_out, uint16_t out_len );
void i2cisolator2_enable_power(i2cisolator2_t *ctx, uint8_t state)
This function sets PDIS pin state.
err_t i2cisolator2_write_then_read(i2cisolator2_t *ctx, uint8_t *data_in, uint16_t in_len, uint8_t *data_out, uint16_t out_len)
Generic write then read function.
err_t i2cisolator2_read(i2cisolator2_t *ctx, uint8_t *data_out, uint16_t len)
Generic read function.
err_t i2cisolator2_init(i2cisolator2_t *ctx, i2cisolator2_cfg_t *cfg)
Initialization function.
err_t i2cisolator2_set_slave_address(i2cisolator2_t *ctx, uint8_t slave_addr)
Set slave address function.
void i2cisolator2_cfg_setup(i2cisolator2_cfg_t *cfg)
Config Object Initialization function.
err_t i2cisolator2_write(i2cisolator2_t *ctx, uint8_t *data_in, uint16_t len)
Generic write function.
Click configuration structure definition.
Definition i2cisolator2.h:116
uint32_t i2c_speed
Definition i2cisolator2.h:125
pin_name_t scl
Definition i2cisolator2.h:118
pin_name_t pdis
Definition i2cisolator2.h:122
pin_name_t sda
Definition i2cisolator2.h:119
uint8_t i2c_address
Definition i2cisolator2.h:126
Click ctx object definition.
Definition i2cisolator2.h:100
digital_out_t pdis
Definition i2cisolator2.h:102
i2c_master_t i2c
Definition i2cisolator2.h:105
uint8_t slave_address
Definition i2cisolator2.h:108