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

#include <i2c.h>

Data Fields

i2c_hwreg_thwreg
 Pointer to Hardware Register Map.
u32 slaveAddress
 7-bit Slave Address
u32 samplingClockDivider
 Sampling Clock Divider.
u32 timeout
 Timeout Value.
u32 tsuDat
 Data Setup Time.
u32 tLow
 SCL Low Time.
u32 tHigh
 SCL High Time.
u32 tBuf
 Bus Free Time between STOP and START.

Detailed Description

I2C instance. Holds the software registers and hardware pointer.

Note
This structure holds configuration values to be applied to the hardware.
  • slaveAddress: 7-bit slave address.
    • samplingClockDivider
    • Sampling rate = (FCLK/(samplingClockDivider + 1)).
    • Controls the rate at which the I2C controller samples SCL and SDA.
  • timeout: Timeout value in number of SCL clock cycles.
    • Inactive timeout clock cycle. The controller will drop the transfer when the value of the timeout is reached or exceeded.
    • Setting the timeout value to zero will disable the timeout feature.
    • Defines the maximum duration the controller will wait for SCL to
    • tsuDat => Data setup time. The number of clock cycles should SDA hold its state before the rising edge of SCL.
  • tLow => The number of clock cycles of SCL in LOW state.
  • tHigh => The number of clock cycles of SCL in HIGH state.
  • tBuf => The number of clock cycles delay before master can initiate a START bit after a STOP bit is issued.
To apply the changes, please call i2c_applyConfig() after modifying the configuration fields.

Definition at line 290 of file i2c.h.

Field Documentation

◆ hwreg

i2c_hwreg_t* i2c_instance_t::hwreg

Pointer to Hardware Register Map.

Definition at line 291 of file i2c.h.

◆ samplingClockDivider

u32 i2c_instance_t::samplingClockDivider

Sampling Clock Divider.

Definition at line 293 of file i2c.h.

◆ slaveAddress

u32 i2c_instance_t::slaveAddress

7-bit Slave Address

Definition at line 292 of file i2c.h.

◆ tBuf

u32 i2c_instance_t::tBuf

Bus Free Time between STOP and START.

Definition at line 298 of file i2c.h.

◆ tHigh

u32 i2c_instance_t::tHigh

SCL High Time.

Definition at line 297 of file i2c.h.

◆ timeout

u32 i2c_instance_t::timeout

Timeout Value.

Definition at line 294 of file i2c.h.

◆ tLow

u32 i2c_instance_t::tLow

SCL Low Time.

Definition at line 296 of file i2c.h.

◆ tsuDat

u32 i2c_instance_t::tsuDat

Data Setup Time.

Definition at line 295 of file i2c.h.


The documentation for this struct was generated from the following file:
  • C:/Users/JasonLau/Downloads/workspace_local/GitLab/efx_IP/efx_soc_rv64/embedded_sw/software/standalone/driver/i2c/i2c.h