i2cmux2 2.0.0.0
i2cmux2.h File Reference

This file contains API for I2C MUX 2 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  i2cmux2_t
 Click ctx object definition. More...
 
struct  i2cmux2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define I2CMUX2_MAP_MIKROBUS(cfg, mikrobus)
 
#define I2CMUX2_OK   0
 
#define I2CMUX2_ERROR   -1
 
#define I2CMUX2_I2C_SLAVE_ADDRESS_0   0x70
 
#define I2CMUX2_I2C_SLAVE_ADDRESS_1   0x71
 
#define I2CMUX2_I2C_SLAVE_ADDRESS_2   0x72
 
#define I2CMUX2_I2C_SLAVE_ADDRESS_3   0x73
 
#define I2CMUX2_I2C_SLAVE_ADDRESS_4   0x74
 
#define I2CMUX2_I2C_SLAVE_ADDRESS_5   0x75
 
#define I2CMUX2_I2C_SLAVE_ADDRESS_6   0x76
 
#define I2CMUX2_I2C_SLAVE_ADDRESS_7   0x77
 
#define I2CMUX2_CMD_NO_CH   0x00
 
#define I2CMUX2_CMD_SET_CH_0   0x01
 
#define I2CMUX2_CMD_SET_CH_1   0x02
 
#define I2CMUX2_CMD_SET_CH_2   0x04
 
#define I2CMUX2_CMD_SET_CH_3   0x08
 
#define I2CMUX2_INT_BITS   0xF0
 
#define I2CMUX2_INT_NO_CH   0x00
 
#define I2CMUX2_INT_CH_0   0x01
 
#define I2CMUX2_INT_CH_1   0x02
 
#define I2CMUX2_INT_CH_2   0x04
 
#define I2CMUX2_INT_CH_3   0x08
 
#define I2CMUX2_INT_PIN_STATE_ACTIVE   0x00
 
#define I2CMUX2_INT_PIN_STATE_NOT_ACTIVE   0x01
 

Functions

void i2cmux2_cfg_setup (i2cmux2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t i2cmux2_init (i2cmux2_t *ctx, i2cmux2_cfg_t *cfg)
 Initialization function.
 
void i2cmux2_generic_write (i2cmux2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void i2cmux2_generic_read (i2cmux2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void i2cmux2_hw_reset (i2cmux2_t *ctx)
 Hardware reset function.
 
void i2cmux2_write_cmd (i2cmux2_t *ctx, uint8_t tx_data)
 Write command function.
 
uint8_t i2cmux2_read_cmd (i2cmux2_t *ctx)
 Read command function.
 
void i2cmux2_set_channel (i2cmux2_t *ctx, uint8_t channel, uint8_t ch_slave_address)
 Set channel function.
 
uint8_t i2cmux2_read_interrupt (i2cmux2_t *ctx)
 Read interrupt status function.
 
uint8_t i2cmux2_check_int (i2cmux2_t *ctx)
 Check interrupt status function.
 

Detailed Description

This file contains API for I2C MUX 2 Click driver.