#define REMOTE_BUSY_PIN 16/// LE pin//57 //16//42
#define REMOTE_DIN_PIN 2//19 /// I2C data pin
#define REMOTE_CLK_PIN 1//20 /// I2C clock pin
//设置IO
//***************************************
SDA_PIN
*******************************************/
void Set_SDA_IO(void)
{
/* Set this port to IO port of SDA */
GPIO_ModeSetup(REMOTE_DIN_PIN, 0x00); //设置IO为SDA
}
void SetSDAInput(void)
{
/* It set SDA port as an input */
GPIO_InitIO(0,REMOTE_DIN_PIN); //设置SDA为输入,关闭下拉
}
void SetSDAOutput(void)
{
/* It set SDA port as an output */
GPIO_InitIO(1,REMOTE_DIN_PIN); //设置SDA为输出
}
void SetSDAHigh(void)
{
/* It output a High level to SDA here. */
GPIO_WriteIO(1,REMOTE_DIN_PIN); //设置SDA为输出1
}
void SetSDALow(void)
{
/* It output a Low level to SDA here. */
GPIO_WriteIO(0,REMOTE_DIN_PIN); //设置SDA为输出0
}
UINT8 GetACKStatus(void)
{
return GPIO_ReadIO(REMOTE_DIN_PIN);
}
UINT8 GetDINStatus(void)
{
return GPIO_ReadIO(REMOTE_DIN_PIN); //读SDA的状态
}