A31L12x F/W Packages  1.4.0
ABOV Cortex-M0+ Core based MCUs Integrated Driver
A31L12x_hal_usart1n.h
Go to the documentation of this file.
1 /***************************************************************************//****************************************************************************/
34 
35 #ifndef _USART1n_H_
36 #define _USART1n_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 USART1n_BLOCKING_TIMEOUT 0xffffuL // (0xFFFFFFFFuL)
54 
55 //--------------------------------------
56 // Macro defines for USART1n interrupt enable register
57 //--------------------------------------
58 /*
59 #define USART1n_IER_WAKEINT_EN ((uint16_t)(1 << 2)) // WAKE Interrupt enable
60 #define USART1n_IER_RXCINT_EN ((uint16_t)(1 << 3)) // RXC Interrupt enable
61 #define USART1n_IER_TXCINT_EN ((uint16_t)(1 << 4)) // TXC interrupt enable
62 #define USART1n_IER_DR_EN ((uint16_t)(1 << 5)) // DR interrupt enable
63 #define USART1n_IER_BITMASK ((uint16_t)(0x3C)) // USART interrupt enable register bit mask
64 */
65 
66 //--------------------------------------
67 // Macro defines for USART1n interrupt status register
68 //--------------------------------------
69 #define USART1n_SR_DRE ((uint16_t)(1 << 7))
70 #define USART1n_SR_TXC ((uint16_t)(1 << 6))
71 #define USART1n_SR_RXC ((uint16_t)(1 << 5))
72 #define USART1n_SR_WAKE ((uint16_t)(1 << 4))
73 #define USART1n_SR_DOR ((uint16_t)(1 << 2))
74 #define USART1n_SR_FE ((uint16_t)(1 << 1))
75 #define USART1n_SR_PE ((uint16_t)(1 << 0))
76 #define USART1n_SR_BITMASK ((uint16_t)(0xFF))
78 #define USART1n_CR2_USTnRX8 ((uint16_t)(1 << 0))
79 #define USART1n_CR2_USTnTX8 ((uint16_t)(1 << 1))
80 #define USART1n_CR2_USTnSB ((uint16_t)(1 << 2))
81 #define USART1n_CR2_FXCHn ((uint16_t)(1 << 3))
82 #define USART1n_CR2_USTnSSEN ((uint16_t)(1 << 4))
83 #define USART1n_CR2_DISSCKn ((uint16_t)(1 << 5))
84 #define USART1n_CR2_LOOPSn ((uint16_t)(1 << 6))
85 #define USART1n_CR2_MASTERn ((uint16_t)(1 << 7))
86 #define USART1n_CR2_DBLSn ((uint16_t)(1 << 8))
87 #define USART1n_CR2_USTnEN ((uint16_t)(1 << 9))
88 #define USART1n_CR2_BITMASK ((uint16_t)(0x3FF))
90 //******************************************************************************
91 // Type
92 //******************************************************************************
93 
94 //==============================================================================
95 // Enumeration
96 //==============================================================================
97 
98 typedef enum
99 {
104 
105 typedef enum
106 {
110 
111 typedef enum
112 {
116 
117 typedef enum
118 {
122 
124 typedef enum
125 {
132 
134 typedef enum
135 {
139 
141 typedef enum
142 {
147 
149 typedef enum
150 {
161 
165 
166 typedef enum
167 {
175 
179 
180 typedef enum
181 {
186 
190 
191 //==============================================================================
192 // Structure
193 //==============================================================================
194 
195 typedef struct
196 {
197  uint32_t Baudrate;
221 
222 //******************************************************************************
223 // Function
224 //******************************************************************************
225 
226 HAL_Status_Type HAL_USART_Init( USART1n_Type* USART1x, USART1n_CFG_Type* USART1n_Config );
227 HAL_Status_Type HAL_USART_DeInit( USART1n_Type* USART1x );
228 
232 HAL_Status_Type HAL_USART_ConfigInterrupt( USART1n_Type* USART1x, USART1n_INT_Type USART1n_IntCfg, FunctionalState NewState );
234 HAL_Status_Type HAL_USART_Enable( USART1n_Type* USART1x, FunctionalState state );
236 uint8_t HAL_USART_GetStatus( USART1n_Type* USART1x );
237 uint8_t HAL_USART_GetStatusRTORCD( USART1n_Type* USART1x );
238 FlagStatus HAL_USART_CheckBusy( USART1n_Type* USART1x );
239 
240 HAL_Status_Type HAL_USART_TransmitByte( USART1n_Type* USART1x, uint8_t Data );
241 uint8_t HAL_USART_ReceiveByte( USART1n_Type* USART1x );
242 uint32_t HAL_USART_Transmit( USART1n_Type* USART1x, uint8_t* txbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag );
243 uint32_t HAL_USART_Receive( USART1n_Type* USART1x, uint8_t* rxbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag );
244 
245 #ifdef __cplusplus
246 }
247 #endif
248 
249 #endif /* _USART1n_H_ */
250 
USART1n_EDGE_Type Edge
Contains the ABOV typedefs for C standard types. It is intended to be used in ISO C conforming develo...
HAL_Status_Type HAL_USART_Init(USART1n_Type *USART1x, USART1n_CFG_Type *USART1n_Config)
Initialize the USART1n peripheral with the specified parameters.
USART1n_PARITY_BIT_Type Parity
USART1n_SPI_ORDER_Type Order
uint8_t HAL_USART_GetStatusRTORCD(USART1n_Type *USART1x)
Get the RTO/RCD interrupt flag of selected USART1n peripheral.
HAL_Status_Type
HAL_Status_Type HAL_USART_UART_Mode_Config(USART1n_CFG_Type *USART1n_Config)
Fills each USART1n_Config member with its default value:
USART1n_OPMODE_Type Mode
USART1n_DATA_BIT_Type
uint8_t HAL_USART_ReceiveByte(USART1n_Type *USART1x)
Receive a single data from USART peripheral.
HAL_Status_Type HAL_USART_TransmitByte(USART1n_Type *USART1x, uint8_t Data)
Transmit a single data through USART peripheral.
HAL_Status_Type HAL_USART_ConfigInterrupt(USART1n_Type *USART1x, USART1n_INT_Type USART1n_IntCfg, FunctionalState NewState)
Configure the interrupt source of selected USART1n peripheral.
USART1n_ACK_Type
USART1n_STOP_BIT_Type
HAL_Status_Type HAL_USART_DeInit(USART1n_Type *USART1x)
Deinitialize the USART1n peripheral registers to their default reset values.
USART1n_OPMODE_Type
HAL_Status_Type HAL_USART_DataControlConfig(USART1n_Type *USART1x, USART1n_CONTROL_Type Mode, FunctionalState NewState)
Configure Data Control mode for USART peripheral.
USART1n_ACK_Type ACK
USART1n_DATA_BIT_Type Databits
uint8_t HAL_USART_GetStatus(USART1n_Type *USART1x)
Get current value of Line Status register in USART peripheral.
HAL_Status_Type HAL_USART_ClearStatus(USART1n_Type *USART1x, USART1n_STATUS_Type Status)
Clear Status register in USART peripheral.
FunctionalState
TRANSFER_BLOCK_Type
uint32_t HAL_USART_Receive(USART1n_Type *USART1x, uint8_t *rxbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag)
Receive a block of data via USART peripheral.
HAL_Status_Type HAL_USART_USRT_Mode_Config(USART1n_CFG_Type *USART1n_Config)
Fills each USART1n_Config member with its default value:
FlagStatus HAL_USART_CheckBusy(USART1n_Type *USART1x)
Check whether if USART is busy or not.
USART1n_STOP_BIT_Type Stopbits
USART1n_STATUS_Type
HAL_Status_Type HAL_USART_Enable(USART1n_Type *USART1x, FunctionalState state)
USART1n enable control.
USART1n_EDGE_Type
USART1n_SPI_ORDER_Type
uint32_t HAL_USART_Transmit(USART1n_Type *USART1x, uint8_t *txbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag)
Send a block of data via USART peripheral.
USART1n_INT_Type
HAL_Status_Type HAL_USART_SPI_Mode_Config(USART1n_CFG_Type *USART1n_Config)
Fills each USART1n_Config member with its default value:
USART1n_PARITY_BIT_Type
USART1n_CONTROL_Type