|
TM STM32Fxxx HAL Libraries
v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle
|
TM USART Library for STM32Fxxx - http://stm32f4-discovery.com/2015/07/hal-library-07-usart-for-stm32fxxx. More...
Modules | |
| TM_USART_Typedefs | |
| USART Typedefs. | |
| TM_USART_Macros | |
| USART default values for defines. | |
| TM_USART_Functions | |
| USART Functions. | |
TM USART Library for STM32Fxxx - http://stm32f4-discovery.com/2015/07/hal-library-07-usart-for-stm32fxxx.
Library works for all 8 U(S)ARTs which are supported on STM32Fxxx devices.
Library supported STM32F4xx and STM32F7xx devices as well as STM32F0xx.
Every USART channel has it's own receive interrupt which stores incoming data into cyclic buffer. If you want to use your own receive handler, then you have to open defines.h files and set a define.
After you set define, you have to create a function, which will handle custom request
In your project you can set internal cyclic buffer length, default is 32Bytes, with:
in your project's defines.h file. This will set default length for each buffer. So if you are working with F429 (it has 8 U(S)ARTs) then you will use 8kB RAM if you set define above to 1024.
If you don't change anything, then all USART's have buffer length of value, stored in TM_USART_BUFFER_SIZE define. If you want let's say just for USART1 to be 1kB, but others default value, you can add define below in defines.h file:
Other possible settings are (for other U(S)ARTs):
By default, LF (Line Feed) character was used, but now you can select custom character using TM_USART_SetCustomStringEndCharacter() function.
|PINSPACK 1 |PINSPACK 2 |PINSPACK 3 U(S)ARTX |TX RX |TX RX |TX RX //STM32F4xx and STM32F7xx USART1 |PA9 PA10 |PB6 PB7 |- - USART2 |PA2 PA3 |PD5 PD6 |- - USART3 |PB10 PB11 |PC10 PC11 |PD8 PD9 UART4 |PA0 PA1 |PC10 PC11 |- - UART5 |PC12 PD2 |- - |- - USART6 |PC6 PC7 |PG14 PG9 |- - UART7 |PE8 PE7 |PF7 PF6 |- - UART8 |PE1 PE0 |- - |- - //Additions for STM32F0xx USART4 |PA0 PA1 |PC10 PC11 |PE8 PE9 USART5 |PB3 PB4 |PC12 PD2 |PE10 PE11 USART7 |PC0 PC1 |PC6 PC7 |PF2 PF3 USART8 |PC2 PC3 |PC8 PC9 |PD13 PD14
In case these pins are not good for you, you can use TM_USART_PinsPack_Custom in function and callback function will be called, where you can initialize your custom pinout for your USART peripheral
In this section, you can change USART functionality. Do this only in case you know what are you doing!
Open defines.h file, copy define you want to change and fill settings
Version 1.0 - First release Version 1.1 - September 03, 2015 - Added support for buffers which now requires separate library for USART Version 1.2 - December 26, 2015 - On reinitialization USART with other baudrate, USART didn't work properly and needs some time to start. - With forcing register reset this has been fixed
Dependencies
- STM32Fxxx HAL - STM32Fxxx HAL UART - attributes.h - defines.h - TM GPIO - TM BUFFER