Contains all macro definitions and function prototypes support for uartn firmware library on A31G12x. More...
Go to the source code of this file.
Data Structures | |
struct | UARTn_CFG_Type |
Functions | |
HAL_Status_Type | HAL_UART_Init (UARTn_Type *UARTx, UARTn_CFG_Type *UARTn_Config) |
Initialize the UARTn peripheral with the specified parameters. More... | |
HAL_Status_Type | HAL_UART_DeInit (UARTn_Type *UARTx) |
Deinitialize the UARTn peripheral registers to their default reset values. More... | |
HAL_Status_Type | HAL_UART_ConfigStructInit (UARTn_CFG_Type *UARTn_Config) |
Fills each UARTn_Config member with its default value: More... | |
HAL_Status_Type | HAL_UART_ConfigInterrupt (UARTn_Type *UARTx, UARTn_INT_Type UARTn_IntCfg, FunctionalState NewState) |
Configure the peripheral interrupt. More... | |
HAL_Status_Type | HAL_UART_DataControlConfig (UARTn_Type *UARTx, UARTn_DATA_CONTROL_Type Mode, FunctionalState NewState) |
Configure Data Control mode for UART peripheral. More... | |
HAL_Status_Type | HAL_UART_IFDelayConfig (UARTn_Type *UARTx, uint8_t waitval) |
Configure inter-frame delay time for UART peripheral. More... | |
HAL_Status_Type | HAL_UART_ForceBreak (UARTn_Type *UARTx) |
Force BREAK character on UART line, output pin UARTn TXD is forced to logic 0. More... | |
uint8_t | HAL_UART_GetLineStatus (UARTn_Type *UARTx) |
This function returns the current value of Line Status Register. More... | |
FlagStatus | HAL_UART_CheckBusy (UARTn_Type *UARTx) |
Check whether if UART is busy or not. More... | |
HAL_Status_Type | HAL_UART_TransmitByte (UARTn_Type *UARTx, uint8_t Data) |
Transmit a single data through UART peripheral. More... | |
uint8_t | HAL_UART_ReceiveByte (UARTn_Type *UARTx) |
Receive a single data from UART peripheral. More... | |
uint32_t | HAL_UART_Transmit (UARTn_Type *UARTx, uint8_t *txbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag) |
Send a block of data via UART peripheral. More... | |
uint32_t | HAL_UART_Receive (UARTn_Type *UARTx, uint8_t *rxbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag) |
Receive a block of data via UART peripheral. More... | |
Variables | |
char | InData [80] |
int | InFlag |
int | InCount |
Contains all macro definitions and function prototypes support for uartn firmware library on A31G12x.
Copyright(C) 2019, ABOV Semiconductor All rights reserved.
ABOV Disclaimer
IMPORTANT NOTICE ? PLEASE READ CAREFULLY ABOV Semiconductor ("ABOV") reserves the right to make changes, corrections, enhancements, modifications, and improvements to ABOV products and/or to this document at any time without notice. ABOV does not give warranties as to the accuracy or completeness of the information included herein. Purchasers should obtain the latest relevant information of ABOV products before placing orders. Purchasers are entirely responsible for the choice, selection, and use of ABOV products and ABOV assumes no liability for application assistance or the design of purchasers' products. No license, express or implied, to any intellectual property rights is granted by ABOV herein. ABOV disclaims all express and implied warranties and shall not be responsible or liable for any injuries or damages related to use of ABOV products in such unauthorized applications. ABOV and the ABOV logo are trademarks of ABOV. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces the information previously supplied in any former versions of this document. 2020 ABOV Semiconductor All rights reserved
Definition in file A31G12x_hal_uartn.h.
enum UARTn_DATA_BIT_Type |
UARTn Data Bit type definitions
Enumerator | |
---|---|
UARTn_DATA_BIT_5 | 5 Data Bits |
UARTn_DATA_BIT_6 | 6 Data Bits |
UARTn_DATA_BIT_7 | 7 Data Bits |
UARTn_DATA_BIT_8 | 8 Data Bits |
Definition at line 120 of file A31G12x_hal_uartn.h.
UARTn Data Control type definition
Enumerator | |
---|---|
UARTn_DATA_CONTROL_LOOPBACK | Loop back mode select |
UARTn_DATA_CONTROL_RXINV | |
UARTn_DATA_CONTROL_TXINV | |
UARTn_DATA_CONTROL_RTXINV |
Definition at line 155 of file A31G12x_hal_uartn.h.
enum UARTn_INT_Type |
UARTn Interrupt Type definitions
Enumerator | |
---|---|
UARTn_INTCFG_RBR | RBR Interrupt enable |
UARTn_INTCFG_THRE | THR Interrupt enable |
UARTn_INTCFG_RLS | RX line status interrupt enable |
UARTn_INTCFG_TXE | TXE interrupt |
Definition at line 146 of file A31G12x_hal_uartn.h.
UARTn Parity Bit type definitions
Enumerator | |
---|---|
UARTn_PARITY_BIT_NONE | No parity |
UARTn_PARITY_BIT_ODD | Odd parity |
UARTn_PARITY_BIT_EVEN | Even parity |
UARTn_PARITY_BIT_SP_1 | Forced "1" stick parity |
UARTn_PARITY_BIT_SP_0 | Forced "0" stick parity |
Definition at line 136 of file A31G12x_hal_uartn.h.
enum UARTn_STOP_BIT_Type |
UARTn Stop Bit type definitions
Enumerator | |
---|---|
UARTn_STOP_BIT_1 | 1 Stop Bits |
UARTn_STOP_BIT_2 | 2 Stop Bits |
Definition at line 129 of file A31G12x_hal_uartn.h.
FlagStatus HAL_UART_CheckBusy | ( | UARTn_Type * | UARTx | ) |
Check whether if UART is busy or not.
[in] | UARTx | Pointer to the target UART
|
Definition at line 461 of file A31G12x_hal_uartn.c.
Referenced by fputc().
HAL_Status_Type HAL_UART_ConfigInterrupt | ( | UARTn_Type * | UARTx, |
UARTn_INT_Type | UARTn_IntCfg, | ||
FunctionalState | NewState | ||
) |
Configure the peripheral interrupt.
[in] | UARTx | Pointer to the target UART
|
[in] | UARTn_IntCfg | Specifies the interrupt flag
|
[in] | NewState | Next State of Interrupt Operation
|
Definition at line 297 of file A31G12x_hal_uartn.c.
References ENABLE, HAL_ERROR, HAL_OK, UARTn_INTCFG_RBR, UARTn_INTCFG_RLS, UARTn_INTCFG_THRE, and UARTn_INTCFG_TXE.
HAL_Status_Type HAL_UART_ConfigStructInit | ( | UARTn_CFG_Type * | UARTn_Config | ) |
Fills each UARTn_Config member with its default value:
[out] | UARTn_Config | Pointer to a UARTn_CFG_Type structure which will be initialized. |
Definition at line 264 of file A31G12x_hal_uartn.c.
References UARTn_CFG_Type::Baudrate, UARTn_CFG_Type::Databits, HAL_ERROR, HAL_OK, UARTn_CFG_Type::Parity, UARTn_CFG_Type::Stopbits, UARTn_DATA_BIT_8, UARTn_PARITY_BIT_NONE, and UARTn_STOP_BIT_1.
Referenced by debug_frmwrk_init().
HAL_Status_Type HAL_UART_DataControlConfig | ( | UARTn_Type * | UARTx, |
UARTn_DATA_CONTROL_Type | Mode, | ||
FunctionalState | NewState | ||
) |
Configure Data Control mode for UART peripheral.
[in] | UARTx | Pointer to the target UART |
[in] | Mode | Data Control Mode
|
[in] | NewState | Next State of Functional Operation
|
Definition at line 350 of file A31G12x_hal_uartn.c.
References ENABLE, HAL_ERROR, HAL_OK, UARTn_DATA_CONTROL_LOOPBACK, UARTn_DATA_CONTROL_RTXINV, UARTn_DATA_CONTROL_RXINV, and UARTn_DATA_CONTROL_TXINV.
HAL_Status_Type HAL_UART_DeInit | ( | UARTn_Type * | UARTx | ) |
Deinitialize the UARTn peripheral registers to their default reset values.
[in] | UARTx | Pointer to the target UART
|
Definition at line 225 of file A31G12x_hal_uartn.c.
References HAL_ERROR, HAL_OK, HAL_SCU_Peripheral_EnableClock2(), and HAL_SCU_Peripheral_SetReset2().
HAL_Status_Type HAL_UART_ForceBreak | ( | UARTn_Type * | UARTx | ) |
Force BREAK character on UART line, output pin UARTn TXD is forced to logic 0.
[in] | UARTx | Pointer to the target UART
|
Definition at line 422 of file A31G12x_hal_uartn.c.
uint8_t HAL_UART_GetLineStatus | ( | UARTn_Type * | UARTx | ) |
This function returns the current value of Line Status Register.
[in] | UARTx | Pointer to the target UART
|
Definition at line 449 of file A31G12x_hal_uartn.c.
HAL_Status_Type HAL_UART_IFDelayConfig | ( | UARTn_Type * | UARTx, |
uint8_t | waitval | ||
) |
Configure inter-frame delay time for UART peripheral.
[in] | UARTx | Pointer to the target UART |
[in] | waitval | inter-frame delay time: 1 bit time unit (0~7) |
Definition at line 398 of file A31G12x_hal_uartn.c.
HAL_Status_Type HAL_UART_Init | ( | UARTn_Type * | UARTx, |
UARTn_CFG_Type * | UARTn_Config | ||
) |
Initialize the UARTn peripheral with the specified parameters.
[in] | UARTx | Pointer to the target UART
|
[in] | UARTn_Config | Pointer to a UARTn_CFG_Type structure that contains the configuration information for the specified peripheral. |
Definition at line 103 of file A31G12x_hal_uartn.c.
References UARTn_CFG_Type::Baudrate, UARTn_CFG_Type::Databits, HAL_ERROR, HAL_OK, HAL_SCU_Peripheral_EnableClock2(), UARTn_CFG_Type::Parity, UARTn_CFG_Type::Stopbits, uart_set_divisors(), UARTn_BaseClock, UARTn_DATA_BIT_5, UARTn_DATA_BIT_6, UARTn_DATA_BIT_7, UARTn_DATA_BIT_8, UARTn_PARITY_BIT_EVEN, UARTn_PARITY_BIT_NONE, UARTn_PARITY_BIT_ODD, UARTn_PARITY_BIT_SP_0, UARTn_PARITY_BIT_SP_1, UARTn_STOP_BIT_1, and UARTn_STOP_BIT_2.
Referenced by debug_frmwrk_init().
uint32_t HAL_UART_Receive | ( | UARTn_Type * | UARTx, |
uint8_t * | rxbuf, | ||
uint32_t | buflen, | ||
TRANSFER_BLOCK_Type | flag | ||
) |
Receive a block of data via UART peripheral.
[in] | UARTx | Pointer to the target UART
|
[out] | rxbuf | Pointer to Received buffer |
[in] | buflen | Length of Received buffer |
[in] | flag | Flag mode
|
Definition at line 608 of file A31G12x_hal_uartn.c.
References BLOCKING, and HAL_UART_ReceiveByte().
Referenced by UARTGetChar().
uint8_t HAL_UART_ReceiveByte | ( | UARTn_Type * | UARTx | ) |
Receive a single data from UART peripheral.
[in] | UARTx | Pointer to the target UART
|
Definition at line 502 of file A31G12x_hal_uartn.c.
Referenced by HAL_UART_Receive(), and UARTGetCh().
uint32_t HAL_UART_Transmit | ( | UARTn_Type * | UARTx, |
uint8_t * | txbuf, | ||
uint32_t | buflen, | ||
TRANSFER_BLOCK_Type | flag | ||
) |
Send a block of data via UART peripheral.
[in] | UARTx | Pointer to the target UART
|
[in] | txbuf | Pointer to Transmit buffer |
[in] | buflen | Length of Transmit buffer |
[in] | flag | Flag used in UART transfer
|
Definition at line 524 of file A31G12x_hal_uartn.c.
References BLOCKING, and HAL_UART_TransmitByte().
Referenced by UARTPutChar().
HAL_Status_Type HAL_UART_TransmitByte | ( | UARTn_Type * | UARTx, |
uint8_t | Data | ||
) |
Transmit a single data through UART peripheral.
[in] | UARTx | Pointer to the target UART
|
[in] | Data | Data to transmit (must be 8-bit long) |
Definition at line 482 of file A31G12x_hal_uartn.c.
References HAL_ERROR, and HAL_OK.
Referenced by fputc(), and HAL_UART_Transmit().
int InCount |
Definition at line 51 of file A31G12x_hal_uartn.c.
Referenced by getstring().
char InData[80] |
Definition at line 49 of file A31G12x_hal_uartn.c.
Referenced by getstring().
int InFlag |
Definition at line 50 of file A31G12x_hal_uartn.c.
Referenced by getstring().