📄 omap3_i2c.h
字号:
//
// Copyright (c) Special Computing. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Texas Instruments. All rights reserved.
//
//------------------------------------------------------------------------------
//
// Header: omap3_i2c.h
//
// This header file is comprised of I2C module register details defined as
// structures and macros for controlling I2C.
//
//------------------------------------------------------------------------------
#ifndef __OMAP3_I2C_H
#define __OMAP3_I2C_H
#if __cplusplus
extern "C" {
#endif
//------------------------------------------------------------------------------
// Base Address : OMAP3_I2C1_REGS_PA
// OMAP3_I2C2_REGS_PA
// OMAP3_I2C3_REGS_PA
//------------------------------------------------------------------------------
typedef volatile struct
{
UINT16 usI2C_REV; //offset 0x00,revision reg
UINT16 usRESERVED_0x02;
UINT16 usI2C_IE; //offset 0x04,intr enable reg
UINT16 usRESERVED_0x06;
UINT16 usI2C_STAT; //offset 0x08,I2C status reg
UINT16 usRESERVED_1[3];
UINT16 usI2C_SYSS; //offset 0x10,module status info
UINT16 usRESERVED_0x12;
UINT16 usI2C_BUF; //offset 0x14,RX DMA chnl disabled
UINT16 usRESERVED_0x16;
UINT16 usI2C_CNT; //offset 0x18,no of bytes in I2C data payload
UINT16 usRESERVED_0x1A;
UINT16 usI2C_DATA; //offset 0x1C,data reg for I2C
UINT16 usRESERVED_0x1E;
UINT16 usI2C_SYSC; //offset 0x20,OCP i/f params
UINT16 usRESERVED_0x22;
UINT16 usI2C_CON; //offset 0x24,func features ctrl
UINT16 usRESERVED_0x26;
UINT16 usI2C_OA; //offset 0x28,7/10-bit own addr
UINT16 usRESERVED_0x2A;
UINT16 usI2C_SA; //offset 0x2C,/10-bit slave addr
UINT16 usRESERVED_0x2E;
UINT16 usI2C_PSC; //offset 0x30,prescale sampling clk divider
UINT16 usRESERVED_0x32;
UINT16 usI2C_SCLL; //offset 0x34,SCL low time value
UINT16 usRESERVED_0x36;
UINT16 usI2C_SCLH; //offset 0x38,SCL high time value
UINT16 usRESERVED_0x3A;
UINT16 usI2C_SYSTEST; //offset 0x3C,sys lvl test bits
UINT16 usRESERVED_0x3E;
UINT16 usI2C_BUFSTAT; //offset 0x40,FIFO status information
UINT16 usRESERVED_0x42;
UINT16 usI2C_OA1; //offset 0x44,I2C 7-bit or 10-bit address
UINT16 usRESERVED_0x46;
UINT16 usI2C_OA2; //offset 0x48,I2C 7-bit or 10-bit address
UINT16 usRESERVED_0x4A;
UINT16 usI2C_OA3; //offset 0x4C,I2C 7-bit or 10-bit address
UINT16 usRESERVED_0x4E;
UINT16 usI2C_ACTOA; //offset 0x50,accessed slave Own Address indicators
UINT16 usRESERVED_0x52;
UINT16 usI2C_SBLOCK; //offset 0x54,slave mode i2c bus lock features
}OMAP3_I2C_REGS;
//------------------------------------------------------------------------------
#define I2C_STAT_SBD (1 << 15)
#define I2C_STAT_BB (1 << 12)
#define I2C_STAT_ROVR (1 << 11)
#define I2C_STAT_XUDF (1 << 10)
#define I2C_STAT_AAS (1 << 9)
#define I2C_STAT_GC (1 << 5)
#define I2C_STAT_XRDY (1 << 4)
#define I2C_STAT_RRDY (1 << 3)
#define I2C_STAT_ARDY (1 << 2)
#define I2C_STAT_NACK (1 << 1)
#define I2C_STAT_AL (1 << 0)
#define I2C_SYSS_RDONE (1 << 0)
#define I2C_SYSC_SRST (1 << 1)
#define I2C_CON_EN (1 << 15)
#define I2C_CON_BE (1 << 14)
#define I2C_CON_STB (1 << 11)
#define I2C_CON_MST (1 << 10)
#define I2C_CON_TRX (1 << 9)
#define I2C_CON_XA (1 << 8)
#define I2C_CON_STP (1 << 1)
#define I2C_CON_STT (1 << 0)
#define I2C_ACTOA_OA3_ACT (1 << 3)
#define I2C_ACTOA_OA2_ACT (1 << 2)
#define I2C_ACTOA_OA1_ACT (1 << 1)
#define I2C_ACTOA_OA0_ACT (1 << 0)
#define I2C_SBLOCK_OA3_EN (1 << 3)
#define I2C_SBLOCK_OA2_EN (1 << 2)
#define I2C_SBLOCK_OA1_EN (1 << 1)
#define I2C_SBLOCK_OA0_EN (1 << 0)
#if __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -