Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __I2C_H
00013 #define __I2C_H
00014
00015 #define BUFSIZE 0x20
00016 #define MAX_TIMEOUT 0x00FFFFFF
00017
00018 #define I2CMASTER 0x01
00019 #define I2CSLAVE 0x02
00020
00021
00022 #define SE95_ADDR 0x9E
00023 #define SE95_ID 0x05
00024 #define SE95_CONFIG 0x01
00025 #define SE95_TEMP 0x00
00026 #define RD_BIT 0x01
00027
00028 #define GET_DEVICE_ID 0x01
00029 #define GET_TEMPERATURE 0x02
00030 #define SET_CONFIGURATION 0x03
00031
00032 #define I2C_IDLE 0
00033 #define I2C_STARTED 1
00034 #define I2C_RESTARTED 2
00035 #define I2C_REPEATED_START 3
00036 #define DATA_ACK 4
00037 #define DATA_NACK 5
00038
00039 #define I2CONSET_I2EN 0x00000040
00040 #define I2CONSET_AA 0x00000004
00041 #define I2CONSET_SI 0x00000008
00042 #define I2CONSET_STO 0x00000010
00043 #define I2CONSET_STA 0x00000020
00044
00045 #define I2CONCLR_AAC 0x00000004
00046 #define I2CONCLR_SIC 0x00000008
00047 #define I2CONCLR_STAC 0x00000020
00048 #define I2CONCLR_I2ENC 0x00000040
00049
00050 #define I2DAT_I2C 0x00000000
00051 #define I2ADR_I2C 0x00000000
00052 #define I2SCLH_SCLH 0x00000080
00053 #define I2SCLL_SCLL 0x00000080
00054
00055 extern void I2CInit( unsigned int I2cMode );
00056 extern unsigned int I2CStart( void );
00057 extern unsigned int I2CStop( void );
00058 extern unsigned int I2CEngine( void );
00059 extern void I2C0_send_motordata(void);
00060 extern void I2C0MasterHandler(void);
00061
00062 #endif
00063
00064
00065