⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 davincihd_i2c.h

📁 用于dm6467 开发平台的uboot源码
💻 H
字号:
/*
 *  Copyright 2007 by Spectrum Digital Incorporated.
 *  All rights reserved. Property of Spectrum Digital Incorporated.
 */

/*
 *  I2C header file
 *
 */

#ifndef I2C_
#define I2C_

#ifdef __cplusplus
extern "C" {
#endif

#include "davincihd.h"

/* ------------------------------------------------------------------------ *
 *  I2C Controller                                                          *
 * ------------------------------------------------------------------------ */
#define I2C_BASE                0x01c21000
#define I2C_OAR                 *( volatile Uint32* )( I2C_BASE + 0x0 )
#define I2C_ICIMR               *( volatile Uint32* )( I2C_BASE + 0x4 )
#define I2C_ICSTR               *( volatile Uint32* )( I2C_BASE + 0x8 )
#define I2C_ICCLKL              *( volatile Uint32* )( I2C_BASE + 0xc )
#define I2C_ICCLKH              *( volatile Uint32* )( I2C_BASE + 0x10 )
#define I2C_ICCNT               *( volatile Uint32* )( I2C_BASE + 0x14 )
#define I2C_ICDRR               *( volatile Uint32* )( I2C_BASE + 0x18 )
#define I2C_ICSAR               *( volatile Uint32* )( I2C_BASE + 0x1c )
#define I2C_ICDXR               *( volatile Uint32* )( I2C_BASE + 0x20 )
#define I2C_ICMDR               *( volatile Uint32* )( I2C_BASE + 0x24 )
#define I2C_ICIVR               *( volatile Uint32* )( I2C_BASE + 0x28 )
#define I2C_ICEMDR              *( volatile Uint32* )( I2C_BASE + 0x2c )
#define I2C_ICPSC               *( volatile Uint32* )( I2C_BASE + 0x30 )
#define I2C_ICPID1              *( volatile Uint32* )( I2C_BASE + 0x34 )
#define I2C_ICPID2              *( volatile Uint32* )( I2C_BASE + 0x38 )

/* ------------------------------------------------------------------------ *
 *  I2C Status                                                              *
 * ------------------------------------------------------------------------ */
#define ICSTR_SDIR              0x4000
#define ICSTR_NACKINT           0x2000
#define ICSTR_BB                0x1000
#define ICSTR_RSFULL            0x0800
#define ICSTR_XSMT              0x0400
#define ICSTR_AAS               0x0200
#define ICSTR_AD0               0x0100
#define ICSTR_SCD               0x0020
#define ICSTR_ICXRDY            0x0010
#define ICSTR_ICRRDY            0x0008
#define ICSTR_ARDY              0x0004
#define ICSTR_NACK              0x0002
#define ICSTR_AL                0x0001

/* ------------------------------------------------------------------------ *
 *  I2C Commands                                                            *
 * ------------------------------------------------------------------------ */
#define ICMDR_NACKMOD           0x8000
#define ICMDR_FREE              0x4000
#define ICMDR_STT               0x2000
#define ICMDR_IDLEEN            0x1000
#define ICMDR_STP               0x0800
#define ICMDR_MST               0x0400
#define ICMDR_TRX               0x0200
#define ICMDR_XA                0x0100
#define ICMDR_RM                0x0080
#define ICMDR_DLB               0x0040
#define ICMDR_IRS               0x0020
#define ICMDR_STB               0x0010
#define ICMDR_FDF               0x0008
#define ICMDR_BC_MASK           0x0007

/* ------------------------------------------------------------------------ *
 *  Prototypes                                                              *
 * ------------------------------------------------------------------------ */
/* Setup & Quit */
Int16 DAVINCIHD_I2C_init ( );
Int16 DAVINCIHD_I2C_close( );

/* Read & Write */
Int16 DAVINCIHD_I2C_read ( Uint16 address, Uint8* rx, Uint16 len );
Int16 DAVINCIHD_I2C_write( Uint16 address, Uint8* tx, Uint16 len );

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -