#include <compiler.h>
#include <sdrv_common.h>
#include <sdrv_dma.h>
#include <types.h>
Go to the source code of this file.
|
| sdrv_uart_error_status_e | sdrv_uart_controller_init (sdrv_uart_t *ctrl, const sdrv_uart_config_t *cfg, uart_callback_t callback, void *userData) |
| |
| sdrv_uart_error_status_e | sdrv_uart_deinit (sdrv_uart_t *ctrl) |
| |
| sdrv_uart_error_status_e | sdrv_uart_set_baudrate (sdrv_uart_t *ctrl, uint32_t baud) |
| |
| sdrv_uart_error_status_e | sdrv_uart_abr_start (sdrv_uart_t *ctrl, sdrv_abr_max_e num) |
| |
| uint32_t | sdrv_uart_get_rxfifodata (sdrv_uart_t *ctrl, uint8_t *data, uint32_t maxlen) |
| |
| sdrv_uart_error_status_e | sdrv_uart_start_realtime_receive (sdrv_uart_t *ctrl) |
| |
| sdrv_uart_error_status_e | sdrv_uart_stop_realtime_receive (sdrv_uart_t *ctrl) |
| |
| sdrv_uart_error_status_e | sdrv_uart_sync_receive (sdrv_uart_t *ctrl, uint8_t *data, uint32_t size, uint32_t *received_bytes, uint32_t times) |
| |
| bool | sdrv_uart_txfifo_empty (sdrv_uart_t *ctrl) |
| |
| sdrv_uart_error_status_e | sdrv_uart_sync_transmit (sdrv_uart_t *ctrl, const uint8_t *data, uint32_t size, uint32_t *transmitted_bytes, uint32_t times) |
| |
| sdrv_uart_error_status_e | sdrv_uart_async_receive (sdrv_uart_t *ctrl, uint8_t *data, uint32_t size, uart_callback_t rx_cb, void *rx_userparam) |
| |
| sdrv_uart_error_status_e | sdrv_uart_async_receive_abort (sdrv_uart_t *ctrl) |
| |
| sdrv_uart_error_status_e | sdrv_uart_async_transmit (sdrv_uart_t *ctrl, const uint8_t *data, uint32_t size, uart_callback_t tx_cb, void *tx_userparam) |
| |
| sdrv_uart_error_status_e | sdrv_uart_async_transmit_abort (sdrv_uart_t *ctrl) |
| |
| sdrv_uart_error_status_e | sdrv_uart_dma_receive (sdrv_uart_t *ctrl, uint8_t *data, uint32_t size, uart_callback_t rx_cb, void *rx_userparam, sdrv_dma_t *dma_ctrl, sdrv_dma_channel_t *dma_channel, sdrv_dma_channel_id_e channel_id) |
| |
| sdrv_uart_error_status_e | sdrv_uart_dma_receive_abort (sdrv_uart_t *ctrl) |
| |
| sdrv_uart_error_status_e | sdrv_uart_dma_transmit (sdrv_uart_t *ctrl, const uint8_t *data, uint32_t size, uart_callback_t tx_cb, void *tx_userparam, sdrv_dma_t *dma_ctrl, sdrv_dma_channel_t *dma_channel, sdrv_dma_channel_id_e channel_id) |
| |
| sdrv_uart_error_status_e | sdrv_uart_dma_transmit_abort (sdrv_uart_t *ctrl) |
| |
| sdrv_uart_error_status_e | sdrv_uart_dma_receive_start (sdrv_uart_t *ctrl, uint8_t *data, uint32_t size, uart_callback_t rx_cb, void *rx_userparam, sdrv_dma_t *dma_ctrl, sdrv_dma_channel_t *dma_channel, sdrv_dma_channel_id_e channel_id) |
| |
| uint32_t | sdrv_uart_dma_bytes_received (sdrv_uart_t *ctrl) |
| |
| sdrv_uart_error_status_e | sdrv_uart_intr_ctrl (sdrv_uart_t *ctrl, uint32_t mask, bool value) |
| |
| uint32_t | sdrv_uart_intr_get (sdrv_uart_t *ctrl) |
| |
| uint32_t | sdrv_uart_intr_status_get (sdrv_uart_t *ctrl) |
| |
| sdrv_uart_error_status_e | sdrv_uart_intr_status_clear (sdrv_uart_t *ctrl, uint32_t mask) |
| |
| int | sdrv_uart_irq_handler (uint32_t irq, void *ctrl) |
| |
- Copyright
- Copyright (c) 2022 Semidrive Semiconductor. All rights reserved.
◆ DMA_BURST16_MAD_SIZE_MAX
| #define DMA_BURST16_MAD_SIZE_MAX (4000U * 16U) |
◆ DMA_BURST1_MAD_SIZE_MAX
| #define DMA_BURST1_MAD_SIZE_MAX (4000U * 1U) |
◆ NUM_LINKLIST_ITEMS
| #define NUM_LINKLIST_ITEMS 8 |
◆ SDRV_UART_ABR_PATTERN_CHAR
| #define SDRV_UART_ABR_PATTERN_CHAR 0x55U |
◆ SDRV_UART_INTR_ABR
◆ SDRV_UART_INTR_ABRFAIL
| #define SDRV_UART_INTR_ABRFAIL (1U << 19) |
Auto baudrate detect error interrupt bitmask.
◆ SDRV_UART_INTR_ABRPASS
| #define SDRV_UART_INTR_ABRPASS (1U << 18) |
Auto baudrate detect pass interrupt bitmask.
◆ SDRV_UART_INTR_BAUDRATEERR
| #define SDRV_UART_INTR_BAUDRATEERR (1U << 10) |
Baudrate error interrupt bitmask.
◆ SDRV_UART_INTR_FRAMEERR
| #define SDRV_UART_INTR_FRAMEERR (1U << 9) |
Frame error interrupt \ bitmask.
◆ SDRV_UART_INTR_NOISERERR
| #define SDRV_UART_INTR_NOISERERR (1U << 11) |
Noise error interrupt bitmask.
◆ SDRV_UART_INTR_PARITYERR
| #define SDRV_UART_INTR_PARITYERR (1U << 8) |
Parity error interrupt bitmask.
◆ SDRV_UART_INTR_RX_ERROR
| #define SDRV_UART_INTR_RX_ERROR |
Value:
#define SDRV_UART_INTR_NOISERERR
Definition: sdrv_uart.h:65
#define SDRV_UART_INTR_RX_FUDF
Definition: sdrv_uart.h:52
#define SDRV_UART_INTR_RX_FOVF
Definition: sdrv_uart.h:56
#define SDRV_UART_INTR_FRAMEERR
Definition: sdrv_uart.h:60
◆ SDRV_UART_INTR_RX_FOVF
| #define SDRV_UART_INTR_RX_FOVF (1U << 5) |
RX fifo overflow interrupt bitmask.
◆ SDRV_UART_INTR_RX_FUDF
| #define SDRV_UART_INTR_RX_FUDF (1U << 3) |
RX fifo underflow interrupt bitmask.
◆ SDRV_UART_INTR_RX_FWF
| #define SDRV_UART_INTR_RX_FWF (1U << 1) |
RX fifo waterlevel interrupt bitmask.
◆ SDRV_UART_INTR_RXBREAK
| #define SDRV_UART_INTR_RXBREAK (1U << 13) |
RX break detect interrupt bitmask.
◆ SDRV_UART_INTR_RXIDLE
| #define SDRV_UART_INTR_RXIDLE (1U << 14) |
RX idle detect interrupt bitmask.
◆ SDRV_UART_INTR_TX_COMPLETED
| #define SDRV_UART_INTR_TX_COMPLETED (1U << 17) |
TX completed interrupt bitmask.
◆ SDRV_UART_INTR_TX_ERROR
◆ SDRV_UART_INTR_TX_FOVF
| #define SDRV_UART_INTR_TX_FOVF (1U << 4) |
TX fifo overflow interrupt bitmask.
◆ SDRV_UART_INTR_TX_FWE
| #define SDRV_UART_INTR_TX_FWE 1U |
Uart interrupt bitmask.
TX fifo waterlevel interrupt bitmask.
◆ SDRV_UART_MAX_ABR_NUM
| #define SDRV_UART_MAX_ABR_NUM 8U |
◆ SDRV_UART_OPERATION_TIMEOUT
| #define SDRV_UART_OPERATION_TIMEOUT 0x500000U |
◆ SDRV_UART_RX_FIFO_OFFSET
| #define SDRV_UART_RX_FIFO_OFFSET 0x300U |
◆ SDRV_UART_TX_FIFO_OFFSET
| #define SDRV_UART_TX_FIFO_OFFSET 0x200U |
◆ UART_ABR_PATTERN
| #define UART_ABR_PATTERN 0U |
◆ WaitForever
| #define WaitForever 0xFFFFFFFFU |
◆ sdrv_abr_max_e
Sdrv UART the character count that abr expect to recv and match.
◆ sdrv_rxidle_ctl_e
Sdrv UART the time of high level on rx line to detect idle.
◆ sdrv_uart_callback_status_e
◆ sdrv_uart_config_t
Sdrv UART configurations.
◆ sdrv_uart_dls_e
Number of data bits in one character.
◆ sdrv_uart_error_status_e
UART error status return codes.
◆ sdrv_uart_fcm_config_t
Sdrv UART flow control mode configurations.
◆ sdrv_uart_fcm_e
Sdrv UART flow control mode.
◆ sdrv_uart_op_mode_e
◆ sdrv_uart_parity_e
◆ sdrv_uart_regs_t
◆ sdrv_uart_rs485_fcm_t
Sdrv UART RS485 flow control configurations.
◆ sdrv_uart_stop_e
◆ sdrv_uart_t
◆ sdrv_uart_transfer_mode_e
◆ sdrv_uart_transfer_status_e
◆ sdrv_uart_transfer_type_e
◆ uart_callback_t
UART transfer callback function.
◆ sdrv_abr_max
Sdrv UART the character count that abr expect to recv and match.
| Enumerator |
|---|
| SDRV_ABR_CHAR1 | The count that abr expect to match is 1 byte.
|
| SDRV_ABR_CHAR2 | The count that abr expect to match is 2 bytes.
|
| SDRV_ABR_CHAR4 | The count that abr expect to match is 4 bytes.
|
| SDRV_ABR_CHAR8 | The count that abr expect to match is 8 bytes.
|
| SDRV_ABR_CHAR16 | The count that abr expect to match is 16 bytes.
|
| SDRV_ABR_CHAR32 | The count that abr expect to match is 32 bytes.
|
| SDRV_ABR_CHAR64 | The count that abr expect to match is 64 bytes.
|
| SDRV_ABR_CHAR128 | The count that abr expect to match is 128bytes
|
◆ sdrv_rxidle_ctl
Sdrv UART the time of high level on rx line to detect idle.
| Enumerator |
|---|
| SDRV_IDLE_DETECT_DISABLE | Disable rx idle detect.
|
| SDRV_IDLE_DETECT_16CYCLE | The cycle of high level on rx line to detect idle is 16.
|
| SDRV_IDLE_DETECT_32CYCLE | The cycle of high level on rx line to detect idle is 32.
|
| SDRV_IDLE_DETECT_64CYCLE | The cycle of high level on rx line to detect idle is 64.
|
| SDRV_IDLE_DETECT_128CYCLE | The cycle of high level on rx line to detect idle is 128.
|
| SDRV_IDLE_DETECT_256CYCLE | The cycle of high level on rx line to detect idle is 256.
|
| SDRV_IDLE_DETECT_512CYCLE | The cycle of high level on rx line to detect idle is 512.
|
| SDRV_IDLE_DETECT_1024CYCLE | The cycle of high level on rx line to detect idle is 1024.
|
◆ sdrv_uart_callback_status
UART interrupt handle callback status for user.
| Enumerator |
|---|
| SDRV_UART_NoEvent | Uart no event.
|
| SDRV_UART_TxCompleted | Uart transmit is completed.
|
| SDRV_UART_RxFWF | Uart rx fifo waterlevel full.
|
| SDRV_UART_RxCompleted | Uart receive is completed.
|
| SDRV_UART_TxFifoOverFlow | Uart tx fifo over flow error.
|
| SDRV_UART_RxFifoOverFlow | Uart rx fifo over flow error.
|
| SDRV_UART_RxFifoUnderFlow | Uart rx fifo under flow error.
|
| SDRV_UART_FramingError | Uart framing error.
|
| SDRV_UART_ParityError | Uart parity error.
|
| SDRV_UART_NoiseError | Uart noise error.
|
| SDRV_UART_BaudrateError | Uart baud rate error.
|
| SDRV_UART_AbrPass | Uart auto baudrate detect pass.
|
| SDRV_UART_AbrFail | Uart auto baudrate detect fail.
|
| SDRV_UART_TxDmaDone | Uart transmit with dma completed.
|
| SDRV_UART_TxDmaError | Uart transmit with dma occurs error.
|
| SDRV_UART_RxDmaDone | Uart receive with dma completed.
|
| SDRV_UART_RxDmaError | Uart receive with dma occurs error.
|
| SDRV_UART_RxIdle | Uart rx line idle detected.
|
| SDRV_UART_RxBufferFull | User's rx buffer is full.
|
◆ sdrv_uart_dls
Number of data bits in one character.
| Enumerator |
|---|
| SDRV_UART_CHAR_8_BITS | 8 bits data in one character
|
| SDRV_UART_CHAR_7_BITS | 7 bits data in one character
|
| SDRV_UART_CHAR_6_BITS | 6 bits data in one character
|
| SDRV_UART_CHAR_5_BITS | 5 bits data in one character
|
◆ sdrv_uart_error_status
UART error status return codes.
| Enumerator |
|---|
| Status_Success | status for success
|
| Status_Timeout | status for timeout
|
| Status_Busy | status for busy
|
| Status_Fail | status for common error
|
| Status_Invalid_Param | status for invalid param error
|
| Status_Abr_Not_Ready | Status for abr not ready error.
|
| Status_Rxfovf | Status for rx fifo overflow.
|
| Status_Parity_Err | Status for frame parity error.
|
| Status_Frame_Err | Status for frame error.
|
| Status_Baudrate_Err | Status for baudrate error.
|
| Status_Noise_Err | Status for noise error.
|
| Status_dma_channel_config_Err | Status for dma channel config error.
|
◆ sdrv_uart_fcm
Sdrv UART flow control mode.
| Enumerator |
|---|
| SDRV_UART_NO_FC | Non flow control mode
|
◆ sdrv_uart_op_mode
UART operation mode.
| Enumerator |
|---|
| SDRV_UART_SERIAL_MODE | |
◆ sdrv_uart_parity
UART parity type.
| Enumerator |
|---|
| SDRV_UART_NO_PARITY | No parity bit
|
| SDRV_UART_EVEN_PARITY | Even parity
|
| SDRV_UART_ODD_PARITY | Odd parity
|
◆ sdrv_uart_stop
Number of stop bits.
| Enumerator |
|---|
| SDRV_UART_STOP_1_BIT | 1 bit in one character
|
| SDRV_UART_STOP_1_5_BIT | 1.5 bit in one character
|
| SDRV_UART_STOP_2_BIT | 2 bit in one character
|
| SDRV_UART_STOP_0_5_BIT | 0.5 bit in one character
|
◆ sdrv_uart_transfer_mode
UART transfer mode.
| Enumerator |
|---|
| SDRV_UART_FULL_DUPLEX | |
◆ sdrv_uart_transfer_status
UART transfer status.
| Enumerator |
|---|
| Transfer_TxIdle | TX idle.
|
| Transfer_TxBusy | TX busy.
|
| Transfer_RxIdle | RX idle.
|
| Transfer_RxBusy | RX busy.
|
| Transfer_RxFail | Rx error
|
| Transfer_TxFail | Tx error
|
| Transfer_RxAbrBusy | Auto baudrate detect busy
|
| Transfer_RxAbrReady | Auto baudrate detect ready
|
| Transfer_RxAbrFail | The character number that abr expect to recv and match.
|
◆ sdrv_uart_transfer_type
Sdrv UART transfer mode.
| Enumerator |
|---|
| SDRV_TRANSFER_NO_MODE | Uart do not in any tranfer mode.
|
| SDRV_TRANSFER_SYNC_MODE | Uart is in sync transfer mode.
|
| SDRV_TRANSFER_ASYNC_MODE | Uart is in async transfer mode.
|
| SDRV_TRANSFER_REALTIME_MODE | Uart is in realtime receive mode.
|
| SDRV_TRANSFER_DMA_ASYNC_MODE | Uart is in dma transfer mode, This mode can receive the fixed length data.
|
| SDRV_TRANSFER_DMA_REALTIME_MODE | Uart is in dma transfer mode, This mode can receive the indefinite length data.
|
◆ sdrv_uart_abr_start()
Start auto baudrate detect.
This function start auto baudrate detect.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
| [in] | num | The character number that abr expect to recv and match |
- Returns
- The result of starting abr.
◆ sdrv_uart_async_receive()
Asynchronous UART receive.
This function receive RX data with an interrupt method.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
| [out] | data | receive data |
| [in] | size | the size of receive data |
| [in] | rx_cb | the callback function of receive |
| [in] | rx_userparam | the param of callback function |
- Returns
- the result of uart async receive function
◆ sdrv_uart_async_receive_abort()
Asynchronous UART receive abort.
This function abort the transfer of receive RX data with an interrupt method.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
- Returns
- The result of aborting transmit.
◆ sdrv_uart_async_transmit()
Asynchronous UART transmit.
This function transmit TX data with an interrupt method.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
| [in] | data | transmit data |
| [in] | size | the size of transmit data |
| [in] | tx_cb | the callback function of transmit |
| [in] | tx_userparam | the param of callback function |
- Returns
- the result of uart async transmit function
◆ sdrv_uart_async_transmit_abort()
Asynchronous UART transmit abort.
This function abort the transfer of transmit TX data with an interrupt method.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
- Returns
- The result of aborting transmit.
◆ sdrv_uart_controller_init()
Sdrv UART controller initialization.
This function initializes: 1) The uart module; 2) The uart controller entity.
This function attach irq handler and transfer callback function.
- Parameters
-
| [in] | ctrl | sdrv uart controller. |
| [in] | cfg | sdrv uart configurations. |
| [in] | callback | sdrv uart transfer callback function. |
| [in] | userData | sdrv uart transfer callback function param. |
- Returns
- The result of initilalizing uart module.
◆ sdrv_uart_deinit()
Srdv UART Deinitializes.
This function deinitializes: 1) The uart controller entity 2) The uart module;
This function dettach irq handler and transfer callback function.
- Parameters
-
- Returns
- The result of deinitilalizing uart module.
◆ sdrv_uart_dma_bytes_received()
| uint32_t sdrv_uart_dma_bytes_received |
( |
sdrv_uart_t * |
ctrl | ) |
|
Get the count of data carried by dma.
This function only for the dma mode.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
- Returns
- the count of received byte
◆ sdrv_uart_dma_receive()
UART receive data with dma linklist mode.
This function receive data with dma module. User should initializes dma module before use this function.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
| [out] | data | receive data |
| [in] | size | the size of receive data |
| [in] | rx_cb | the callback function of receive |
| [in] | rx_userparam | the param of callback function |
| [in] | dma_ctrl | sdrv dma controller entity |
| [in] | dma_channel | sdrv dma channel controller entity |
| [in] | channel_id | The number of dma channel |
- Returns
- The result of uart dma receive function Status_Busy : The uart receiver is busy. Status_dma_channel_config_Err : The dma channel config error. Status_Timeout : Reset uart rx dma interface timeout. Status_Success : Starting the uart to receive with dma success.
◆ sdrv_uart_dma_receive_abort()
Abort the process of uart to receive data with dma.
This function stop the dma channel and disable uart rx dma interface and clear tranfer status.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
- Returns
- The result of aborting receive. Status_Success : Abort the transfer success.
◆ sdrv_uart_dma_receive_start()
UART receive data with dma.
This function receive data with dma module. User should initializes dma module before use this function. User data buffer must be __aligned(CONFIG_ARCH_CACHE_LINE). The size of the user's buffer should be larger than the size of the data that excepted received.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
| [out] | data | receive data |
| [in] | size | the max size of data buffer |
| [in] | rx_cb | the callback function of receive |
| [in] | rx_userparam | the param of callback function |
| [in] | dma_ctrl | sdrv dma controller entity |
| [in] | dma_channel | sdrv dma channel controller entity |
| [in] | channel_id | The number of dma channel |
- Returns
- The result of uart dma receive function Status_Busy : The uart receiver is busy. Status_dma_channel_config_Err : The dma channel config error. Status_Timeout : Reset uart rx dma interface timeout. Status_Success : Starting the uart to receive with dma success.
◆ sdrv_uart_dma_transmit()
UART transmit data with dma linklist mode.
This function transmit data with dma module. User should initializes dma module before use this function.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
| [out] | data | transmit data |
| [in] | size | the size of transmit data |
| [in] | tx_cb | the callback function of transmit |
| [in] | tx_userparam | the param of callback function |
| [in] | dma_ctrl | sdrv dma controller entity |
| [in] | dma_channel | sdrv dma channel controller entity |
| [in] | channel_id | The number of dma channel |
- Returns
- The result of uart dma transmit function Status_Busy : The uart transmitter is busy. Status_dma_channel_config_Err : The dma channel config error. Status_Timeout : Reset uart tx dma interface timeout. Status_Success : Starting the uart to transmit with dma success.
◆ sdrv_uart_dma_transmit_abort()
Abort the process of uart to transmit data with dma.
This function stop the dma channel and disable uart tx dma interface and clear transfer status.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
- Returns
- The result of aborting transmit. Status_Timeout : Reset uart tx dma interface or clear tx fifo timeout Status_Success : Abort the transfer success.
◆ sdrv_uart_get_rxfifodata()
| uint32_t sdrv_uart_get_rxfifodata |
( |
sdrv_uart_t * |
ctrl, |
|
|
uint8_t * |
data, |
|
|
uint32_t |
maxlen |
|
) |
| |
Get the data in rx fifo.
This function is used to get data in rx fifo. If user use sdrv_uart_start_realtime_receive function, this function is used in user's callback function to get rx fifo data. Users could call sdrv_uart_get_rxfifodata() to clear fifo.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
| [in] | data | the first address of user data buffer |
| [in] | maxlen | the max length of user's data buffer |
- Returns
- the count of received byte
◆ sdrv_uart_intr_ctrl()
Enable/Disable Sdrv UART Interrupt.
This function enable/disable sdrv uart interrupt with the provided mask.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
| [in] | mask | the interrupts to enable |
| [in] | value | enable or disable |
- Returns
- The result of setting interrupt register.
◆ sdrv_uart_intr_get()
Get Sdrv UART Interrupt enable/disable status.
This function get sdrv uart interrupt enable/disable status with the provided mask.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
- Returns
- Sdrv UART Interrupt enable/disable status
◆ sdrv_uart_intr_status_clear()
Clear Sdrv UART Interrupt flag status.
This function clear Sdrv UART Interrupt flag status with the provided mask.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
| [in] | mask | the interrupts status to clear |
- Returns
- The result of clearing interrupt status.
◆ sdrv_uart_intr_status_get()
| uint32_t sdrv_uart_intr_status_get |
( |
sdrv_uart_t * |
ctrl | ) |
|
Get Sdrv UART Interrupt flag status.
This function get Sdrv UART Interrupt flag status.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
- Returns
- all sdrv UART Interrupt status
◆ sdrv_uart_irq_handler()
| int sdrv_uart_irq_handler |
( |
uint32_t |
irq, |
|
|
void * |
ctrl |
|
) |
| |
Sdrv UART default IRQ handle function.
This function handles the sdrv uart transmit and receive and error IRQ request.
- Parameters
-
| [in] | irq | the irq number of uartx |
| [in] | ctrl | sdrv uart controller |
◆ sdrv_uart_set_baudrate()
Configure uart baud rate.
This function configures the uart module baud rate. This function is used to update the uart module baud rate after the uart module is initialized by the sdrv_uart_controller_init.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
| [in] | baud | baud |
- Returns
- The result of setting baudrate.
◆ sdrv_uart_start_realtime_receive()
Start UART realtime receive.
This function start the feature of continuous receive RX data with a interrupt method.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
- Returns
- the result of starting recv
◆ sdrv_uart_stop_realtime_receive()
Stop UART realtime receive.
This function stop the feature of continuous receive RX data with a interrupt method.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
- Returns
- The result of sopping realtime receive.
◆ sdrv_uart_sync_receive()
Synchronous UART receive.
This function receive RX data with a blocking method.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
| [out] | data | receive data |
| [in] | size | the size of receive data |
| [in] | received_bytes | the size of data has been received |
| [in] | times | the max times of query fifo empty register, recommend to set DefaultTimes. |
- Returns
- the result of transfer
◆ sdrv_uart_sync_transmit()
Synchronous UART transmit.
This function transmit TX data with a blocking method.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
| [in] | data | transmit data |
| [in] | size | the size of transmit data |
| [in] | transmitted_bytes | the size of data has been tansmitted |
| [in] | times | the max times of query fifo empty register, recommend to set 0xFFFFFFFF |
- Returns
- the result of transfer
◆ sdrv_uart_txfifo_empty()
Get empty status of tx fifo.
This function is used to get empty status of tx fifo.
- Parameters
-
| [in] | ctrl | sdrv uart controller |
- Returns
- the empty status of tx fifo