coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
i2c.h File Reference
#include <stdint.h>
Include dependency graph for i2c.h:

Go to the source code of this file.

Data Structures

struct  _I2C_REGS
 

Macros

#define IC_CON   offsetof(I2C_REGS, ic_con)
 
#define IC_TAR   offsetof(I2C_REGS, ic_tar)
 
#define IC_DATA_CMD   offsetof(I2C_REGS, ic_data_cmd)
 
#define IC_SS_SCL_HCNT   offsetof(I2C_REGS, ic_ss_scl_hcnt)
 
#define IC_SS_SCL_LCNT   offsetof(I2C_REGS, ic_ss_scl_lcnt)
 
#define IC_FS_SCL_HCNT   offsetof(I2C_REGS, ic_fs_scl_hcnt)
 
#define IC_FS_SCL_LCNT   offsetof(I2C_REGS, ic_fs_scl_lcnt)
 
#define IC_INTR_STAT   offsetof(I2C_REGS, ic_intr_stat)
 
#define IC_INTR_MASK   offsetof(I2C_REGS, ic_intr_mask)
 
#define IC_RAW_INTR_STAT   offsetof(I2C_REGS, ic_raw_intr_stat)
 
#define IC_RX_TL   offsetof(I2C_REGS, ic_rx_tl)
 
#define IC_TX_TL   offsetof(I2C_REGS, ic_tx_tl)
 
#define IC_CLR_INTR   offsetof(I2C_REGS, ic_clr_intr)
 
#define IC_CLR_RX_UNDER   offsetof(I2C_REGS, ic_clr_rx_under)
 
#define IC_CLR_RX_OVER   offsetof(I2C_REGS, ic_clr_rx_over)
 
#define IC_CLR_TX_OVER   offsetof(I2C_REGS, ic_clr_tx_over)
 
#define IC_CLR_RD_REQ   offsetof(I2C_REGS, ic_clr_rd_req)
 
#define IC_CLR_TX_ABRT   offsetof(I2C_REGS, ic_clr_tx_abrt)
 
#define IC_CLR_ACTIVITY   offsetof(I2C_REGS, ic_clr_activity)
 
#define IC_CLR_STOP_DET   offsetof(I2C_REGS, ic_clr_stop_det)
 
#define IC_CLR_START_DET   offsetof(I2C_REGS, ic_clr_start_det)
 
#define IC_ENABLE   offsetof(I2C_REGS, ic_enable)
 
#define IC_STATUS   offsetof(I2C_REGS, ic_status)
 
#define IC_TXFLR   offsetof(I2C_REGS, ic_txflr)
 
#define IC_RXFLR   offsetof(I2C_REGS, ic_rxflr)
 
#define IC_SDA_HOLD   offsetof(I2C_REGS, ic_sda_hold)
 
#define IC_TX_ABRT_SOURCE   offsetof(I2C_REGS, ic_tx_abrt_source)
 
#define IC_ENABLE_STATUS   offsetof(I2C_REGS, ic_enable_status)
 
#define IC_FS_SPKLEN   offsetof(I2C_REGS, ic_fs_spklen)
 
#define IC_CON_RESTART_EN   0x00000020 /* Enable start/restart */
 
#define IC_CON_10B   0x00000010 /* 10-bit addressing */
 
#define IC_CON_7B   0 /* 7-bit addressing */
 
#define IC_CON_SPEED   0x00000006 /* I2C bus speed */
 
#define IC_CON_SPEED_400_KHz   0x00000004 /* Fast mode */
 
#define IC_CON_SPEED_100_KHz   0x00000002 /* Standard mode */
 
#define IC_CON_MASTER_MODE   0x00000001 /* Enable master mode */
 
#define IC_DATA_CMD_RESTART   0x00000400 /* Send restart before byte */
 
#define IC_DATA_CMD_STOP   0x00000200 /* Send stop after byte */
 
#define IC_DATA_CMD_CMD   0x00000100 /* Type of transaction */
 
#define IC_DATA_CMD_READ   IC_DATA_CMD_CMD
 
