2022-05-24 11:29 AM
Some HAL functions, like HAL_UART_Transmit_IT use "_IT" suffix. Is there a convention for it described anywhere? Let's say my driver also has some blocking mode and interrupt mode calls. Should I use "_IT" suffix? Or maybe "_async"? What does "_IT" even mean? Like "InterrupT"? ;)
Is such function called "asynchronous" in C? What about functions that exit immediately but call the callback when something they started is completed? Is there a special name for them, is there a special naming convention?
Should I place the callback as the last argument, or can it appear anywhere in the signature?
2022-05-24 12:22 PM
Is such function called "asynchronous" in C?
The term is general - not specific to C.
Also known as "non-blocking" - as opposed to "blocking", where the code waits ("blocks") until the process is complete.
What about functions that exit immediately but call the callback when something they started is completed?
That is asynchronous (non-blocking) operation.
Should I place the callback as the last argument, or can it appear anywhere in the signature?
Parameters in C functions are identified by position; if the call back is the last parameter in the declaration, then it must also be the last in the call.
2022-05-25 06:52 AM
Hi @Adam �?yskawa ,
For each STM32Cube firmware package, you should find a user manual explaining the HAL & LL drivers of each STM32 product. If we take as example STM32F4, you will find UM1725 Description of STM32F4 HAL and low-layer drivers.
So here an extract from this document explaining the 3 operating modes for UART:
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-05-25 07:19 AM
Thanks for directing me to the right docs, I took the harder path of digging in the HAL source code ;) This document clarifies it well enough.