Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
59 #define I2CEXTEND_REG_CONFIG 0x00
60 #define I2CEXTEND_REG_STATUS 0x01
61 #define I2CEXTEND_REG_EVENT 0x02
62 #define I2CEXTEND_REG_ALERT_EN 0x03
63 #define I2CEXTEND_REG_FAULT 0x04
64 #define I2CEXTEND_REG_SCRATCH 0x05
65 #define I2CEXTEND_REG_ADDR_TRANS 0x06
66 #define I2CEXTEND_REG_CTRL 0x07
72 #define C6DOFIMU11_REG_WHO_AM_I 0x00
73 #define C6DOFIMU11_REG_CNTL2 0x3A
74 #define C6DOFIMU11_REG_INC3 0x2C
75 #define C6DOFIMU11_REG_ACCEL_XOUT_L 0x0A
76 #define C6DOFIMU11_REG_ACCEL_YOUT_L 0x0C
77 #define C6DOFIMU11_REG_ACCEL_ZOUT_L 0x0E
78 #define C6DOFIMU11_REG_MAG_XOUT_L 0x10
79 #define C6DOFIMU11_REG_MAG_YOUT_L 0x12
80 #define C6DOFIMU11_REG_MAG_ZOUT_L 0x14
98 #define I2CEXTEND_CONFIG_INTR_MODE_BIT_MASK 0x01
99 #define I2CEXTEND_CONFIG_INTR_MODE_SET_ALERT_PIN 0x00
100 #define I2CEXTEND_CONFIG_INTR_MODE_IGNORE_ARA 0x01
101 #define I2CEXTEND_CONFIG_CTRL_SEL_BIT_MASK 0x02
102 #define I2CEXTEND_CONFIG_CTRL_SEL_MIRRORED_RMT_OUT 0x00
103 #define I2CEXTEND_CONFIG_CTRL_SEL_USE_REG_CTRL_VAL 0x02
109 #define I2CEXTEND_ALERT_EN_LINK_GOOD_DISABLE 0x00
110 #define I2CEXTEND_ALERT_EN_LINK_GOOD 0x01
111 #define I2CEXTEND_ALERT_EN_LINK_LOST_DISABLE 0x00
112 #define I2CEXTEND_ALERT_EN_LINK_LOST 0x02
113 #define I2CEXTEND_ALERT_EN_FAULT_DISABLE 0x00
114 #define I2CEXTEND_ALERT_EN_FAULT 0x04
120 #define I2CEXTEND_CTRL_SEL_L 0x00
121 #define I2CEXTEND_CTRL_SEL_H 0x01
127 #define I2CEXTEND_PIN_STATE_LOW 0x00
128 #define I2CEXTEND_PIN_STATE_HIGH 0x01
134 #define C6DOFIMU11_CNTL2_TEMP_EN_STANDBY_MODE 0x00
135 #define C6DOFIMU11_CNTL2_MAG_EN_STANDBY_MODE 0x00
136 #define C6DOFIMU11_CNTL2_ACCEL_EN_STANDBY_MODE 0x00
137 #define C6DOFIMU11_INC3_IEL2_FIFO_TRIG 0x20
138 #define C6DOFIMU11_INC3_IEL1_FIFO_TRIG 0x02
139 #define C6DOFIMU11_CNTL2_ACCEL_EN_OPERATING_MODE 0x01
140 #define C6DOFIMU11_CNTL2_GSEL_8G 0x00
141 #define C6DOFIMU11_CNTL2_RES_MAX2 0x0C
142 #define C6DOFIMU11_CNTL2_MAG_EN_OPERATING_MODE 0x02
143 #define C6DOFIMU11_WHO_AM_I_WIA_ID 0x2D
150 #define I2CEXTEND_I2C_SLAVE_ADDR_0 0x3E
151 #define I2CEXTEND_I2C_SLAVE_ADDR_1 0x3F
152 #define I2CEXTEND_I2C_SLAVE_ADDR_2 0x76
153 #define I2CEXTEND_I2C_SLAVE_ADDR_3 0x77
160 #define C6DOFIMU11_I2C_SLAVE_ADDRESS_GND 0x0E
161 #define C6DOFIMU11_I2C_SLAVE_ADDRESS_VCC 0x0F
179 #define I2CEXTEND_MAP_MIKROBUS( cfg, mikrobus ) \
180 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
181 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
182 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
183 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
184 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
200 digital_in_t int_pin;
206 uint8_t slave_address;
246 uint8_t i2c_write_fault;
248 uint8_t ext_i2c_fault;
249 uint8_t tx_buf_overflow;
494 #endif // I2CEXTEND_H
I2C Extend Click status data.
Definition: i2cextend.h:231
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_set_cs(i2cextend_t *ctx, uint8_t en_cs)
Set CS pin state function.
uint8_t i2cextend_rmt_read(i2cextend_t *ctx, uint8_t rmt_slave_addr, uint8_t reg)
Generic read data in Remote Mode function.
err_t i2cextend_init(i2cextend_t *ctx, i2cextend_cfg_t *cfg)
I2C Extend initialization 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.
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_status(i2cextend_t *ctx, i2cextend_status_data_t *status_data)
Check the status function.
i2cextend_return_value_t
I2C Extend Click return value data.
Definition: i2cextend.h:255
I2C Extend Click configuration object.
Definition: i2cextend.h:213
uint8_t i2cextend_generic_read(i2cextend_t *ctx, uint8_t reg)
Generic read data 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_set_out_slave_address(i2cextend_t *ctx, uint8_t out_slave_address)
Set out slave address function.
uint8_t i2cextend_get_scratch(i2cextend_t *ctx)
Get scratch function.
I2C Extend Click fault data.
Definition: i2cextend.h:243
uint8_t i2cextend_check_int(i2cextend_t *ctx)
Check interrupt ststus function.
void i2cextend_set_out_ctrl(i2cextend_t *ctx, uint8_t out_ctrl)
Set out CTRL function.
I2C Extend Click context object.
Definition: i2cextend.h:192
void i2cextend_generic_write(i2cextend_t *ctx, uint8_t reg, uint8_t tx_data)
Generic write data function.
Definition: i2cextend.h:258
void i2cextend_cfg_setup(i2cextend_cfg_t *cfg)
I2C Extend configuration object setup function.
void i2cextend_set_rst(i2cextend_t *ctx, uint8_t en_rst)
Set RTS pin state function.
Definition: i2cextend.h:257
void i2cextend_fault(i2cextend_t *ctx, i2cextend_fault_data_t *fault_data)
Check the fault state function.