这篇教程C++ HAL_I2C_GetState函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中HAL_I2C_GetState函数的典型用法代码示例。如果您正苦于以下问题:C++ HAL_I2C_GetState函数的具体用法?C++ HAL_I2C_GetState怎么用?C++ HAL_I2C_GetState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了HAL_I2C_GetState函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: readFromstatic void readFrom(uint8_t address, uint8_t num) { // address to read from aTxBuffer[0] = address; /*##-2- Start the transmission process #####################################*/ /* While the I2C in reception process, user can transmit data through "aTxBuffer" buffer */ while(HAL_I2C_Master_Transmit_DMA(&I2cHandle, I2C_ADDRESS << 1, (uint8_t*)aTxBuffer, 1)!= HAL_OK) { /* Error_Handler() function is called when Timeout error occurs. When Acknowledge failure occurs (Slave don't acknowledge it's address) Master restarts communication */ if (HAL_I2C_GetError(&I2cHandle) != HAL_I2C_ERROR_AF) { Error_Handler(); } } /*##-3- Wait for the end of the transfer ###################################*/ /* Before starting a new communication transfer, you need to check the current state of the peripheral; if it C++ HAL_I2C_Init函数代码示例 C++ HAL_I2C_GetError函数代码示例
|