LL库_STM32F407_I2C
相关文件
stm32f4xx_ll_i2c.h
stm32f4xx_ll_i2c.c
相关函数
AT24C02读写示例
先上真实数据传输采集到图
1、读0x01地址的数据
2、读0x02地址的数据
3、向写0x01地址写入0x22
4、向写0x02地址写入0x24
代码
1、读
uint8_t I2C_read_reg_8bit(I2C_TypeDef *I2Cx , uint8_t SlaveAddr_IC, uint8_t addr_reg){
uint8_t read_data;
SlaveAddr_IC = SlaveAddr_IC<<1;
//等待IIC空闲
while(LL_I2C_IsActiveFlag_BUSY(I2Cx)){
}
/* Disable Pos */
LL_I2C_DisableBitPOS(I2Cx)