#ifndef __LHL_I2C_SOFT_H__ #define __LHL_I2C_SOFT_H__ //IIC¶Ë¿Ú¶¨Òå #ifndef HIGH #define HIGH 1 // HIGH #define LOW 0 // LOW #endif #ifndef WR #define WR 0 // WRITE #define RD 1 // READ #endif /*******************************************************************************/ #define SDA_IN() EnableInput(I2C_SDA_GPIO, I2C_SDA_PINPOS) #define SDA_OUT() EnableOutput(I2C_SDA_GPIO, I2C_SDA_PINPOS) #define SET_SDA() SET_PIN(I2C_SDA_GPIO, I2C_SDA) #define CLR_SDA() CLR_PIN(I2C_SDA_GPIO, I2C_SDA) #define READ_SDA() READ_PIN(I2C_SDA_GPIO, I2C_SDA) #define SCL_OUT() EnableOutput(I2C_SCL_GPIO, I2C_SCL_PINPOS) #define SET_SCL() SET_PIN(I2C_SCL_GPIO, I2C_SCL) #define CLR_SCL() CLR_PIN(I2C_SCL_GPIO, I2C_SCL) /*******************************************************************************/ #define ENABLE_I2C_DELAY 0 #define SI2C_Delay() __NOP(); void SI2C_Init(void); void SI2C_Start(void); void SI2C_Stop(void); void SI2C_Ack(void); void SI2C_NoAck(void); uint8_t SI2C_TestAck(void); uint8_t SI2C_Write(uint8_t writeData); uint8_t SI2C_Read(void); #endif