?? dev_i2c_global.h
字號:
/*=========================================================================== Copyright 2000, 2001 Holley Communications. All rights reserved.*//***************************************************************************** * * DEV_I2C_GLOBAL.H - I2C Interface: Global Definitions * * PURPOSE: * To provide definitions for users of the Inter-IC communication (I2C) * interface module. * * HISTORY: * * NOTE: * All error return codes must be negative numbers. The 'success' code * must always be zero. * * *****************************************************************************/#ifndef DEV_I2C_GLOBAL_H#define DEV_I2C_GLOBAL_H#define DEV_I2C_NOT_LAST_BYTE 0#define DEV_I2C_LAST_BYTE 1#define MAX_ALPAR_DATA_LENGTH 261 /* ALPAR information field length */#define UIM_WAKEUP_SLAVE 31#define UIM_SLAVE_I2C_MUTE 10#define UIM_SHUTDOWN 12# define DEV_PIO_SetInput(bit) REG32(GPIO_BASE+GPIO_DIR) &= ~BIT(bit)# define DEV_PIO_SetOutput(bit) REG32(GPIO_BASE+GPIO_DIR) |= BIT(bit)# define DEV_PIO_WRITE_HIGH(bit) REG32(GPIO_BASE+GPIO_OUT) |= BIT(bit)# define DEV_PIO_WRITE_LOW(bit) REG32(GPIO_BASE+GPIO_OUT) &= ~BIT(bit)/*--- Return Codes ---*/enum dev_i2cereturncodes{ /* Errors */ DEV_I2C_RETCODE_TOOLONG = -7, /* Received Data Too Many */ DEV_I2C_RETCODE_NOACK = -6, /* No acknowledgement (unspecified) */ DEV_I2C_RETCODE_SCLRLSTO = -5, /* Slave SCL release timeout error */ DEV_I2C_RETCODE_IOINITERR = -4, /* I/O initialization error */ DEV_I2C_RETCODE_NODATAACK = -3, /* No acknowledgement to data byte */ DEV_I2C_RETCODE_NOADDRACK = -2, /* No acknowledgement to address byte */ DEV_I2C_RETCODE_BUSBUSY = -1, /* Bus is busy */ /* Success */ DEV_I2C_RETCODE_SUCCESS = 0, /* No error */ DEV_I2C_NUM_RETCODES = 7 /* Number of return codes */};/* Global function prototypes */Int16 dev_i2c_initialize ( Long parm );Int16 dev_i2c_write ( Byte deviceaddr, Byte *databufp, Word len );Int16 dev_i2c_Uim_read ( Byte deviceaddr, Byte *databufp );void dev_i2c_wait ( Int16 five_microSec );void dev_uim_wakeup ( void );void dev_uim_reset ( void );Bool dev_slave_i2c_mute_state ( void );#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -