HAL_USART_ErrorCallback. STMicroelectronics STM32F4
Oglas
Oglas
UM1725
Return values
None
64.3.27 HAL_USART_ErrorCallback
Function Name
void HAL_USART_ErrorCallback (USART_HandleTypeDef *
husart)
Function Description USART error callbacks.
Parameters
Return values
husart: pointer to a USART_HandleTypeDef structure that contains the configuration information for the specified
USART module.
None
64.3.28 HAL_USART_GetState
Function Name
HAL_USART_StateTypeDef HAL_USART_GetState
(USART_HandleTypeDef * husart)
Function Description Returns the USART state.
Parameters
Return values
husart: pointer to a USART_HandleTypeDef structure that contains the configuration information for the specified
USART module.
HAL state
64.3.29 HAL_USART_GetError
Function Name
uint32_t HAL_USART_GetError (USART_HandleTypeDef *
husart)
Function Description Return the USART error code.
Parameters
Return values
husart: : pointer to a USART_HandleTypeDef structure that contains the configuration information for the specified
USART.
USART Error Code
64.4 USART Firmware driver defines
64.4.1 USART
USART Clock
USART_CLOCK_DISABLE
USART_CLOCK_ENABLE
USART Clock Phase
USART_PHASE_1EDGE
USART_PHASE_2EDGE
USART Clock Polarity
USART_POLARITY_LOW
USART_POLARITY_HIGH
932/963 DOCID025834 Rev 3
UM1725
USART Error Code
HAL_USART_ERROR_NONE No error
HAL_USART_ERROR_PE Parity error
HAL_USART_ERROR_NE
HAL_USART_ERROR_FE
Noise error
Frame error
HAL_USART_ERROR_ORE Overrun error
HAL_USART_ERROR_DMA DMA transfer error
USART Exported Macros
__HAL_USART_RESET_HANDLE_STATE Description:
Reset USART handle state.
Parameters:
__HANDLE__: specifies the
USART Handle. This parameter can be USARTx where x: 1, 2, 3 or
6 to select the USART peripheral.
Return value:
None
__HAL_USART_GET_FLAG Description:
Checks whether the specified
Smartcard flag is set or not.
Parameters:
__HANDLE__: specifies the
USART Handle. This parameter can be USARTx where x: 1, 2, 3 or
6 to select the USART peripheral.
__FLAG__: specifies the flag to check. This parameter can be one of the following values:
USART_FLAG_TXE: Transmit data register empty flag
USART_FLAG_TC:
Transmission Complete flag
USART_FLAG_RXNE:
Receive data register not empty flag
USART_FLAG_IDLE: Idle Line detection flag
USART_FLAG_ORE: Overrun
Error flag
USART_FLAG_NE: Noise
Error flag
USART_FLAG_FE: Framing
Error flag
USART_FLAG_PE: Parity
Error flag
DOCID025834 Rev 3 933/963
934/963
__HAL_USART_CLEAR_FLAG
__HAL_USART_CLEAR_PEFLAG
DOCID025834 Rev 3
UM1725
Return value:
The: new state of __FLAG__
(TRUE or FALSE).
Description:
Clears the specified Smartcard pending flags.
Parameters:
__HANDLE__: specifies the
USART Handle. This parameter can be USARTx where x: 1, 2, 3 or
6 to select the USART peripheral.
__FLAG__: specifies the flag to check. This parameter can be any combination of the following values:
USART_FLAG_TC:
Transmission Complete flag.
USART_FLAG_RXNE:
Receive data register not empty flag.
Return value:
None
Notes:
PE (Parity error), FE (Framing error), NE (Noise error), ORE
(Overrun error) and IDLE (Idle line detected) flags are cleared by software sequence: a read operation to USART_SR register followed by a read operation to
USART_DR register. RXNE flag can be also cleared by a read to the
USART_DR register. TC flag can be also cleared by software sequence: a read operation to
USART_SR register followed by a write operation to USART_DR register. TXE flag is cleared only by a write to the USART_DR register.
Description:
Clear the USART PE pending flag.
Parameters:
__HANDLE__: specifies the
USART Handle. This parameter can be USARTx where x: 1, 2, 3 or
6 to select the USART peripheral.
Return value:
None
UM1725
__HAL_USART_CLEAR_FEFLAG
__HAL_USART_CLEAR_NEFLAG
__HAL_USART_ENABLE_IT
__HAL_USART_CLEAR_OREFLAG
__HAL_USART_CLEAR_IDLEFLAG
DOCID025834 Rev 3
Description:
Clear the USART FE pending flag.
Parameters:
__HANDLE__: specifies the
USART Handle. This parameter can be USARTx where x: 1, 2, 3 or
6 to select the USART peripheral.
Return value:
None
Description:
Clear the USART NE pending flag.
Parameters:
__HANDLE__: specifies the
USART Handle. This parameter can be USARTx where x: 1, 2, 3 or
6 to select the USART peripheral.
Return value:
None
Description:
Clear the UART ORE pending flag.
Parameters:
__HANDLE__: specifies the
USART Handle. This parameter can be USARTx where x: 1, 2, 3 or
6 to select the USART peripheral.
Return value:
None
Description:
Clear the USART IDLE pending flag.
Parameters:
__HANDLE__: specifies the
USART Handle. This parameter can be USARTx where x: 1, 2, 3 or
6 to select the USART peripheral.
Return value:
None
Description:
Enables or disables the specified
USART interrupts.
Parameters:
935/963
936/963
__HAL_USART_DISABLE_IT
__HAL_USART_GET_IT_SOURCE
DOCID025834 Rev 3
UM1725
__HANDLE__: specifies the
USART Handle. This parameter can be USARTx where x: 1, 2, 3 or
6 to select the USART peripheral.
__INTERRUPT__: specifies the
USART interrupt source to check.
This parameter can be one of the following values:
USART_IT_TXE: Transmit
Data Register empty interrupt
USART_IT_TC: Transmission complete interrupt
USART_IT_RXNE: Receive
Data register not empty interrupt
USART_IT_IDLE: Idle line detection interrupt
USART_IT_PE: Parity Error interrupt
USART_IT_ERR: Error interrupt(Frame error, noise error, overrun error) This parameter can be: ENABLE or
DISABLE.
Return value:
None
Description:
Checks whether the specified
USART interrupt has occurred or not.
Parameters:
__HANDLE__: specifies the
USART Handle. This parameter can be USARTx where x: 1, 2, 3 or
6 to select the USART peripheral.
__IT__: specifies the USART interrupt source to check. This parameter can be one of the following values:
USART_IT_TXE: Transmit
Data Register empty interrupt
USART_IT_TC: Transmission complete interrupt
USART_IT_RXNE: Receive
Data register not empty interrupt
USART_IT_IDLE: Idle line detection interrupt
USART_IT_ERR: Error interrupt
UM1725
USART_IT_PE: Parity Error interrupt
Return value:
The: new state of __IT__ (TRUE or
FALSE).
__HAL_USART_ONE_BIT_SAMPLE_ENABLE
Description:
Macro to enable the USART's one bit sample method.
Parameters:
__HANDLE__: specifies the
USART Handle.
Return value:
None
__HAL_USART_ONE_BIT_SAMPLE_DISABLE Description:
Macro to disable the USART's one bit sample method.
__HAL_USART_ENABLE
Parameters:
__HANDLE__: specifies the
USART Handle.
Return value:
None
Description:
Enable USART.
Parameters:
__HANDLE__: specifies the
USART Handle. USART Handle selects the USARTx peripheral
(USART availability and x value depending on device).
__HAL_USART_DISABLE
Return value:
None
Description:
Disable USART.
Parameters:
__HANDLE__: specifies the
USART Handle. USART Handle selects the USARTx peripheral
(USART availability and x value depending on device).
Return value:
None
DOCID025834 Rev 3 937/963
938/963
USART Flags
USART_FLAG_TXE
USART_FLAG_TC
USART_FLAG_RXNE
USART_FLAG_IDLE
USART_FLAG_ORE
USART_FLAG_NE
USART_FLAG_FE
USART_FLAG_PE
USART Interrupts Definition
USART_IT_PE
USART_IT_TXE
USART_IT_TC
USART_IT_RXNE
USART_IT_IDLE
USART_IT_LBD
USART_IT_CTS
USART_IT_ERR
USART Last Bit
USART_LASTBIT_DISABLE
USART_LASTBIT_ENABLE
USART Mode
USART_MODE_RX
USART_MODE_TX
USART_MODE_TX_RX
USART NACK State
USART_NACK_ENABLE
USART_NACK_DISABLE
USART Parity
USART_PARITY_NONE
USART_PARITY_EVEN
USART_PARITY_ODD
USART Private Constants
DUMMY_DATA
USART_TIMEOUT_VALUE
USART_IT_MASK
DOCID025834 Rev 3
UM1725
UM1725
USART_CR1_REG_INDEX
USART_CR2_REG_INDEX
USART_CR3_REG_INDEX
USART Private Macros
IS_USART_NACK_STATE
IS_USART_LASTBIT
IS_USART_PHASE
IS_USART_POLARITY
IS_USART_CLOCK
IS_USART_WORD_LENGTH
IS_USART_STOPBITS
IS_USART_PARITY
IS_USART_MODE
IS_USART_BAUDRATE
USART_DIV
USART_DIVMANT
USART_DIVFRAQ
USART_BRR
USART Number of Stop Bits
USART_STOPBITS_1
USART_STOPBITS_0_5
USART_STOPBITS_2
USART_STOPBITS_1_5
USART Word Length
USART_WORDLENGTH_8B
USART_WORDLENGTH_9B
DOCID025834 Rev 3 939/963
Prenesi
Oglas