2020-06-16 05:26 PM
I'm trying to talk to a New Haven NHD-0216CW-AG3 OLED, and I set up a driver using the HAL system on a STM32F373 controller. I realized once I'd written it that it's blocking, and I want to move to a non-blocking system using the _IT functions.
Just changing the transmit commands from HAL_I2C_Master_Transmit to HAL_I2C_Master_Transmit_IT suddenly turned all my results into gibberish on the screen instead of nice text like I had. What do I need to do to move from blocking to non-blocking I2C commands?
Solved! Go to Solution.
2020-06-16 06:42 PM
HAL_I2C_Master_Transmit_IT is a nonblocking function. There are example projects of its usage here:
2020-06-16 05:33 PM
I haven't tested the I2C dma mode yet.
But using I2C dma is one of the non-blocking methods.
2020-06-16 06:42 PM
HAL_I2C_Master_Transmit_IT is a nonblocking function. There are example projects of its usage here:
2023-07-05 10:50 AM
Clearly whoever wrote this ST HAL driver doesn't understand what the word "non-blocking" means. When you have a function I2C_WaitOnFlagUntilTimeout(), which contains a while loop and it just sits there waiting until a hardware condition is true, you don't have a non-blocking function.
While HAL_I2C_Master_Transmit_IT() is non-blocking, the corresponding HAL_I2C_Master_Receive_IT() is not, even though the comment in the HAL source code says it is non-blocking.