#include "sys.h"
#include "eport_drv.h"
#include "i2c_hal.h"
#include "bsp.h"

#define 		CT_WRITE_MASK           (0x00)
#define 		CT_READ_MASK            (0x01)

//#define     SDA_High                   	HAL_I2C_GPIOWritePin(I2C1, I2C_PIN_SDA, SET)
//#define     SDA_Low                     HAL_I2C_GPIOWritePin(I2C1, I2C_PIN_SDA, RESET)
//#define     SCL_High                    HAL_I2C_GPIOWritePin(I2C1, I2C_PIN_SCL, SET)
//#define     SCL_Low                     HAL_I2C_GPIOWritePin(I2C1, I2C_PIN_SCL, RESET)
//#define     GetSDABit                   HAL_I2C_GPIOReadPin(I2C1, I2C_PIN_SDA)

#define     SDA_High                   	I2C1->PDR |= 0x02
#define     SDA_Low                     I2C1->PDR &=~0x02
#define     SCL_High                    I2C1->PDR |= 0x01
#define     SCL_Low                     I2C1->PDR &=~0x01
#define     GetSDABit                   HAL_I2C_GPIOReadPin(I2C1, I2C_PIN_SDA)

void SCL_OUTPUT(void);
void SDA_OUTPUT(void);
void SDA_INPUT(void);
u8 CT_Read_Nbyte(uint8_t sla_add,uint16_t len_addr,uint16_t add,uint16_t n,uint8_t *s);
uint8_t CT_Write_Nbyte(uint8_t sla_add,uint16_t len_addr,uint16_t add,uint16_t n,uint8_t *s);
