STM23模拟I2C读写
但是等到真正做程序时,发现总是在while()循环处等待。无奈,只好用软件模拟I2C。
从网上找了一段程序,发现好多地方下载的代码都一样的。
代码如下:
#i nclude "includes.h"
#i nclude "24cxx.h"
#define ADDR_24CXX
#define SCLH
#define SCLL
#define SDAH
#define SDAL
#define SCLread
#define SDAread
static void I2C_GPIO_Config(void)
{
}
void I2C_delay(void)
{
}
bool I2C_Start(void)
{
}
void I2C_Stop(void)
{
}
void I2C_Ack(void)
{
}
void I2C_NoAck(void)
{
}
bool I2C_WaitAck(void)
{
}
void I2C_SendByte(u8 SendByte) //数据从高位到低位//
{