STM32--HAL库IIC

hal库已封装函数
输入输出函数:

阻塞模式:

HAL_I2C_Master_Transmit();  
HAL_I2C_Master_Receive();  
HAL_I2C_Slave_Transmit();  
HAL_I2C_Slave_Receive()
HAL_I2C_Mem_Write();       
HAL_I2C_Mem_Read();   
HAL_I2C_IsDeviceReady()

带中断非阻塞模式:

HAL_I2C_Master_Transmit_IT();    
HAL_I2C_Master_Receive_IT();  
HAL_I2C_Slave_Transmit_IT()
HAL_I2C_Slave_Receive_IT();    
HAL_I2C_Mem_Write_IT();       
HAL_I2C_Mem_Read_IT()

DMA传输非阻塞模式:

HAL_I2C_Master_Transmit_DMA();   
HAL_I2C_Master_Receive_DMA();   
HAL_I2C_Slave_Transmit_DMA();    
HAL_I2C_Slave_Receive_DMA();    
HAL_I2C_Mem_Write_DMA();     
HAL_I2C_Mem_Read_DMA()

非阻塞模式下的回调函数:

HAL_I2C_MemTxCpltCallback();   
HAL_I2C_MemRxCpltCallback();    
HAL_I2C_MasterTxCpltCallback()
HAL_I2C_MasterRxCpltCallback();  
HAL_I2C_SlaveTxCpltCallback(); 
HAL_I2C_SlaveRxCpltCallback();   
HAL_I2C_ErrorCallback()

这部分可以参照USART中的函数进行理解。

你可能感兴趣的:(STM32,STM32)