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

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

#include "mg32l003.h"

Go to the source code of this file.

Data Structures

struct  LPUART_InitTypeDef
 LPUART Init Structure definition. More...
 

Macros

#define IS_LPUART_ALL_PERIPH(PERIPH)   (((PERIPH) == LPUART))
 
#define LPUART_BandDouble_Enable   ((uint32_t)LPUART_SCON_DBAUD)
 
#define LPUART_BandDouble_Disable   ((uint32_t)0x00)
 
#define LPUART_BaudRateMode_Self   ((uint32_t)LPUART_BAUDCR_SELF_BRG)
 
#define LPUART_BaudRateMode_Tim   ((uint32_t)0x00)
 
#define LPUART_WordLength_8b   ((uint32_t)(0x01U << 6))
 
#define LPUART_WordLength_9b   ((uint32_t)(0x03U << 6))
 
#define LPUART_LowPower_Enable   ((uint32_t)(0x01U << 10))
 
#define LPUART_LowPower_Disable   ((uint32_t)0x00)
 
#define LPUART_ClkSel_PCLK   ((uint32_t)(0x01U << 11))
 
#define LPUART_ClkSel_LSE   ((uint32_t)(0x02U << 11))
 
#define LPUART_ClkSel_LSI   ((uint32_t)(0x03U << 11))
 
#define LPUART_CLK_DIV1   ((uint32_t)(0x07U << 13))
 
#define LPUART_CLK_DIV2   ((uint32_t)(0x06U << 13))
 
#define LPUART_CLK_DIV4   ((uint32_t)(0x05U << 13))
 
#define LPUART_CLK_DIV8   ((uint32_t)(0x04U << 13))
 
#define LPUART_CLK_DIV16   ((uint32_t)(0x03U << 13))
 
#define LPUART_CLK_DIV32   ((uint32_t)(0x02U << 13))
 
#define LPUART_CLK_DIV64   ((uint32_t)(0x01U << 13))
 
#define LPUART_CLK_DIV128   ((uint32_t)(0x00U << 13))
 
#define LPUART_Parity_None   ((uint32_t)0x00)
 
#define LPUART_Parity_Odd   ((uint32_t)0x01)
 
#define LPUART_Parity_Even   ((uint32_t)0x02)
 
#define LPUART_IT_FE   LPUART_SCON_FEEN
 
#define LPUART_IT_TI   LPUART_SCON_TIEN
 
#define LPUART_IT_RI   LPUART_SCON_RIEN
 
#define LPUART_FLAG_FE   LPUART_INTSR_FE
 
#define LPUART_FLAG_TI   LPUART_INTSR_TI
 
#define LPUART_FLAG_RI   LPUART_INTSR_RI
 

Functions

void LPUART_DeInit (LPUART_TypeDef *LPUARTx)
 Deinitializes the LPUARTx peripheral registers to their default reset values. More...
 
void LPUART_Init (LPUART_TypeDef *LPUARTx, LPUART_InitTypeDef *LPUART_InitStruct)
 Initializes the LPUARTx peripheral according to the specified parameters in the LPUART_InitStruct. More...
 
void LPUART_StructInit (LPUART_InitTypeDef *LPUART_InitStruct)
 Fills each LPUART_InitStruct member with its default value. More...
 
void LPUART_Cmd (LPUART_TypeDef *LPUARTx, FunctionalState NewState)
 Enables or disables the specified LPUART peripheral. More...
 
void LPUART_WriteData (LPUART_TypeDef *LPUARTx, uint8_t Data)
 Write data to SBUF register. More...
 
uint8_t LPUART_ReadData (LPUART_TypeDef *LPUARTx)
 Read data from SBUF register. More...
 
void LPUART_MultideviceCmd (LPUART_TypeDef *LPUARTx, FunctionalState NewState)
 Enables or disables the LPUARTx's Multidevice function. More...
 
void LPUART_SetAddress (LPUART_TypeDef *LPUARTx, uint8_t LPUART_Address)
 Sets the address of the LPUART node. More...
 
void LPUART_SetAddressMask (LPUART_TypeDef *LPUARTx, uint8_t LPUART_AddressMask)
 Sets the address mask of the LPUART node. More...
 
void LPUART_ITConfig (LPUART_TypeDef *LPUARTx, uint32_t LPUART_IT, FunctionalState NewState)
 Enables or disables the LPUARTx's interrupts. More...
 
FlagStatus LPUART_GetFlagStatus (LPUART_TypeDef *LPUARTx, uint32_t LPUART_FLAG)
 Checks whether the specified UART flag is set or not. More...
 
void LPUART_ClearFlag (LPUART_TypeDef *LPUARTx, uint32_t LPUART_FLAG)
 Clear the specified LPUART flag. More...
 

Detailed Description

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

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