IIC.C
#include “I2C.h”
#include “N76E003.h”
#include “SFR_Macro.h”
#include “Function_define.h”
#include “Common.h”
#include “Delay.h”
//端口定义===
#define IIC_SCL_PORT //GPIOF
#define IIC_SCL_PIN P13//GPIO_PIN_6
#define IIC_SDA_PORT //GPIOF
#define IIC_SDA_PIN P14//
#define GPIOX_MODE_IN_UP_DOWN 8
#define GPIOX_MODE_OUT_PP 3
//时钟线操作
#define Set_IIC_SCL IIC_SCL_PIN = 1
#define Clr_IIC_SCL IIC_SCL_PIN = 0
//数据线操作
#define Set_IIC_SDA IIC_SDA_PIN = 1
#define Clr_IIC_SDA IIC_SDA_PIN = 0
#define READ_SDA IIC_SDA_PIN
#define IIC_DELAY_TIME 1 //时序延时
#define WAIT_ACK_TIME 5 //等待ACK超时时间
//=