Structs used by the driver.
- Note
- This is example show how to instantiate I2C with i2c_instance_t and i2c_hwreg_t.
#define I2C_FREQ 100000
#define I2C_ADDR 0x67<<1
#define I2C_CTRL_HZ SYSTEM_CLINT_HZ
#define I2C_CTRL (i2c_hwreg_t *)SYSTEM_I2C_1_IO_CTRL
.hwreg = I2C_CTRL,
.slaveAddress = I2C_ADDR,
.samplingClockDivider = 3,
.timeout = I2C_CTRL_HZ/1000,
.tsuDat = I2C_CTRL_HZ/(I2C_FREQ*5),
.tLow = I2C_CTRL_HZ/(I2C_FREQ*2),
.tHigh = I2C_CTRL_HZ/(I2C_FREQ*2),
.tBuf = I2C_CTRL_HZ/(I2C_FREQ),
},
I2C instance. Holds the software registers and hardware pointer.