i2cextend 2.0.0.0
i2cextend.h File Reference

This file contains API for I2C Extend 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  i2cextend_t
 I2C Extend Click context object. More...
 
struct  i2cextend_cfg_t
 I2C Extend Click configuration object. More...
 
struct  i2cextend_status_data_t
 I2C Extend Click status data. More...
 
struct  i2cextend_fault_data_t
 I2C Extend Click fault data. More...
 

Macros

#define I2CEXTEND_REG_CONFIG   0x00
 I2C Extend description register.
 
#define I2CEXTEND_REG_STATUS   0x01
 
#define I2CEXTEND_REG_EVENT   0x02
 
#define I2CEXTEND_REG_ALERT_EN   0x03
 
#define I2CEXTEND_REG_FAULT   0x04
 
#define I2CEXTEND_REG_SCRATCH   0x05
 
#define I2CEXTEND_REG_ADDR_TRANS   0x06
 
#define I2CEXTEND_REG_CTRL   0x07
 
#define C6DOFIMU11_REG_WHO_AM_I   0x00
 6DOF IMU 11 description register.
 
#define C6DOFIMU11_REG_CNTL2   0x3A
 
#define C6DOFIMU11_REG_INC3   0x2C
 
#define C6DOFIMU11_REG_ACCEL_XOUT_L   0x0A
 
#define C6DOFIMU11_REG_ACCEL_YOUT_L   0x0C
 
#define C6DOFIMU11_REG_ACCEL_ZOUT_L   0x0E
 
#define C6DOFIMU11_REG_MAG_XOUT_L   0x10
 
#define C6DOFIMU11_REG_MAG_YOUT_L   0x12
 
#define C6DOFIMU11_REG_MAG_ZOUT_L   0x14
 
#define I2CEXTEND_CONFIG_INTR_MODE_BIT_MASK   0x01
 I2C Extend description setting.
 
#define I2CEXTEND_CONFIG_INTR_MODE_SET_ALERT_PIN   0x00
 
#define I2CEXTEND_CONFIG_INTR_MODE_IGNORE_ARA   0x01
 
#define I2CEXTEND_CONFIG_CTRL_SEL_BIT_MASK   0x02
 
#define I2CEXTEND_CONFIG_CTRL_SEL_MIRRORED_RMT_OUT   0x00
 
#define I2CEXTEND_CONFIG_CTRL_SEL_USE_REG_CTRL_VAL   0x02
 
#define I2CEXTEND_ALERT_EN_LINK_GOOD_DISABLE   0x00
 I2C Extend alert enable.
 
#define I2CEXTEND_ALERT_EN_LINK_GOOD   0x01
 
#define I2CEXTEND_ALERT_EN_LINK_LOST_DISABLE   0x00
 
#define I2CEXTEND_ALERT_EN_LINK_LOST   0x02
 
#define I2CEXTEND_ALERT_EN_FAULT_DISABLE   0x00
 
#define I2CEXTEND_ALERT_EN_FAULT   0x04
 
#define I2CEXTEND_CTRL_SEL_L   0x00
 I2C Extend control.
 
#define I2CEXTEND_CTRL_SEL_H   0x01
 
#define I2CEXTEND_PIN_STATE_LOW   0x00
 I2C Extend pin state.
 
#define I2CEXTEND_PIN_STATE_HIGH   0x01
 
#define C6DOFIMU11_CNTL2_TEMP_EN_STANDBY_MODE   0x00
 6DOF IMU 11 bit mask.
 
#define C6DOFIMU11_CNTL2_MAG_EN_STANDBY_MODE   0x00
 
#define C6DOFIMU11_CNTL2_ACCEL_EN_STANDBY_MODE   0x00
 
#define C6DOFIMU11_INC3_IEL2_FIFO_TRIG   0x20
 
#define C6DOFIMU11_INC3_IEL1_FIFO_TRIG   0x02
 
#define C6DOFIMU11_CNTL2_ACCEL_EN_OPERATING_MODE   0x01
 
#define C6DOFIMU11_CNTL2_GSEL_8G   0x00
 
#define C6DOFIMU11_CNTL2_RES_MAX2   0x0C
 
