STM32CubeMx I2C_TwoBoards_ComDMA Issue
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-03 9:16 PM
In the example
while(HAL_I2C_Master_Transmit_DMA(&I2cHandle, (uint16_t)I2C_ADDRESS, (uint8_t*)aTxBuffer, TXBUFFERSIZE)!= HAL_OK)
{
/* Error_Handler() function is called when Timeout error occurs.
When Acknowledge failure occurs (Slave don't acknowledge its address)
Master restarts communication */
if (HAL_I2C_GetError(&I2cHandle) != HAL_I2C_ERROR_AF)
{
Error_Handler();
}
}
I want to know why if (HAL_I2C_GetError(&I2cHandle) != HAL_I2C_ERROR_AF) here rather than if (HAL_I2C_GetError(&I2cHandle) == HAL_I2C_ERROR_AF) if I want to judge Acknowledge failure
thanks
Solved! Go to Solution.
Labels:
- Labels:
-
I2C
-
STM32Cube MCU Packages
This discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION
Accepted Solutions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-05 2:42 AM
The explanation is written right there in a code comment!
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-05 2:42 AM
The explanation is written right there in a code comment!
