RV32 SoC DS UG
High-Perf RV32 SoC DS UG
RV64 SoC DS UG API and Examples
Embedded IDE UG
Loading...
Searching...
No Matches

Overview

Structs used by the driver.

Note
This is an example show how to instantiate I2C with i2c_instance_t and i2c_hwreg_t.
#define I2C_FREQ 100000
#define I2C_ADDR 0x67<<1 // Slave device address
#define I2C_CTRL_HZ SYSTEM_CLINT_HZ
#define I2C_CTRL (i2c_hwreg_t *)SYSTEM_I2C_0_IO_CTRL
i2c_instance_t I2C_inst = {
.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.
Definition i2c.h:290

Data Structures

struct  i2c_filter_hwreg_t
 I2C hardware filter configuration map. More...
struct  i2c_hwreg_t
 I2C hardware register map. More...
struct  i2c_instance_t
 I2C instance. Holds the software registers and hardware pointer. More...