Astra MCU SDK Peripheral Driver Library
 
Loading...
Searching...
No Matches

High Level functions for UART. More...

Functions

uart_status_en uart_put_non_blocking (uart_instance_en id, uart_put_config_t *put_config)
 
uart_status_en uart_get_non_blocking (uart_instance_en id, uart_get_config_t *xfer, uint32_t *received_chars)
 
uart_status_en uart_abort_put (uart_instance_en id)
 
uart_status_en uart_abort_get (uart_instance_en id)
 
uint32_t uart_get_num_transmitted (uart_instance_en id)
 
uint32_t uart_get_num_received (uart_instance_en id)
 
uart_put_status_en uart_get_put_status (uart_instance_en id)
 
uart_get_status_en uart_get_get_status (uart_instance_en id)
 

Detailed Description

High Level functions for UART.

Function Documentation

◆ uart_put_non_blocking()

uart_status_en uart_put_non_blocking ( uart_instance_en id,
uart_put_config_t * put_config )

Initiates a non-blocking transmit operation over UART for the specified instance. Data is written to the UART transmit FIFO and the function returns immediately. If there is more data to write the interrupt is configured to write the remainder. Completion is handled via callback.

Parameters
idUART Instance ID.
put_configPointer to the transmit configuration structure.
Returns
uart_status_en Status code indicating success or the reason for failure.

◆ uart_get_non_blocking()

uart_status_en uart_get_non_blocking ( uart_instance_en id,
uart_get_config_t * xfer,
uint32_t * received_chars )

Initiates a non-blocking receive operation over UART for the specified instance. Attempts to read data from the UART receive FIFO into the provided buffer and returns immediately with the number of bytes received so far. If there is still data to receive the interrupt is configured to read the remainder. Completion is handled via callback.

Parameters
idUART Instance ID.
xferPointer to the receive configuration structure.
received_charsPointer to a variable that stores the number of bytes already available in the RX FIFO
Returns
uart_status_en Status code indicating success or the reason for failure.

◆ uart_abort_put()

uart_status_en uart_abort_put ( uart_instance_en id)

Aborts any ongoing UART transmit (put) operation for the specified instance, releasing the transmitter and resetting the transmit state to idle.

Parameters
idUART Instance ID.
Returns
uart_status_en Status code indicating success or the reason for failure.

◆ uart_abort_get()

uart_status_en uart_abort_get ( uart_instance_en id)

Aborts any ongoing UART receive (get) operation for the specified instance, releasing the receiver and resetting the receive state to idle. The RX FIFO will be retained.

Parameters
idUART Instance ID.
Returns
uart_status_en Status code indicating success or the reason for failure.

◆ uart_get_num_transmitted()

uint32_t uart_get_num_transmitted ( uart_instance_en id)

Returns number of characters that have been shifted out since last call to uart_put_non_blocking for the specified instance.

Parameters
idUART Instance ID.
Returns
Number of bytes transmitted.

◆ uart_get_num_received()

uint32_t uart_get_num_received ( uart_instance_en id)

Returns number of characters that have been written into user buffer since last call to uart_get_non_blocking for the specified instance.

Parameters
idUART Instance ID.
Returns
Number of bytes received.

◆ uart_get_put_status()

uart_put_status_en uart_get_put_status ( uart_instance_en id)

Returns the current transmit status of the UART for the specified instance.

Parameters
idUART Instance ID.
Returns
uart_put_status_en - Transmit status:
  • TX_IN_PROGRESS
  • TX_COMPLETE
  • TX_ERROR

◆ uart_get_get_status()

uart_get_status_en uart_get_get_status ( uart_instance_en id)

Returns the current receive status of the UART for the specified instance.

Parameters
idUART Instance ID.
Returns
uart_get_status_en - Receive status:
  • RX_IN_PROGRESS
  • RX_COMPLETE
  • RX_ERROR