MG32F10x Standard Peripherals Firmware Library
Functions
mg32f10x_uart.c File Reference

This file provides all the UART firmware functions. More...

#include "mg32f10x_uart.h"
#include "mg32f10x_rcc.h"

Functions

void UART_DeInit (UART_TypeDef *UARTx)
 Deinitializes the UARTx peripheral registers to their default reset values. More...
 
void UART_Init (UART_TypeDef *UARTx, UART_InitTypeDef *UART_InitStruct)
 Initializes the UARTx peripheral according to the specified parameters in the UART_InitStruct. More...
 
void UART_StructInit (UART_InitTypeDef *UART_InitStruct)
 Fills each UART_InitStruct member with its default value. More...
 
void UART_WriteData (UART_TypeDef *UARTx, uint16_t Data)
 Write data to THR register or Tx FIFO. More...
 
uint16_t UART_ReadData (UART_TypeDef *UARTx)
 Read data from RBR register or Rx FIFO. More...
 
void UART_RxFIFOThresholdConfig (UART_TypeDef *UARTx, uint8_t Threshold)
 Configure UARTx's Rx FIFO trigger threshold. More...
 
void UART_TxFIFOThresholdConfig (UART_TypeDef *UARTx, uint8_t Threshold)
 Configure UARTx's Tx FIFO trigger threshold. More...
 
void UART_FIFOCmd (UART_TypeDef *UARTx, FunctionalState NewState)
 Enables or disables the UARTx's FIFO. More...
 
void UART_ResetRxFIFO (UART_TypeDef *UARTx)
 Reset the UART's Rx FIFO. More...
 
void UART_ResetTxFIFO (UART_TypeDef *UARTx)
 Reset the UART's Tx FIFO. More...
 
void UART_ForceBreakCmd (UART_TypeDef *UARTx, FunctionalState NewState)
 Force the serial out to spacing state or not. More...
 
void UART_IrDACmd (UART_TypeDef *UARTx, FunctionalState NewState)
 Enables or disables the UARTx's IrDA SIR Mode. More...
 
void UART_ProgrammableTHREModeCmd (UART_TypeDef *UARTx, FunctionalState NewState)
 Enables or disables the UARTx's Programmable THRE Interrupt Mode. More...
 
void UART_LineStatusClearModeConfig (UART_TypeDef *UARTx, uint8_t Mode)
 Select the method for clearing the status in the LSR register. More...
 
void UART_ITConfig (UART_TypeDef *UARTx, uint8_t UART_IT, FunctionalState NewState)
 Enables or disables the UARTx's interrupts. More...
 
uint8_t UART_GetIntID (UART_TypeDef *UARTx)
 Get UARTx's Interrupt ID. More...
 
FlagStatus UART_GetFlagStatus (UART_TypeDef *UARTx, uint32_t UART_FLAG)
 Checks whether the specified UART flag is set or not. More...
 
uint32_t UART_GetLineStatus (UART_TypeDef *UARTx)
 Get UARTx's Line status. More...
 
uint32_t UART_GetModemStatus (UART_TypeDef *UARTx)
 Get UARTx's Modem Status. More...
 
void UART_LoopBackModeCmd (UART_TypeDef *UARTx, FunctionalState NewState)
 Enables or disables the UARTx's LoopBack Mode. More...
 
void UART_ModemForceRtsPinState (UART_TypeDef *UARTx, SignalState NewState)
 Control RTS Pin State. More...
 

Detailed Description

This file provides all the UART firmware functions.

Author
megawin Application Team
Version
V0.1.10
Date
05-January-2023