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 I2CMUX3_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
69 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST )
76#define I2CMUX3_RETVAL uint8_t
78#define I2CMUX3_OK 0x00
79#define I2CMUX3_INIT_ERROR 0xFF
86#define I2CMUX3_DEV_ADR_0 0x70
87#define I2CMUX3_DEV_ADR_1 0x71
88#define I2CMUX3_DEV_ADR_2 0x72
89#define I2CMUX3_DEV_ADR_3 0x73
90#define I2CMUX3_DEV_ADR_4 0x74
91#define I2CMUX3_DEV_ADR_5 0x75
92#define I2CMUX3_DEV_ADR_6 0x76
93#define I2CMUX3_DEV_ADR_7 0x77
100#define I2CMUX3_DIS_ALL_CH 0x00
101#define I2CMUX3_SEL_CH_0 0x01
102#define I2CMUX3_SEL_CH_1 0x02
103#define I2CMUX3_SEL_CH_2 0x04
104#define I2CMUX3_SEL_CH_3 0x08
105#define I2CMUX3_SEL_CH_4 0x10
106#define I2CMUX3_SEL_CH_5 0x20
107#define I2CMUX3_SEL_CH_6 0x40
108#define I2CMUX3_SEL_CH_7 0x80
115#define I2CMUX3_DEV_DIS 0x00
116#define I2CMUX3_DEV_EN 0x01
#define I2CMUX3_RETVAL
Definition i2cmux3.h:76
void i2cmux3_write_ctl(i2cmux3_t *ctx, uint8_t wr_data)
Write Control Register function.
void i2cmux3_wr_slv(i2cmux3_t *ctx, uint8_t slv_sel_adr, uint8_t reg, uint8_t *p_wr_data, uint8_t n_bytes)
Slave Device Write function.
void i2cmux3_ch_sel(i2cmux3_t *ctx, uint8_t sel_ch)
Select Channel function.
uint8_t i2cmux3_read_ctl(i2cmux3_t *ctx)
Read Control Register function.
void i2cmux3_generic_read(i2cmux3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
I2CMUX3_RETVAL i2cmux3_init(i2cmux3_t *ctx, i2cmux3_cfg_t *cfg)
Initialization function.
void i2cmux3_rd_slv(i2cmux3_t *ctx, uint8_t slv_sel_adr, uint8_t reg, uint8_t *p_rd_data, uint8_t n_bytes)
Slave Device Read function.
void i2cmux3_dev_enable(i2cmux3_t *ctx, uint8_t stat)
Device enable function.
void i2cmux3_hw_rst(i2cmux3_t *ctx)
Hardware reset function.
void i2cmux3_cfg_setup(i2cmux3_cfg_t *cfg)
Config Object Initialization function.
void i2cmux3_generic_write(i2cmux3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
Click configuration structure definition.
Definition i2cmux3.h:149
uint32_t i2c_speed
Definition i2cmux3.h:161
pin_name_t scl
Definition i2cmux3.h:152
pin_name_t sda
Definition i2cmux3.h:153
pin_name_t rst
Definition i2cmux3.h:157
uint8_t i2c_address
Definition i2cmux3.h:162
Click ctx object definition.
Definition i2cmux3.h:130
i2c_master_t i2c
Definition i2cmux3.h:137
digital_out_t rst
Definition i2cmux3.h:133
uint8_t slave_address
Definition i2cmux3.h:141