cancel
Showing results for 
Search instead for 
Did you mean: 

HAL Functions

vbk22398
Associate III

Diference between the below 2 funtions:
HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t* pData,uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t* pData,uint16_t Size, uint32_t XferOptions);

When should I use the below functions?
HAL_StatusTypeDef HAL_I2C_EnableListen(I2C_HandleTypeDef *hi2c);
HAL_StatusTypeDef HAL_I2C_DisableListen(I2C_HandleTypeDef *hi2c);
HAL_StatusTypeDef HAL_I2C_Master_Abort(I2C_HandleTypeDef *hi2c, uint16_t DevAddress);
void HAL_I2C_EV_IRQHandler(I2C_HandleTypeDef *hi2c);
void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c);

there are many library functions as such, but we don't get to use all of them but where should we search to find the exact use of the the HAL functions and how to find the correct application for it?

 

2 REPLIES 2
AScha.3
Chief II

A basic description is in the HAL libs as comment , just see, whats in ../drivers/...HAL../src/..hal_i2c.c :

at first lines : general description

AScha3_0-1714203627623.png

and in every function ..:

AScha3_1-1714203722853.png

 

>and how to find the correct application for it?

Well, at first, you should know, what you want to do - the HAL is just a library, to get a certain function to work, not a teacher, to tell you, what to do now. 🙂

Examples, how to use this or that, you can find in git - just search, for what you looking for, ->

https://github.com/STMicroelectronics

and see also the app notes etc. on STM , for a cpu you use ->

https://www.st.com/en/microcontrollers-microprocessors/stm32f407vg.html#documentation

AScha3_2-1714205482038.png

or more general:

https://www.st.com/content/st_com/en/search.html#q=I2C%20HAL-t=resources-page=1

 

AScha3_3-1714205640757.png

 

If you feel a post has answered your question, please click "Accept as Solution".

Thanks for your time and effort. Sure, I'll look forward to it.!