Sapphire SoC DS Sapphire SoC UG Sapphire HP SoC DS Sapphire HP SoC UG RISC-V Embedded IDE UG Board Support Package
Loading...
Searching...
No Matches
Register Definitions

Overview

Register bitmasks and offsets.

I2C Mode Control Register Bitmasks

#define I2C_MODE_CPOL   (1 << 0)
 I2C Clock Polarity Mask *‍/.
#define I2C_MODE_CPHA   (1 << 1)
 I2C Clock Phase Mask *‍/.

I2C TX/RX and Status Register Bitmasks

#define I2C_TX_VALUE   (0xFF)
 Mask for TX value *‍/.
#define I2C_TX_VALID   (1 << 8)
 Mask for TX valid bit *‍/.
#define I2C_TX_ENABLE   (1 << 9)
 Mask for Enable TX *‍/.
#define I2C_TX_REPEAT   (1 << 10)
 Mask for Repeat TX *‍/.
#define I2C_TX_DISABLE_ON_DATA_CONFLICT   (1 << 11)
 Mask for Disable TX on data conflict *‍/.
#define I2C_RX_VALUE   (0xFF)
 Mask for RX value *‍/.
#define I2C_RX_VALID   (1 << 8)
 Mask for RX valid bit *‍/.
#define I2C_RX_LISTEN   (1 << 9)
 Mask for RX listen mode *‍/.

I2C Master/Slave Status Register Bitmasks

#define I2C_MASTER_BUSY   (1 << 0)
 Mask for Master Busy *‍/.
#define I2C_MASTER_START   (1 << 4)
 Mask for Master Start *‍/.
#define I2C_MASTER_STOP   (1 << 5)
 Mask for Master Stop *‍/.
#define I2C_MASTER_DROP   (1 << 6)
 Mask for Master Drop *‍/.
#define I2C_MASTER_RECOVER   (1 << 7)
 Mask for Master Recover *‍/.
#define I2C_MASTER_START_DROPPED   (1 << 9)
 Mask for Master Start Dropped *‍/.
#define I2C_MASTER_STOP_DROPPED   (1 << 10)
 Mask for Master Stop Dropped *‍/.
#define I2C_MASTER_RECOVER_DROPPED   (1 << 11)
 Mask for Master Recover Dropped *‍/.
#define I2C_SLAVE_STATUS_IN_FRAME   (1 << 0)
 Mask for the transaction is in progress *‍/.
#define I2C_SLAVE_STATUS_SDA   (1 << 1)
 Mask for Slave's current state of SDA Line*‍/.
#define I2C_SLAVE_STATUS_SCL   (1 << 2)
 Mask for Slave's current state of SCL Line*‍/.
#define I2C_SLAVE_OVERRIDE_SDA   (1 << 1)
 Mask for Force Slave SDA line *‍/.
#define I2C_SLAVE_OVERRIDE_SCL   (1 << 2)
 Mask for Force Slave SCL line*‍/.

I2C Filter Configuration Bitmasks

#define I2C_FILTER_7_BITS   (0)
 Filter setting for 7 bits *‍/.
#define I2C_FILTER_10_BITS   (1 << 14)
 Filter setting for 10 bits *‍/.
#define I2C_FILTER_ENABLE   (1 << 15)
 Filter Enable *‍/.

I2C Read/Write Definitions

#define I2C_READ   0x01
 Indicate Read Transcation *‍/.
#define I2C_WRITE   0x00
 Indicate Write Transcation *‍/.

I2C TX and Check Macro

#define TX_AND_CHECK(inst, byte)
 Transmits a single byte over the I2C bus and waits for an ACK response.

Macro Definition Documentation

◆ I2C_FILTER_10_BITS

#define I2C_FILTER_10_BITS   (1 << 14)

#include <i2c.h>

Filter setting for 10 bits *‍/.

Definition at line 90 of file i2c.h.

◆ I2C_FILTER_7_BITS

#define I2C_FILTER_7_BITS   (0)

#include <i2c.h>

Filter setting for 7 bits *‍/.

Definition at line 89 of file i2c.h.

◆ I2C_FILTER_ENABLE

#define I2C_FILTER_ENABLE   (1 << 15)

#include <i2c.h>

Filter Enable *‍/.

Definition at line 91 of file i2c.h.

◆ I2C_MASTER_BUSY

#define I2C_MASTER_BUSY   (1 << 0)

#include <i2c.h>

Mask for Master Busy *‍/.

Definition at line 71 of file i2c.h.

◆ I2C_MASTER_DROP

#define I2C_MASTER_DROP   (1 << 6)

#include <i2c.h>

Mask for Master Drop *‍/.

Definition at line 74 of file i2c.h.

◆ I2C_MASTER_RECOVER

#define I2C_MASTER_RECOVER   (1 << 7)

#include <i2c.h>

Mask for Master Recover *‍/.

Definition at line 75 of file i2c.h.

◆ I2C_MASTER_RECOVER_DROPPED

#define I2C_MASTER_RECOVER_DROPPED   (1 << 11)

#include <i2c.h>

Mask for Master Recover Dropped *‍/.

Definition at line 78 of file i2c.h.

◆ I2C_MASTER_START

#define I2C_MASTER_START   (1 << 4)

#include <i2c.h>

Mask for Master Start *‍/.

Definition at line 72 of file i2c.h.

◆ I2C_MASTER_START_DROPPED

#define I2C_MASTER_START_DROPPED   (1 << 9)

#include <i2c.h>

Mask for Master Start Dropped *‍/.

Definition at line 76 of file i2c.h.

◆ I2C_MASTER_STOP

#define I2C_MASTER_STOP   (1 << 5)

#include <i2c.h>

Mask for Master Stop *‍/.

Definition at line 73 of file i2c.h.

◆ I2C_MASTER_STOP_DROPPED

#define I2C_MASTER_STOP_DROPPED   (1 << 10)

#include <i2c.h>

Mask for Master Stop Dropped *‍/.

Definition at line 77 of file i2c.h.

◆ I2C_MODE_CPHA

#define I2C_MODE_CPHA   (1 << 1)

#include <i2c.h>

I2C Clock Phase Mask *‍/.

Definition at line 52 of file i2c.h.

◆ I2C_MODE_CPOL

#define I2C_MODE_CPOL   (1 << 0)

#include <i2c.h>

I2C Clock Polarity Mask *‍/.

Definition at line 51 of file i2c.h.

◆ I2C_READ

#define I2C_READ   0x01

#include <i2c.h>

Indicate Read Transcation *‍/.

Definition at line 97 of file i2c.h.

◆ I2C_RX_LISTEN

#define I2C_RX_LISTEN   (1 << 9)

#include <i2c.h>

Mask for RX listen mode *‍/.

Definition at line 65 of file i2c.h.

◆ I2C_RX_VALID

#define I2C_RX_VALID   (1 << 8)

#include <i2c.h>

Mask for RX valid bit *‍/.

Definition at line 64 of file i2c.h.

◆ I2C_RX_VALUE

#define I2C_RX_VALUE   (0xFF)

#include <i2c.h>

Mask for RX value *‍/.

Definition at line 63 of file i2c.h.

◆ I2C_SLAVE_OVERRIDE_SCL

#define I2C_SLAVE_OVERRIDE_SCL   (1 << 2)

#include <i2c.h>

Mask for Force Slave SCL line*‍/.

Definition at line 83 of file i2c.h.

◆ I2C_SLAVE_OVERRIDE_SDA

#define I2C_SLAVE_OVERRIDE_SDA   (1 << 1)

#include <i2c.h>

Mask for Force Slave SDA line *‍/.

Definition at line 82 of file i2c.h.

◆ I2C_SLAVE_STATUS_IN_FRAME

#define I2C_SLAVE_STATUS_IN_FRAME   (1 << 0)

#include <i2c.h>

Mask for the transaction is in progress *‍/.

Definition at line 79 of file i2c.h.

◆ I2C_SLAVE_STATUS_SCL

#define I2C_SLAVE_STATUS_SCL   (1 << 2)

#include <i2c.h>

Mask for Slave's current state of SCL Line*‍/.

Definition at line 81 of file i2c.h.

◆ I2C_SLAVE_STATUS_SDA

#define I2C_SLAVE_STATUS_SDA   (1 << 1)

#include <i2c.h>

Mask for Slave's current state of SDA Line*‍/.

Definition at line 80 of file i2c.h.

◆ I2C_TX_DISABLE_ON_DATA_CONFLICT

#define I2C_TX_DISABLE_ON_DATA_CONFLICT   (1 << 11)

#include <i2c.h>

Mask for Disable TX on data conflict *‍/.

Definition at line 62 of file i2c.h.

◆ I2C_TX_ENABLE

#define I2C_TX_ENABLE   (1 << 9)

#include <i2c.h>

Mask for Enable TX *‍/.

Definition at line 60 of file i2c.h.

◆ I2C_TX_REPEAT

#define I2C_TX_REPEAT   (1 << 10)

#include <i2c.h>

Mask for Repeat TX *‍/.

Definition at line 61 of file i2c.h.

◆ I2C_TX_VALID

#define I2C_TX_VALID   (1 << 8)

#include <i2c.h>

Mask for TX valid bit *‍/.

Definition at line 59 of file i2c.h.

◆ I2C_TX_VALUE

#define I2C_TX_VALUE   (0xFF)

#include <i2c.h>

Mask for TX value *‍/.

Definition at line 58 of file i2c.h.

◆ I2C_WRITE

#define I2C_WRITE   0x00

#include <i2c.h>

Indicate Write Transcation *‍/.

Definition at line 98 of file i2c.h.

◆ TX_AND_CHECK

#define TX_AND_CHECK ( inst,
byte )

#include <i2c.h>

Value:
do { \
i2c_txByte(inst, (byte)); \
i2c_txNackBlocking(inst); \
i2c_rxAckWait(inst); \
} while(0)

Transmits a single byte over the I2C bus and waits for an ACK response.

Parameters
instPointer to I2C instance.
byteThe byte to be transmitted. Holds the software registers and hardware pointer.
Note
This macro performs a single byte transmission as part of an I2C write transaction.
  • First, it sends the specified byte using the i2c_txByte() function.
  • Followed byi2c_txNackBlocking() to complete the 9-bit transfer cycle (8 data bits + 1 ACK/NACK).
  • It then calls i2c_rxAckWait() to wait until the ACK status is returned by the slave.
  • This ensures that the slave has successfully received and acknowledged the byte.
  • The macro is wrapped in a do { ... } while(0) construct to allow safe usage within conditional blocks or inline statements.

Definition at line 119 of file i2c.h.