A31L12x F/W Packages  1.4.0
ABOV Cortex-M0+ Core based MCUs Integrated Driver
A31L12x_hal_lpuart.h
Go to the documentation of this file.
1 /***************************************************************************//****************************************************************************/
34 
35 #ifndef _LPUART_H_
36 #define _LPUART_H_
37 
38 #include "A31L12x.h"
39 #include "A31L12x_hal_aa_types.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 //******************************************************************************
46 // Constant
47 //******************************************************************************
48 
49 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
53 #define LPUART_BLOCKING_TIMEOUT 0xffffuL // (0xFFFFFFFFuL)
54 
55 //******************************************************************************
56 // Type
57 //******************************************************************************
58 
59 //==============================================================================
60 // Enumeration
61 //==============================================================================
62 
63 typedef enum
64 {
69 
70 typedef enum
71 {
77 
78 typedef enum
79 {
80  LPUART_PARITY_BIT_NONE = 0, // [PEN:STKPEN:PSEL] = [0:0:0]
81  LPUART_PARITY_BIT_ODD = 4, // [PEN:STKPEN:PSEL] = [1:0:0]
82  LPUART_PARITY_BIT_EVEN, // [PEN:STKPEN:PSEL] = [1:0:1]
83  LPUART_PARITY_BIT_SP0 = 6, // [PEN:STKPEN:PSEL] = [1:1:0]
84  LPUART_PARITY_BIT_SP1 // [PEN:STKPEN:PSEL] = [1:1:1]
86 
87 typedef enum
88 {
92 
93 typedef enum
94 {
95  // CR1
105 
106  // CR2
112 
113 typedef enum
114 {
121 
122 typedef enum
123 {
134 
135 //==============================================================================
136 // Structure
137 //==============================================================================
138 
139 typedef struct
140 {
141  uint32_t BaseClock;
142  uint32_t Baudrate;
143 
145 
150 
151 //******************************************************************************
152 // Function
153 //******************************************************************************
154 
157 
163 uint8_t HAL_LPUART_GetStatus( void );
164 
166 uint8_t HAL_LPUART_ReceiveByte( void );
167 uint32_t HAL_LPUART_Transmit( uint8_t* txbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag );
168 uint32_t HAL_LPUART_Receive( uint8_t* rxbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag );
169 
170 #ifdef __cplusplus
171 }
172 #endif
173 
174 #endif /* _LPUART_H_ */
175 
HAL_Status_Type HAL_LPUART_ConfigStructInit(LPUART_CFG_Type *LPUART_Config)
Fills each LPUART_Config member with its default value:
uint8_t HAL_LPUART_GetStatus(void)
This function returns the current value of Interrupt Flag and Status Register.
LPUART_OVER_SAMPLING_Type OverSampling
HAL_Status_Type HAL_LPUART_TransmitByte(uint8_t Data)
Transmit a single data through USART peripheral.
HAL_Status_Type HAL_LPUART_ClearStatus(LPUART_STATUS_Type Status)
This function clears Interrupt Flag and Status Register.
Contains the ABOV typedefs for C standard types. It is intended to be used in ISO C conforming develo...
LPUART_STATUS_Type
HAL_Status_Type HAL_LPUART_DeInit(void)
Deinitialize the LPUART peripheral registers to their default reset values.
HAL_Status_Type
uint8_t HAL_LPUART_ReceiveByte(void)
Receive a single data from USART peripheral.
LPUART_STOP_BIT_Type
HAL_Status_Type HAL_LPUART_Init(LPUART_CFG_Type *LPUART_Config)
Initialize the LPUART peripheral with the specified parameters.
LPUART_DATA_BIT_Type
LPUART_INT_Type
uint32_t HAL_LPUART_Receive(uint8_t *rxbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag)
Receive a block of data via LPUART peripheral.
HAL_Status_Type HAL_LPUART_Enable(FunctionalState state)
LPUART enable control.
LPUART_STOP_BIT_Type StopBit
LPUART_OVER_SAMPLING_Type
FunctionalState
TRANSFER_BLOCK_Type
LPUART_PARITY_BIT_Type
LPUART_PARITY_BIT_Type ParityBit
uint32_t HAL_LPUART_Transmit(uint8_t *txbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag)
Send a block of data via LPUART peripheral.
HAL_Status_Type HAL_LPUART_ConfigInterrupt(LPUART_INT_Type LPUART_IntCfg, FunctionalState NewState)
Configure the interrupt source of selected LPUART peripheral.
HAL_Status_Type HAL_LPUART_DataControlConfig(LPUART_CONTROL_Type Mode, FunctionalState NewState)
Configure Data Control mode for LPUART peripheral.
LPUART_DATA_BIT_Type DataBit
LPUART_CONTROL_Type