STM32L486xx HAL User Manual
|
USART HAL module driver. This file provides firmware functions to manage the following functionalities of the Universal Synchronous/Asynchronous Receiver Transmitter Peripheral (USART). + Initialization and de-initialization functions + IO operation functions + Peripheral Control functions + Peripheral State and Error functions. More...
#include "stm32l4xx_hal.h"
Go to the source code of this file.
Defines | |
#define | USART_DUMMY_DATA ((uint16_t) 0xFFFF) |
#define | USART_TEACK_REACK_TIMEOUT 1000U |
#define | USART_CR1_FIELDS |
#define | USART_CR2_FIELDS |
#define | USART_BRR_MIN 0x10U /* USART BRR minimum authorized value */ |
#define | USART_BRR_MAX 0xFFFFU /* USART BRR maximum authorized value */ |
Functions | |
void | USART_InitCallbacksToDefault (USART_HandleTypeDef *husart) |
Initialize the callbacks to their default values. | |
static void | USART_EndTransfer (USART_HandleTypeDef *husart) |
End ongoing transfer on USART peripheral (following error detection or Transfer completion). | |
static void | USART_DMATransmitCplt (DMA_HandleTypeDef *hdma) |
DMA USART transmit process complete callback. | |
static void | USART_DMAReceiveCplt (DMA_HandleTypeDef *hdma) |
DMA USART receive process complete callback. | |
static void | USART_DMATxHalfCplt (DMA_HandleTypeDef *hdma) |
DMA USART transmit process half complete callback. | |
static void | USART_DMARxHalfCplt (DMA_HandleTypeDef *hdma) |
DMA USART receive process half complete callback. | |
static void | USART_DMAError (DMA_HandleTypeDef *hdma) |
DMA USART communication error callback. | |
static void | USART_DMAAbortOnError (DMA_HandleTypeDef *hdma) |
DMA USART communication abort callback, when initiated by HAL services on Error (To be called at end of DMA Abort procedure following error occurrence). | |
static void | USART_DMATxAbortCallback (DMA_HandleTypeDef *hdma) |
DMA USART Tx communication abort callback, when initiated by user (To be called at end of DMA Tx Abort procedure following user abort request). | |
static void | USART_DMARxAbortCallback (DMA_HandleTypeDef *hdma) |
DMA USART Rx communication abort callback, when initiated by user (To be called at end of DMA Rx Abort procedure following user abort request). | |
static HAL_StatusTypeDef | USART_WaitOnFlagUntilTimeout (USART_HandleTypeDef *husart, uint32_t Flag, FlagStatus Status, uint32_t Tickstart, uint32_t Timeout) |
Handle USART Communication Timeout. | |
static HAL_StatusTypeDef | USART_SetConfig (USART_HandleTypeDef *husart) |
Configure the USART peripheral. | |
static HAL_StatusTypeDef | USART_CheckIdleState (USART_HandleTypeDef *husart) |
Check the USART Idle State. | |
static void | USART_TxISR_8BIT (USART_HandleTypeDef *husart) |
Simplex send an amount of data in non-blocking mode. | |
static void | USART_TxISR_16BIT (USART_HandleTypeDef *husart) |
Simplex send an amount of data in non-blocking mode. | |
static void | USART_EndTransmit_IT (USART_HandleTypeDef *husart) |
Wraps up transmission in non-blocking mode. | |
static void | USART_RxISR_8BIT (USART_HandleTypeDef *husart) |
Simplex receive an amount of data in non-blocking mode. | |
static void | USART_RxISR_16BIT (USART_HandleTypeDef *husart) |
Simplex receive an amount of data in non-blocking mode. | |
HAL_StatusTypeDef | HAL_USART_Init (USART_HandleTypeDef *husart) |
Initialize the USART mode according to the specified parameters in the USART_InitTypeDef and initialize the associated handle. | |
HAL_StatusTypeDef | HAL_USART_DeInit (USART_HandleTypeDef *husart) |
DeInitialize the USART peripheral. | |
__weak void | HAL_USART_MspInit (USART_HandleTypeDef *husart) |
Initialize the USART MSP. | |
__weak void | HAL_USART_MspDeInit (USART_HandleTypeDef *husart) |
DeInitialize the USART MSP. | |
HAL_StatusTypeDef | HAL_USART_RegisterCallback (USART_HandleTypeDef *husart, HAL_USART_CallbackIDTypeDef CallbackID, pUSART_CallbackTypeDef pCallback) |
Register a User USART Callback To be used instead of the weak predefined callback. | |
HAL_StatusTypeDef | HAL_USART_UnRegisterCallback (USART_HandleTypeDef *husart, HAL_USART_CallbackIDTypeDef CallbackID) |
Unregister an UART Callback UART callaback is redirected to the weak predefined callback. | |
HAL_StatusTypeDef | HAL_USART_Transmit (USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size, uint32_t Timeout) |
Simplex send an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_USART_Receive (USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size, uint32_t Timeout) |
Receive an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_USART_TransmitReceive (USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout) |
Full-Duplex Send and Receive an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_USART_Transmit_IT (USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size) |
Send an amount of data in interrupt mode. | |
HAL_StatusTypeDef | HAL_USART_Receive_IT (USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size) |
Receive an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_USART_TransmitReceive_IT (USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size) |
Full-Duplex Send and Receive an amount of data in interrupt mode. | |
HAL_StatusTypeDef | HAL_USART_Transmit_DMA (USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size) |
Send an amount of data in DMA mode. | |
HAL_StatusTypeDef | HAL_USART_Receive_DMA (USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size) |
Receive an amount of data in DMA mode. | |
HAL_StatusTypeDef | HAL_USART_TransmitReceive_DMA (USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size) |
Full-Duplex Transmit Receive an amount of data in non-blocking mode. | |
HAL_StatusTypeDef | HAL_USART_DMAPause (USART_HandleTypeDef *husart) |
Pause the DMA Transfer. | |
HAL_StatusTypeDef | HAL_USART_DMAResume (USART_HandleTypeDef *husart) |
Resume the DMA Transfer. | |
HAL_StatusTypeDef | HAL_USART_DMAStop (USART_HandleTypeDef *husart) |
Stop the DMA Transfer. | |
HAL_StatusTypeDef | HAL_USART_Abort (USART_HandleTypeDef *husart) |
Abort ongoing transfers (blocking mode). | |
HAL_StatusTypeDef | HAL_USART_Abort_IT (USART_HandleTypeDef *husart) |
Abort ongoing transfers (Interrupt mode). | |
void | HAL_USART_IRQHandler (USART_HandleTypeDef *husart) |
Handle USART interrupt request. | |
__weak void | HAL_USART_TxCpltCallback (USART_HandleTypeDef *husart) |
Tx Transfer completed callback. | |
__weak void | HAL_USART_TxHalfCpltCallback (USART_HandleTypeDef *husart) |
Tx Half Transfer completed callback. | |
__weak void | HAL_USART_RxCpltCallback (USART_HandleTypeDef *husart) |
Rx Transfer completed callback. | |
__weak void | HAL_USART_RxHalfCpltCallback (USART_HandleTypeDef *husart) |
Rx Half Transfer completed callback. | |
__weak void | HAL_USART_TxRxCpltCallback (USART_HandleTypeDef *husart) |
Tx/Rx Transfers completed callback for the non-blocking process. | |
__weak void | HAL_USART_ErrorCallback (USART_HandleTypeDef *husart) |
USART error callback. | |
__weak void | HAL_USART_AbortCpltCallback (USART_HandleTypeDef *husart) |
USART Abort Complete callback. | |
HAL_USART_StateTypeDef | HAL_USART_GetState (USART_HandleTypeDef *husart) |
Return the USART handle state. | |
uint32_t | HAL_USART_GetError (USART_HandleTypeDef *husart) |
Return the USART error code. |
USART HAL module driver. This file provides firmware functions to manage the following functionalities of the Universal Synchronous/Asynchronous Receiver Transmitter Peripheral (USART). + Initialization and de-initialization functions + IO operation functions + Peripheral Control functions + Peripheral State and Error functions.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file stm32l4xx_hal_usart.c.