|
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
|
USART Functions. More...
Functions | |
| void | TM_USART_Init (USART_TypeDef *USARTx, TM_USART_PinsPack_t pinspack, uint32_t baudrate) |
| Initializes USARTx peripheral and corresponding pins. More... | |
| void | TM_USART_InitWithFlowControl (USART_TypeDef *USARTx, TM_USART_PinsPack_t pinspack, uint32_t baudrate, TM_USART_HardwareFlowControl_t FlowControl) |
| Initializes USARTx peripheral and corresponding pins with custom hardware flow control mode. More... | |
| static __INLINE void | TM_USART_Putc (USART_TypeDef *USARTx, volatile char c) |
| Puts character to USART port. More... | |
| void | TM_USART_Puts (USART_TypeDef *USARTx, char *str) |
| Puts string to USART port. More... | |
| void | TM_USART_Send (USART_TypeDef *USARTx, uint8_t *DataArray, uint16_t count) |
| Sends data array to USART port. More... | |
| uint8_t | TM_USART_Getc (USART_TypeDef *USARTx) |
| Gets character from internal USART buffer. More... | |
| uint16_t | TM_USART_Gets (USART_TypeDef *USARTx, char *buffer, uint16_t bufsize) |
| Get string from USART. More... | |
| int16_t | TM_USART_FindCharacter (USART_TypeDef *USARTx, uint8_t c) |
| Check if character c is available in internal buffer. More... | |
| uint8_t | TM_USART_BufferEmpty (USART_TypeDef *USARTx) |
| Checks if internal USARTx buffer is empty. More... | |
| uint8_t | TM_USART_BufferFull (USART_TypeDef *USARTx) |
| Checks if internal USARTx buffer is full. More... | |
| uint16_t | TM_USART_BufferCount (USART_TypeDef *USARTx) |
| Gets number of bytes in USART buffer. More... | |
| void | TM_USART_ClearBuffer (USART_TypeDef *USARTx) |
| Clears internal USART buffer. More... | |
| void | TM_USART_SetCustomStringEndCharacter (USART_TypeDef *USARTx, uint8_t Character) |
| Sets custom character for TM_USART_Gets() function to detect when string ends. More... | |
| int16_t | TM_USART_FindString (USART_TypeDef *USARTx, char *str) |
| Search for string in USART buffer if exists. More... | |
| void | TM_USART_InitCustomPinsCallback (USART_TypeDef *USARTx, uint16_t AlternateFunction) |
| Callback for custom pins initialization for USARTx. More... | |
| __weak void | TM_USART1_ReceiveHandler (uint8_t c) |
| Callback function for receive interrupt on USART1 in case you have enabled custom USART handler mode. More... | |
| __weak void | TM_USART2_ReceiveHandler (uint8_t c) |
| Callback function for receive interrupt on USART2 in case you have enabled custom USART handler mode. More... | |
| __weak void | TM_USART3_ReceiveHandler (uint8_t c) |
| Callback function for receive interrupt on USART3 in case you have enabled custom USART handler mode. More... | |
| __weak void | TM_UART4_ReceiveHandler (uint8_t c) |
| Callback function for receive interrupt on UART4 in case you have enabled custom USART handler mode. More... | |
| __weak void | TM_UART5_ReceiveHandler (uint8_t c) |
| Callback function for receive interrupt on UART5 in case you have enabled custom USART handler mode. More... | |
| __weak void | TM_USART6_ReceiveHandler (uint8_t c) |
| Callback function for receive interrupt on USART6 in case you have enabled custom USART handler mode. More... | |
| __weak void | TM_UART7_ReceiveHandler (uint8_t c) |
| Callback function for receive interrupt on UART7 in case you have enabled custom USART handler mode. More... | |
| __weak void | TM_UART8_ReceiveHandler (uint8_t c) |
| Callback function for receive interrupt on UART8 in case you have enabled custom USART handler mode. More... | |
USART Functions.
| __weak void TM_UART4_ReceiveHandler | ( | uint8_t | c | ) |
Callback function for receive interrupt on UART4 in case you have enabled custom USART handler mode.
| c | character received via USART |
| None |
| __weak void TM_UART5_ReceiveHandler | ( | uint8_t | c | ) |
Callback function for receive interrupt on UART5 in case you have enabled custom USART handler mode.
| c | character received via USART |
| None |
| __weak void TM_UART7_ReceiveHandler | ( | uint8_t | c | ) |
Callback function for receive interrupt on UART7 in case you have enabled custom USART handler mode.
| c | character received via USART |
| None |
| __weak void TM_UART8_ReceiveHandler | ( | uint8_t | c | ) |
Callback function for receive interrupt on UART8 in case you have enabled custom USART handler mode.
| c | character received via USART |
| None |
| __weak void TM_USART1_ReceiveHandler | ( | uint8_t | c | ) |
Callback function for receive interrupt on USART1 in case you have enabled custom USART handler mode.
| c | character received via USART |
| None |
| __weak void TM_USART2_ReceiveHandler | ( | uint8_t | c | ) |
Callback function for receive interrupt on USART2 in case you have enabled custom USART handler mode.
| c | character received via USART |
| None |
| __weak void TM_USART3_ReceiveHandler | ( | uint8_t | c | ) |
Callback function for receive interrupt on USART3 in case you have enabled custom USART handler mode.
| c | character received via USART |
| None |
| __weak void TM_USART6_ReceiveHandler | ( | uint8_t | c | ) |
Callback function for receive interrupt on USART6 in case you have enabled custom USART handler mode.
| c | character received via USART |
| None |
| uint16_t TM_USART_BufferCount | ( | USART_TypeDef * | USARTx | ) |
Gets number of bytes in USART buffer.
| *USARTx | Pointer to USARTx peripheral you will use |
| Number | of elements in buffer |
| uint8_t TM_USART_BufferEmpty | ( | USART_TypeDef * | USARTx | ) |
Checks if internal USARTx buffer is empty.
| *USARTx | Pointer to USARTx peripheral you will use |
| Buffer | empty status:
|
| uint8_t TM_USART_BufferFull | ( | USART_TypeDef * | USARTx | ) |
Checks if internal USARTx buffer is full.
| *USARTx | Pointer to USARTx peripheral you will use |
| Buffer | full status:
|
| void TM_USART_ClearBuffer | ( | USART_TypeDef * | USARTx | ) |
Clears internal USART buffer.
| *USARTx | Pointer to USARTx peripheral you will use |
| None |
| int16_t TM_USART_FindCharacter | ( | USART_TypeDef * | USARTx, |
| uint8_t | c | ||
| ) |
Check if character c is available in internal buffer.
| *USARTx | Pointer to USARTx peripheral you will use |
| c | character to check if it is in USARTx's buffer |
| Character | status:
|
| int16_t TM_USART_FindString | ( | USART_TypeDef * | USARTx, |
| char * | str | ||
| ) |
Search for string in USART buffer if exists.
| *USARTx | Pointer to USARTx peripheral you will use |
| *str | String to be searched |
| Search | status:
|
| uint8_t TM_USART_Getc | ( | USART_TypeDef * | USARTx | ) |
Gets character from internal USART buffer.
| *USARTx | Pointer to USARTx peripheral you will use |
| Character | from buffer, or 0 if nothing in buffer |
| uint16_t TM_USART_Gets | ( | USART_TypeDef * | USARTx, |
| char * | buffer, | ||
| uint16_t | bufsize | ||
| ) |
Get string from USART.
This function can create a string from USART received data.
It generates string until "\n" is not recognized or buffer length is full.
| *USARTx | Pointer to USARTx peripheral you will use |
| *buffer | Pointer to buffer where data will be stored from buffer |
| bufsize | maximal number of characters we can add to your buffer, including leading zero |
| Number | of characters in buffer |
| void TM_USART_Init | ( | USART_TypeDef * | USARTx, |
| TM_USART_PinsPack_t | pinspack, | ||
| uint32_t | baudrate | ||
| ) |
Initializes USARTx peripheral and corresponding pins.
| *USARTx | Pointer to USARTx peripheral you will use |
| pinspack | This parameter can be a value of TM_USART_PinsPack_t enumeration |
| baudrate | Baudrate number for USART communication |
| None |
| void TM_USART_InitCustomPinsCallback | ( | USART_TypeDef * | USARTx, |
| uint16_t | AlternateFunction | ||
| ) |
Callback for custom pins initialization for USARTx.
When you call TM_USART_Init() function, and if you pass
| *USARTx | Pointer to USARTx peripheral you will use for initialization |
| AlternateFunction | Alternate function number which should be used for GPIO pins |
| None |
| void TM_USART_InitWithFlowControl | ( | USART_TypeDef * | USARTx, |
| TM_USART_PinsPack_t | pinspack, | ||
| uint32_t | baudrate, | ||
| TM_USART_HardwareFlowControl_t | FlowControl | ||
| ) |
Initializes USARTx peripheral and corresponding pins with custom hardware flow control mode.
| *USARTx | Pointer to USARTx peripheral you will use |
| pinspack | This parameter can be a value of TM_USART_PinsPack_t enumeration |
| baudrate | Baudrate number for USART communication |
| FlowControl | Flow control mode you will use. This parameter can be a value of TM_USART_HardwareFlowControl_t enumeration |
| None |
|
static |
Puts character to USART port.
| *USARTx | Pointer to USARTx peripheral you will use |
| c | character to be send over USART |
| None |
| void TM_USART_Puts | ( | USART_TypeDef * | USARTx, |
| char * | str | ||
| ) |
Puts string to USART port.
| *USARTx | Pointer to USARTx peripheral you will use |
| *str | Pointer to string to send over USART |
| None |
| void TM_USART_Send | ( | USART_TypeDef * | USARTx, |
| uint8_t * | DataArray, | ||
| uint16_t | count | ||
| ) |
Sends data array to USART port.
| *USARTx | Pointer to USARTx peripheral you will use |
| *DataArray | Pointer to data array to be sent over USART |
| count | Number of elements in data array to be send over USART |
| None |
| void TM_USART_SetCustomStringEndCharacter | ( | USART_TypeDef * | USARTx, |
| uint8_t | Character | ||
| ) |
Sets custom character for TM_USART_Gets() function to detect when string ends.
| *USARTx | Pointer to USARTx peripheral you will use |
| Character | Character value to be used as string end |
| None |