MG32L003 Standard Peripherals Firmware Library
Data Structures | Macros | Functions
mg32l003_uart.h File Reference

This file contains all the functions prototypes for the UART firmware library. More...

#include "mg32l003.h"

Go to the source code of this file.

Data Structures

struct  UART_InitTypeDef
 UART Init Structure definition. More...
 

Macros

#define IS_UART_ALL_PERIPH(PERIPH)
 
#define UART_WordLength_8b   ((uint32_t)(0x01U << 6))
 
#define UART_WordLength_9b   ((uint32_t)(0x03U << 6))
 
#define UART_BandDouble_Enable   ((uint32_t)UART_SCON_DBAUD)
 
#define UART_BandDouble_Disable   ((uint32_t)0x00)
 
#define UART_BaudRateMode_Self   ((uint32_t)UART_BAUDCR_SELF_BRG)
 
#define UART_BaudRateMode_Tim   ((uint32_t)0x00)
 
#define UART_Parity_None   ((uint8_t)0x00)
 
#define UART_Parity_Odd   ((uint8_t)0x01)
 
#define UART_Parity_Even   ((uint8_t)0x02)
 
#define UART_IT_FE   UART_SCON_FEEN
 
#define UART_IT_TI   UART_SCON_TIEN
 
#define UART_IT_RI   UART_SCON_RIEN
 
#define UART_FLAG_FE   UART_INTSR_FE
 
#define UART_FLAG_TI   UART_INTSR_TI
 
#define UART_FLAG_RI   UART_INTSR_RI
 

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_Cmd (UART_TypeDef *UARTx, FunctionalState NewState)
 Enables or disables the specified UART peripheral. More...
 
void UART_WriteData (UART_TypeDef *UARTx, uint8_t Data)
 Write data to SBUF register. More...
 
uint8_t UART_ReadData (UART_TypeDef *UARTx)
 Read data from SBUF register. More...
 
void UART_WriteDataParity (UART_TypeDef *UARTx, uint8_t Data, uint8_t Parity)
 Write data and parity to SBUF register. More...
 
uint8_t UART_ReadDataParity (UART_TypeDef *UARTx, uint8_t *Data, uint8_t Parity)
 Read data and parity check result from SBUF register. More...
 
void UART_MultideviceCmd (UART_TypeDef *UARTx, FunctionalState NewState)
 Enables or disables the UARTx's Multidevice function. More...
 
void UART_SetAddress (UART_TypeDef *UARTx, uint8_t UART_Address)
 Sets the address of the UART node. More...
 
void UART_SetAddressMask (UART_TypeDef *UARTx, uint8_t UART_AddressMask)
 Sets the address mask of the UART node. More...
 
void UART_IrDACmd (UART_TypeDef *UARTx, FunctionalState NewState)
 Enables or disables the UARTx's IrDA Mode. More...
 
void UART_ITConfig (UART_TypeDef *UARTx, uint8_t UART_IT, FunctionalState NewState)
 Enables or disables the UARTx's interrupts. More...
 
FlagStatus UART_GetFlagStatus (UART_TypeDef *UARTx, uint32_t UART_FLAG)
 Checks whether the specified UART flag is set or not. More...
 
void UART_ClearFlag (UART_TypeDef *UARTx, uint32_t UART_FLAG)
 Clear the specified UART flag. More...
 

Detailed Description

This file contains all the functions prototypes for the UART firmware library.

Author
megawin Application Team
Version
V0.0.5
Date
13-August-2024