$search
00001 /***************************************************************************** 00002 * i2c.h: Header file for Philips LPC214x Family Microprocessors 00003 * 00004 * Copyright(C) 2006, Philips Semiconductor 00005 * All rights reserved. 00006 * 00007 * History 00008 * 2005.10.01 ver 1.00 Prelimnary version, first Release 00009 * 00010 ******************************************************************************/ 00011 #ifndef __I2C_H 00012 #define __I2C_H 00013 00014 #define BUFSIZE 0x20 00015 #define MAX_TIMEOUT 0x00FFFFFF 00016 00017 #define I2CMASTER 0x01 00018 #define I2CSLAVE 0x02 00019 00020 /* For more info, read Philips's SE95 datasheet */ 00021 #define SE95_ADDR 0x9E 00022 #define SE95_ID 0x05 00023 #define SE95_CONFIG 0x01 00024 #define SE95_TEMP 0x00 00025 #define RD_BIT 0x01 00026 00027 #define GET_DEVICE_ID 0x01 00028 #define GET_TEMPERATURE 0x02 00029 #define SET_CONFIGURATION 0x03 00030 00031 #define I2C_IDLE 0 00032 #define I2C_STARTED 1 00033 #define I2C_RESTARTED 2 00034 #define I2C_REPEATED_START 3 00035 #define DATA_ACK 4 00036 #define DATA_NACK 5 00037 00038 #define I2CONSET_I2EN 0x00000040 /* I2C Control Set Register */ 00039 #define I2CONSET_AA 0x00000004 00040 #define I2CONSET_SI 0x00000008 00041 #define I2CONSET_STO 0x00000010 00042 #define I2CONSET_STA 0x00000020 00043 00044 #define I2CONCLR_AAC 0x00000004 /* I2C Control clear Register */ 00045 #define I2CONCLR_SIC 0x00000008 00046 #define I2CONCLR_STAC 0x00000020 00047 #define I2CONCLR_I2ENC 0x00000040 00048 00049 #define I2DAT_I2C 0x00000000 /* I2C Data Reg */ 00050 #define I2ADR_I2C 0x00000000 /* I2C Slave Address Reg */ 00051 #define I2SCLH_SCLH 0x00000080 /* I2C SCL Duty Cycle High Reg */ 00052 #define I2SCLL_SCLL 0x00000080 /* I2C SCL Duty Cycle Low Reg */ 00053 00054 extern void I2CInit( unsigned int I2cMode ); 00055 extern unsigned int I2CStart( void ); 00056 extern unsigned int I2CStop( void ); 00057 extern unsigned int I2CEngine( void ); 00058 extern void I2C0_send_motordata(void); 00059 extern void I2C0MasterHandler(void); 00060 00061 #endif /* end __I2C_H */ 00062 /**************************************************************************** 00063 ** End Of File 00064 *****************************************************************************/