#define IC_DATA_CMD_WRITE   0
 
#define IC_DATA_CMD_DATA   0x000000ff /* Data byte */
 
#define IC_INTR_START_DET   0x00000400 /* Start bit detected */
 
#define IC_INTR_STOP_DET   0x00000200 /* Stop bit detected */
 
#define IC_INTR_ACTIVITY   0x00000100 /* Activity detected */
 
#define IC_INTR_TX_ABRT   0x00000040 /* Transmit abort */
 
#define IC_INTR_RD_REQ   0x00000020 /* Read request */
 
#define IC_INTR_TX_EMPTY   0x00000010 /* TX FIFO is empty */
 
#define IC_INTR_TX_OVER   0x00000008 /* TX FIFO overflow */
 
#define IC_INTR_RX_FULL   0x00000004 /* Receive FIFO is full */
 
#define IC_INTR_RX_OVER   0x00000002 /* Receive FIFO overflow */
 
#define IC_INTR_RX_UNDER   0x00000001 /* Receive FIFO underflow */
 
#define IC_ENABLE_CONTROLLER   0x00000001 /* Enable the I2C controller */
 
#define IC_STATUS_MST_ACTIVITY   0x00000020 /* Master FSM activity */
 
#define IC_STATUS_RFF   0x00000010 /* Receive FIFO completely full */
 
#define IC_STATUS_RFNE   0x00000008 /* Receive FIFO not empty */
 
#define IC_STATUS_TFE   0x00000004 /* Transmit FIFO completely empty */
 
#define IC_STATUS_TFNF   0x00000002 /* Transmit FIFO not full */
 
#define IC_STATUS_ACTIVITY   0x00000001 /* Activity */
 

Typedefs

typedef volatile struct _I2C_REGS I2C_REGS
 

Macro Definition Documentation

◆ IC_CLR_ACTIVITY

#define IC_CLR_ACTIVITY   offsetof(I2C_REGS, ic_clr_activity)

Definition at line 63 of file i2c.h.

◆ IC_CLR_INTR

#define IC_CLR_INTR   offsetof(I2C_REGS, ic_clr_intr)

Definition at line 57 of file i2c.h.

◆ IC_CLR_RD_REQ

#define IC_CLR_RD_REQ   offsetof(I2C_REGS, ic_clr_rd_req)

Definition at line 61 of file i2c.h.

◆ IC_CLR_RX_OVER

#define IC_CLR_RX_OVER   offsetof(I2C_REGS, ic_clr_rx_over)

Definition at line 59 of file i2c.h.

◆ IC_CLR_RX_UNDER

#define IC_CLR_RX_UNDER   offsetof(I2C_REGS, ic_clr_rx_under)

Definition at line 58 of file i2c.h.

◆ IC_CLR_START_DET

#define IC_CLR_START_DET   offsetof(I2C_REGS, ic_clr_start_det)

Definition at line 65 of file i2c.h.

◆ IC_CLR_STOP_DET

#define IC_CLR_STOP_DET   offsetof(I2C_REGS, ic_clr_stop_det)

Definition at line 64 of file i2c.h.

◆ IC_CLR_TX_ABRT

#define IC_CLR_TX_ABRT   offsetof(I2C_REGS, ic_clr_tx_abrt)

Definition at line 62 of file i2c.h.

◆ IC_CLR_TX_OVER

#define IC_CLR_TX_OVER   offsetof(I2C_REGS, ic_clr_tx_over)

Definition at line 60 of file i2c.h.

◆ IC_CON

#define IC_CON   offsetof(I2C_REGS, ic_con)

Definition at line 45 of file i2c.h.

◆ IC_CON_10B

#define IC_CON_10B   0x00000010 /* 10-bit addressing */

Definition at line 77 of file i2c.h.

◆ IC_CON_7B

#define IC_CON_7B   0 /* 7-bit addressing */

Definition at line 78 of file i2c.h.

◆ IC_CON_MASTER_MODE

#define IC_CON_MASTER_MODE   0x00000001 /* Enable master mode */

Definition at line 82 of file i2c.h.

◆ IC_CON_RESTART_EN

#define IC_CON_RESTART_EN   0x00000020 /* Enable start/restart */

Definition at line 76 of file i2c.h.

◆ IC_CON_SPEED

#define IC_CON_SPEED   0x00000006 /* I2C bus speed */

Definition at line 79 of file i2c.h.

◆ IC_CON_SPEED_100_KHz

#define IC_CON_SPEED_100_KHz   0x00000002 /* Standard mode */

Definition at line 81 of file i2c.h.

◆ IC_CON_SPEED_400_KHz

#define IC_CON_SPEED_400_KHz   0x00000004 /* Fast mode */

Definition at line 80 of file i2c.h.

◆ IC_DATA_CMD

#define IC_DATA_CMD   offsetof(I2C_REGS, ic_data_cmd)

Definition at line 47 of file i2c.h.

◆ IC_DATA_CMD_CMD

#define IC_DATA_CMD_CMD   0x00000100 /* Type of transaction */

Definition at line 87 of file i2c.h.

◆ IC_DATA_CMD_DATA

#define IC_DATA_CMD_DATA   0x000000ff /* Data byte */

Definition at line 90 of file i2c.h.

◆ IC_DATA_CMD_READ

#define IC_DATA_CMD_READ   IC_DATA_CMD_CMD

Definition at line 88 of file i2c.h.

◆ IC_DATA_CMD_RESTART

#define IC_DATA_CMD_RESTART   0x00000400 /* Send restart before byte */

Definition at line 85 of file i2c.h.

◆ IC_DATA_CMD_STOP

#define IC_DATA_CMD_STOP   0x00000200 /* Send stop after byte */

Definition at line 86 of file i2c.h.

◆ IC_DATA_CMD_WRITE

#define IC_DATA_CMD_WRITE   0

Definition at line 89 of file i2c.h.

◆ IC_ENABLE

#define IC_ENABLE   offsetof(I2C_REGS, ic_enable)

Definition at line 66 of file i2c.h.

◆ IC_ENABLE_CONTROLLER

#define IC_ENABLE_CONTROLLER   0x00000001 /* Enable the I2C controller */

Definition at line 110 of file i2c.h.

◆ IC_ENABLE_STATUS

#define IC_ENABLE_STATUS   offsetof(I2C_REGS, ic_enable_status)

Definition at line 72 of file i2c.h.

◆ IC_FS_SCL_HCNT

#define IC_FS_SCL_HCNT   offsetof(I2C_REGS, ic_fs_scl_hcnt)

Definition at line 50 of file i2c.h.

◆ IC_FS_SCL_LCNT

#define IC_FS_SCL_LCNT   offsetof(I2C_REGS, ic_fs_scl_lcnt)

Definition at line 51 of file i2c.h.

◆ IC_FS_SPKLEN

#define IC_FS_SPKLEN   offsetof(I2C_REGS, ic_fs_spklen)

Definition at line 73 of file i2c.h.

◆ IC_INTR_ACTIVITY

#define IC_INTR_ACTIVITY   0x00000100 /* Activity detected */

Definition at line 98 of file i2c.h.

◆ IC_INTR_MASK

#define IC_INTR_MASK   offsetof(I2C_REGS, ic_intr_mask)

Definition at line 53 of file i2c.h.

◆ IC_INTR_RD_REQ

#define IC_INTR_RD_REQ   0x00000020 /* Read request */

Definition at line 100 of file i2c.h.

◆ IC_INTR_RX_FULL

#define IC_INTR_RX_FULL   0x00000004 /* Receive FIFO is full */

Definition at line 103 of file i2c.h.

◆ IC_INTR_RX_OVER

#define IC_INTR_RX_OVER   0x00000002 /* Receive FIFO overflow */

Definition at line 104 of file i2c.h.

◆ IC_INTR_RX_UNDER

#define IC_INTR_RX_UNDER   0x00000001 /* Receive FIFO underflow */

Definition at line 105 of file i2c.h.

◆ IC_INTR_START_DET

#define IC_INTR_START_DET   0x00000400 /* Start bit detected */

Definition at line 96 of file i2c.h.

◆ IC_INTR_STAT

#define IC_INTR_STAT   offsetof(I2C_REGS, ic_intr_stat)

Definition at line 52 of file i2c.h.

◆ IC_INTR_STOP_DET

#define IC_INTR_STOP_DET   0x00000200 /* Stop bit detected */

Definition at line 97 of file i2c.h.

◆ IC_INTR_TX_ABRT

#define IC_INTR_TX_ABRT   0x00000040 /* Transmit abort */

Definition at line 99 of file i2c.h.

◆ IC_INTR_TX_EMPTY

#define IC_INTR_TX_EMPTY   0x00000010 /* TX FIFO is empty */

Definition at line 101 of file i2c.h.

◆ IC_INTR_TX_OVER

#define IC_INTR_TX_OVER   0x00000008 /* TX FIFO overflow */

Definition at line 102 of file i2c.h.

◆ IC_RAW_INTR_STAT

#define IC_RAW_INTR_STAT   offsetof(I2C_REGS, ic_raw_intr_stat)

Definition at line 54 of file i2c.h.

◆ IC_RX_TL

#define IC_RX_TL   offsetof(I2C_REGS, ic_rx_tl)

Definition at line 55 of file i2c.h.

◆ IC_RXFLR

#define IC_RXFLR   offsetof(I2C_REGS, ic_rxflr)

Definition at line 69 of file i2c.h.

◆ IC_SDA_HOLD

#define IC_SDA_HOLD   offsetof(I2C_REGS, ic_sda_hold)

Definition at line 70 of file i2c.h.

◆ IC_SS_SCL_HCNT

#define IC_SS_SCL_HCNT   offsetof(I2C_REGS, ic_ss_scl_hcnt)

Definition at line 48 of file i2c.h.

◆ IC_SS_SCL_LCNT

#define IC_SS_SCL_LCNT   offsetof(I2C_REGS, ic_ss_scl_lcnt)

Definition at line 49 of file i2c.h.

◆ IC_STATUS

#define IC_STATUS   offsetof(I2C_REGS, ic_status)

Definition at line 67 of file i2c.h.

◆ IC_STATUS_ACTIVITY

#define IC_STATUS_ACTIVITY   0x00000001 /* Activity */

Definition at line 118 of file i2c.h.

◆ IC_STATUS_MST_ACTIVITY

#define IC_STATUS_MST_ACTIVITY   0x00000020 /* Master FSM activity */

Definition at line 113 of file i2c.h.

◆ IC_STATUS_RFF

#define IC_STATUS_RFF   0x00000010 /* Receive FIFO completely full */

Definition at line 114 of file i2c.h.

◆ IC_STATUS_RFNE

#define IC_STATUS_RFNE   0x00000008 /* Receive FIFO not empty */

Definition at line 115 of file i2c.h.

◆ IC_STATUS_TFE

#define IC_STATUS_TFE   0x00000004 /* Transmit FIFO completely empty */

Definition at line 116 of file i2c.h.

◆ IC_STATUS_TFNF

#define IC_STATUS_TFNF   0x00000002 /* Transmit FIFO not full */

Definition at line 117 of file i2c.h.

◆ IC_TAR

#define IC_TAR   offsetof(I2C_REGS, ic_tar)

Definition at line 46 of file i2c.h.

◆ IC_TX_ABRT_SOURCE

#define IC_TX_ABRT_SOURCE   offsetof(I2C_REGS, ic_tx_abrt_source)

Definition at line 71 of file i2c.h.

◆ IC_TX_TL

#define IC_TX_TL   offsetof(I2C_REGS, ic_tx_tl)

Definition at line 56 of file i2c.h.

◆ IC_TXFLR

#define IC_TXFLR   offsetof(I2C_REGS, ic_txflr)

Definition at line 68 of file i2c.h.

Typedef Documentation

◆ I2C_REGS

typedef volatile struct _I2C_REGS I2C_REGS