Contains all functions support for usart1n firmware library on A31R71x. More...
Go to the source code of this file.
Functions | |
static void | usart_set_divisors (USART1n_Type *USART1x, uint32_t mode, uint32_t baudrate) |
Determines best dividers to get a target clock rate. More... | |
HAL_Status_Type | HAL_USART_Init (USART1n_Type *USART1x, USART1n_CFG_Type *USART1n_Config) |
Initialize the USART1n peripheral with the specified parameters. More... | |
HAL_Status_Type | HAL_USART_DeInit (USART1n_Type *USART1x) |
Deinitialize the USART1n peripheral registers to their default reset values. More... | |
HAL_Status_Type | HAL_USART_UART_Mode_Config (USART1n_CFG_Type *USART1n_Config) |
Fills each USART1n_Config member with its default value: More... | |
HAL_Status_Type | HAL_USART_USRT_Mode_Config (USART1n_CFG_Type *USART1n_Config) |
Fills each USART1n_Config member with its default value: More... | |
HAL_Status_Type | HAL_USART_SPI_Mode_Config (USART1n_CFG_Type *USART1n_Config) |
Fills each USART1n_Config member with its default value: More... | |
HAL_Status_Type | HAL_USART_ConfigInterrupt (USART1n_Type *USART1x, USART1n_INT_Type USART1n_IntCfg, FunctionalState NewState) |
Configure the interrupt source of selected USART1n peripheral. More... | |
HAL_Status_Type | HAL_USART_DataControlConfig (USART1n_Type *USART1x, USART1n_CONTROL_Type Mode, FunctionalState NewState) |
Configure Data Control mode for USART peripheral. More... | |
HAL_Status_Type | HAL_USART_Enable (USART1n_Type *USART1x, FunctionalState state) |
USART1n enable control. More... | |
HAL_Status_Type | HAL_USART_ClearStatus (USART1n_Type *USART1x, USART1n_STATUS_Type Status) |
Clear Status register in USART peripheral. More... | |
uint8_t | HAL_USART_GetStatus (USART1n_Type *USART1x) |
Get current value of Line Status register in USART peripheral. More... | |
FlagStatus | HAL_USART_CheckBusy (USART1n_Type *USART1x) |
Check whether if USART is busy or not. More... | |
HAL_Status_Type | HAL_USART_TransmitByte (USART1n_Type *USART1x, uint8_t Data) |
Transmit a single data through USART peripheral. More... | |
uint8_t | HAL_USART_ReceiveByte (USART1n_Type *USART1x) |
Receive a single data from USART peripheral. More... | |
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. More... | |
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. More... | |
Variables | |
uint32_t | USART1n_BaseClock |
Contains all functions support for usart1n firmware library on A31R71x.
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 A31R71x_hal_usart1n.c.
FlagStatus HAL_USART_CheckBusy | ( | USART1n_Type * | USART1x | ) |
Check whether if USART is busy or not.
[in] | USART1x | Pointer to the target USART1
|
Definition at line 592 of file A31R71x_hal_usart1n.c.
HAL_Status_Type HAL_USART_ClearStatus | ( | USART1n_Type * | USART1x, |
USART1n_STATUS_Type | Status | ||
) |
Clear Status register in USART peripheral.
[in] | USART1x | Pointer to the target USART1
|
[in] | Status |
Definition at line 540 of file A31R71x_hal_usart1n.c.
References HAL_ERROR, HAL_OK, USART1n_STATUS_DRE, USART1n_STATUS_RXC, USART1n_STATUS_TXC, and USART1n_STATUS_WAKE.
Referenced by HAL_USART_Init(), and HAL_USART_Transmit().
HAL_Status_Type HAL_USART_ConfigInterrupt | ( | USART1n_Type * | USART1x, |
USART1n_INT_Type | USART1n_IntCfg, | ||
FunctionalState | NewState | ||
) |
Configure the interrupt source of selected USART1n peripheral.
[in] | USART1x | Pointer to the target USART1
|
[in] | USART1n_IntCfg | Specifies the interrupt source
|
[in] | NewState | Next State of Interrupt Operation
|
Definition at line 385 of file A31R71x_hal_usart1n.c.
References ENABLE, HAL_ERROR, HAL_OK, USART1n_INTCFG_DR, USART1n_INTCFG_RXC, USART1n_INTCFG_TXC, and USART1n_INTCFG_WAKE.
HAL_Status_Type HAL_USART_DataControlConfig | ( | USART1n_Type * | USART1x, |
USART1n_CONTROL_Type | Mode, | ||
FunctionalState | NewState | ||
) |
Configure Data Control mode for USART peripheral.
[in] | USART1x | Pointer to the target USART1
|
[in] | Mode | Data Control Mode
|
[in] | NewState | Next State of Functional Operation
|
Definition at line 445 of file A31R71x_hal_usart1n.c.
References ENABLE, HAL_ERROR, HAL_OK, USART1n_CONTROL_DBLS, USART1n_CONTROL_DISSCK, USART1n_CONTROL_FXCH, USART1n_CONTROL_LOOPS, USART1n_CONTROL_MASTER, USART1n_CONTROL_USTEN, USART1n_CONTROL_USTRX8, USART1n_CONTROL_USTSB, USART1n_CONTROL_USTSSEN, and USART1n_CONTROL_USTTX8.
HAL_Status_Type HAL_USART_DeInit | ( | USART1n_Type * | USART1x | ) |
Deinitialize the USART1n peripheral registers to their default reset values.
[in] | USART1x | Pointer to the target USART1
|
Definition at line 195 of file A31R71x_hal_usart1n.c.
References HAL_ERROR, HAL_OK, HAL_SCU_Peripheral_EnableClock2(), and HAL_SCU_Peripheral_SetReset2().
HAL_Status_Type HAL_USART_Enable | ( | USART1n_Type * | USART1x, |
FunctionalState | state | ||
) |
USART1n enable control.
[in] | USART1x | Pointer to the target USART1
|
[in] | state |
|
Definition at line 512 of file A31R71x_hal_usart1n.c.
uint8_t HAL_USART_GetStatus | ( | USART1n_Type * | USART1x | ) |
Get current value of Line Status register in USART peripheral.
[in] | USART1x | Pointer to the target USART1
|
Definition at line 580 of file A31R71x_hal_usart1n.c.
HAL_Status_Type HAL_USART_Init | ( | USART1n_Type * | USART1x, |
USART1n_CFG_Type * | USART1n_Config | ||
) |
Initialize the USART1n peripheral with the specified parameters.
[in] | USART1x | Pointer to the target USART1
|
[in] | USART1n_Config | Pointer to a USART1n_CFG_Type structure that contains the configuration information for the specified peripheral. |
Definition at line 110 of file A31R71x_hal_usart1n.c.
References USART1n_CFG_Type::ACK, USART1n_CFG_Type::Baudrate, USART1n_CFG_Type::Databits, USART1n_CFG_Type::Edge, HAL_ERROR, HAL_OK, HAL_SCU_Peripheral_EnableClock2(), HAL_SCU_Peripheral_SetReset2(), HAL_USART_ClearStatus(), HAL_USART_ReceiveByte(), USART1n_CFG_Type::Mode, USART1n_CFG_Type::Order, USART1n_CFG_Type::Parity, USART1n_CFG_Type::Stopbits, USART1n_BaseClock, USART1n_STATUS_TXC, and usart_set_divisors().
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.
[in] | USART1x | Pointer to the target USART1
|
[out] | rxbuf | Pointer to Received buffer |
[in] | buflen | Length of Received buffer |
[in] | flag | Flag mode
|
Definition at line 739 of file A31R71x_hal_usart1n.c.
References BLOCKING, and HAL_USART_ReceiveByte().
uint8_t HAL_USART_ReceiveByte | ( | USART1n_Type * | USART1x | ) |
Receive a single data from USART peripheral.
[in] | USART1x | Pointer to the target USART1
|
Definition at line 633 of file A31R71x_hal_usart1n.c.
Referenced by HAL_USART_Init(), and HAL_USART_Receive().
HAL_Status_Type HAL_USART_SPI_Mode_Config | ( | USART1n_CFG_Type * | USART1n_Config | ) |
Fills each USART1n_Config member with its default value:
[out] | USART1n_Config | Pointer to a USART1n_CFG_Type structure which will be initialized. |
Definition at line 329 of file A31R71x_hal_usart1n.c.
References USART1n_CFG_Type::ACK, USART1n_CFG_Type::Baudrate, USART1n_CFG_Type::Databits, USART1n_CFG_Type::Edge, HAL_ERROR, HAL_OK, USART1n_CFG_Type::Mode, USART1n_CFG_Type::Order, USART1n_CFG_Type::Parity, USART1n_CFG_Type::Stopbits, USART1n_DATA_BIT_8, USART1n_PARITY_BIT_NONE, USART1n_SPI_LSB, USART1n_SPI_MODE, USART1n_SPI_TX_FALLING, USART1n_SPI_TX_LEADEDGE_SAMPLE, USART1n_SPI_TX_LEADEDGE_SETUP, USART1n_SPI_TX_RISING, and USART1n_STOP_BIT_1.
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.
[in] | USART1x | Pointer to the target USART1
|
[in] | txbuf | Pointer to Transmit buffer |
[in] | buflen | Length of Transmit buffer |
[in] | flag | Flag used in USART transfer
|
Definition at line 655 of file A31R71x_hal_usart1n.c.
References BLOCKING, HAL_USART_ClearStatus(), HAL_USART_TransmitByte(), and USART1n_STATUS_TXC.
HAL_Status_Type HAL_USART_TransmitByte | ( | USART1n_Type * | USART1x, |
uint8_t | Data | ||
) |
Transmit a single data through USART peripheral.
[in] | USART1x | Pointer to the target USART1
|
[in] | Data | Data to transmit (must be 8-bit long) |
Definition at line 613 of file A31R71x_hal_usart1n.c.
References HAL_ERROR, and HAL_OK.
Referenced by HAL_USART_Transmit().
HAL_Status_Type HAL_USART_UART_Mode_Config | ( | USART1n_CFG_Type * | USART1n_Config | ) |
Fills each USART1n_Config member with its default value:
[out] | USART1n_Config | Pointer to a USART1n_CFG_Type structure which will be initialized. |
Definition at line 252 of file A31R71x_hal_usart1n.c.
References USART1n_CFG_Type::Baudrate, USART1n_CFG_Type::Databits, HAL_ERROR, HAL_OK, USART1n_CFG_Type::Mode, USART1n_CFG_Type::Parity, USART1n_CFG_Type::Stopbits, USART1n_DATA_BIT_8, USART1n_PARITY_BIT_NONE, USART1n_STOP_BIT_1, and USART1n_UART_MODE.
HAL_Status_Type HAL_USART_USRT_Mode_Config | ( | USART1n_CFG_Type * | USART1n_Config | ) |
Fills each USART1n_Config member with its default value:
[out] | USART1n_Config | Pointer to a USART1n_CFG_Type structure which will be initialized. |
Definition at line 279 of file A31R71x_hal_usart1n.c.
References USART1n_CFG_Type::ACK, USART1n_CFG_Type::Baudrate, USART1n_CFG_Type::Databits, USART1n_CFG_Type::Edge, HAL_ERROR, HAL_OK, USART1n_CFG_Type::Mode, USART1n_CFG_Type::Order, USART1n_CFG_Type::Parity, USART1n_CFG_Type::Stopbits, USART1n_DATA_BIT_8, USART1n_PARITY_BIT_NONE, USART1n_SPI_LSB, USART1n_SPI_TX_FALLING, USART1n_SPI_TX_LEADEDGE_SAMPLE, USART1n_SPI_TX_LEADEDGE_SETUP, USART1n_SPI_TX_RISING, USART1n_STOP_BIT_1, and USART1n_USRT_MODE.
|
static |
Determines best dividers to get a target clock rate.
[in] | USART1x | Pointer to the target USART1
|
[in] | mode |
|
[in] | baudrate | Desired baudrate |
Definition at line 67 of file A31R71x_hal_usart1n.c.
References USART1n_BaseClock, and USART1n_UART_MODE.
Referenced by HAL_USART_Init().
uint32_t USART1n_BaseClock |
Definition at line 47 of file A31R71x_hal_usart1n.c.
Referenced by HAL_USART_Init(), and usart_set_divisors().