#define C6DOFIMU11_CNTL2_MAG_EN_OPERATING_MODE   0x02
 
#define C6DOFIMU11_WHO_AM_I_WIA_ID   0x2D
 
#define I2CEXTEND_I2C_SLAVE_ADDR_0   0x3E
 I2C Extend device address setting.
 
#define I2CEXTEND_I2C_SLAVE_ADDR_1   0x3F
 
#define I2CEXTEND_I2C_SLAVE_ADDR_2   0x76
 
#define I2CEXTEND_I2C_SLAVE_ADDR_3   0x77
 
#define C6DOFIMU11_I2C_SLAVE_ADDRESS_GND   0x0E
 6DOF IMU 11 device address setting.
 
#define C6DOFIMU11_I2C_SLAVE_ADDRESS_VCC   0x0F
 
#define I2CEXTEND_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  i2cextend_return_value_t { I2CEXTEND_OK = 0 , I2CEXTEND_ERROR = -1 }
 I2C Extend Click return value data. More...
 

Functions

void i2cextend_cfg_setup (i2cextend_cfg_t *cfg)
 I2C Extend configuration object setup function.
 
err_t i2cextend_init (i2cextend_t *ctx, i2cextend_cfg_t *cfg)
 I2C Extend initialization function.
 
void i2cextend_generic_write (i2cextend_t *ctx, uint8_t reg, uint8_t tx_data)
 Generic write data function.
 
uint8_t i2cextend_generic_read (i2cextend_t *ctx, uint8_t reg)
 Generic read data function.
 
void i2cextend_rmt_write (i2cextend_t *ctx, uint8_t rmt_slave_addr, uint8_t reg, uint8_t tx_data)
 Generic write data in Remote Mode function.
 
uint8_t i2cextend_rmt_read (i2cextend_t *ctx, uint8_t rmt_slave_addr, uint8_t reg)
 Generic read data in Remote Mode function.
 
void i2cextend_rmt_multi_write (i2cextend_t *ctx, uint8_t rmt_slave_addr, uint8_t reg, uint8_t *p_tx_data, uint8_t n_bytes)
 Generic multi write data in Remote Mode function.
 
void i2cextend_rmt_multi_read (i2cextend_t *ctx, uint8_t rmt_slave_addr, uint8_t reg, uint8_t *p_rx_data, uint8_t n_bytes)
 Generic multi read data in Remote Mode function.
 
void i2cextend_set_config (i2cextend_t *ctx, uint8_t intr_mode, uint8_t ctrl_sel)
 Set the configuration function.
 
void i2cextend_status (i2cextend_t *ctx, i2cextend_status_data_t *status_data)
 Check the status function.
 
void i2cextend_enable_alerts (i2cextend_t *ctx, uint8_t link_good, uint8_t link_lost, uint8_t fault)
 Set enable alerts function.
 
void i2cextend_fault (i2cextend_t *ctx, i2cextend_fault_data_t *fault_data)
 Check the fault state function.
 
uint8_t i2cextend_get_scratch (i2cextend_t *ctx)
 Get scratch function.
 
void i2cextend_set_out_slave_address (i2cextend_t *ctx, uint8_t out_slave_address)
 Set out slave address function.
 
void i2cextend_set_out_ctrl (i2cextend_t *ctx, uint8_t out_ctrl)
 Set out CTRL function.
 
void i2cextend_set_rst (i2cextend_t *ctx, uint8_t en_rst)
 Set RTS pin state function.
 
void i2cextend_set_cs (i2cextend_t *ctx, uint8_t en_cs)
 Set CS pin state function.
 
void i2cextend_set_on (i2cextend_t *ctx, uint8_t on_state)
 Set ON pin state function.
 
uint8_t i2cextend_check_int (i2cextend_t *ctx)
 Check interrupt ststus function.
 

Detailed Description

This file contains API for I2C Extend Click Driver.

Enumeration Type Documentation

◆ i2cextend_return_value_t

I2C Extend Click return value data.

Predefined enum values for driver return values.

Enumerator
I2CEXTEND_OK 
I2CEXTEND_ERROR