模拟I2C控制24C02(8)
发布时间:2021-06-06
发布时间:2021-06-06
使用STM32红牛开发的GPIO模拟I2C控制八个AT24C02的读写
RCC_Configuration(); /* System clocks configuration --------*/
NVIC_Configuration(); /* NVIC configuration -----------*/
I2C_EE_Init(); /* Initialize the I2C EEPROM driver ----------*/
while(1)
{
I2C_EE_BufferWrite(Tx1_Buffer, EEPROM_WriteAddress1, BufferSize1); /*写IIC */
wait(20000);
I2C_EE_PageRead(Rx1_Buffer, EEPROM_ReadAddress1, BufferSize1); /*读IIC */
TransferStatus1 = Buffercmp(Tx1_Buffer, Rx1_Buffer, BufferSize1); /*检查读写是否正确 */
}
}
上一篇:汽车火灾探测研究现状及发展趋势
下一篇:Android Widget