30 #include <adi_processor.h> 31 #include <adi_uart_config.h> 32 #include <rtos_map/adi_rtos_map.h> 33 #include <drivers/dma/adi_dma.h> 34 #include <drivers/pwr/adi_pwr.h> 45 #define ADI_UART_UNIDIR_MEMORY_SIZE (48u + (72u + ADI_SEM_SIZE)) 50 #define ADI_UART_BIDIR_MEMORY_SIZE (48u + (72u + ADI_SEM_SIZE)*2u) 309 uint32_t
const nDeviceNum,
312 uint32_t
const nMemSize,
332 uint32_t
const nBufSize,
339 uint32_t
const nBufSize,
345 void **
const ppBuffer,
351 void **
const ppBuffer,
356 bool *
const pbAvailable
361 bool *
const pbAvailable
371 uint32_t
const nBufSize,
379 uint32_t
const nBufSize,
402 bool const bAutobaudCallbackMode
417 uint32_t *pnBaudRate,
418 uint32_t *pAutobaudError
435 uint16_t
const nDivC,
437 uint16_t
const nDivN,
440 #if defined(ADI_UART_DMA_EXTENSION_ENABLE) && (ADI_UART_DMA_EXTENSION_ENABLE == 1) 475 bool *
const pbComplete
484 const ADI_CALLBACK pfCallback,
ADI_UART_RESULT adi_uart_SetTxDmaMode(ADI_UART_HANDLE const hDevice, ADI_DMA_MODE const eMode)
Set the DMA Mode of the UART Tx Channel.
ADI_UART_RESULT adi_uart_Close(ADI_UART_HANDLE const hDevice)
Uninitialize the memory for the specified UART instance.
ADI_UART_RESULT adi_uart_SetConfiguration(ADI_UART_HANDLE const hDevice, ADI_UART_PARITY const eParity, ADI_UART_STOPBITS const eStopBits, ADI_UART_WORDLEN const eWordLength)
Configuration of UART data.
struct ADI_UART_RX_BUFFER_INFO ADI_UART_RX_BUFFER_INFO
ADI_UART_RESULT adi_uart_IsRxBufferAvailable(ADI_UART_HANDLE const hDevice, bool *const pbAvailable)
Peek function to know if a filled buffer is available.
ADI_UART_RESULT adi_uart_SetRxFifoTriggerLevel(ADI_UART_HANDLE const hDevice, ADI_UART_TRIG_LEVEL const eTriglevel)
Sets the RX FIFO trigger level. This will be the amount of data in the FIFO that will trigger an inte...
ADI_UART_RESULT adi_uart_GetRxBuffer(ADI_UART_HANDLE const hDevice, void **const ppBuffer, uint32_t *pHwError)
Transfer buffer ownership from the device back to the API if the data receive has completed....
ADI_UART_RESULT adi_uart_FlushTxFifo(ADI_UART_CONST_HANDLE const hDevice)
To flush the TX FIFO.
ADI_UART_RESULT adi_uart_SubmitTxBuffer(ADI_UART_HANDLE const hDevice, void *const pBuffer, uint32_t const nBufSize, bool const bDMA)
Submit a "filled" buffer for transmitting data in ADI_UART_DATA_TRANSFER_MODE_NONBLOCKING....
ADI_UART_RESULT adi_uart_RegisterCallback(ADI_UART_HANDLE const hDevice, const ADI_CALLBACK pfCallback, void *const pCBParam)
Registering a callback function.
ADI_UART_RESULT adi_uart_FlushRxChannel(ADI_UART_CONST_HANDLE const hDevice)
Flush the Rx channel and disable interrupts. This will stop any buffers in flight and clear out any d...
ADI_UART_RESULT adi_uart_FlushTxChannel(ADI_UART_CONST_HANDLE const hDevice)
Flush the Tx channel and disable interrupts.This will stop any buffers in flight and clear out any da...
ADI_UART_RESULT adi_uart_SetRxDmaMode(ADI_UART_HANDLE const hDevice, ADI_DMA_MODE const eMode)
Set the DMA Mode of the UART Rx Channel.
ADI_UART_RESULT adi_uart_EnableFifo(ADI_UART_HANDLE const hDevice, bool const bEnable)
Enables internal FIFO as to work in 16550 mode. This helps to minimize system overhead and maximize s...
ADI_UART_RESULT adi_uart_GetTxBuffer(ADI_UART_HANDLE const hDevice, void **const ppBuffer, uint32_t *pHwError)
Transfer buffer ownership from the device back to the API if the data transmit has completed....
ADI_UART_RESULT adi_uart_SubmitRxBuffer(ADI_UART_HANDLE const hDevice, void *const pBuffer, uint32_t const nBufSize, bool const bDMA)
Submit an empty buffer for receiving the data in ADI_UART_DATA_TRANSFER_MODE_NONBLOCKING....
ADI_UART_RESULT adi_uart_Write(ADI_UART_HANDLE const hDevice, void *const pBuffer, uint32_t const nBufSize, bool const bDMA, uint32_t *pHwError)
Submit the buffer for transmitting the data in ADI_UART_DATA_TRANSFER_MODE_BLOCKING....
ADI_UART_RESULT adi_uart_FlushRxFifo(ADI_UART_CONST_HANDLE const hDevice)
Flush the RX FIFO.
ADI_UART_RESULT adi_uart_ForceTxBreak(ADI_UART_HANDLE const hDevice, bool const bEnable)
Forces the UART to send out a break signal.
ADI_UART_RESULT adi_uart_Read(ADI_UART_HANDLE const hDevice, void *const pBuffer, uint32_t const nBufSize, bool const bDMA, uint32_t *pHwError)
Submit the buffer for reading the data in ADI_UART_DATA_TRANSFER_MODE_BLOCKING. Call to this function...
ADI_UART_RESULT adi_uart_EnableLoopBack(ADI_UART_HANDLE const hDevice, bool const bEnable)
Enable/Disable the loopback for the specified UART device.
ADI_UART_RESULT adi_uart_IsTxBufferAvailable(ADI_UART_HANDLE const hDevice, bool *const pbAvailable)
Peek function to know if an empty buffer is avilable.
struct _ADI_UART_DEVICE * ADI_UART_HANDLE
ADI_UART_RESULT adi_uart_Open(uint32_t const nDeviceNum, ADI_UART_DIRECTION const eDirection, void *pMemory, uint32_t const nMemSize, ADI_UART_HANDLE *const phDevice)
Initialization function for the UART device.
ADI_UART_RESULT adi_uart_GetRX(ADI_UART_HANDLE const hDevice, uint8_t *const pRX)
Read the UART receive buffer register regardless of an error. This mode of reading a byte is done wit...
const struct _ADI_UART_DEVICE * ADI_UART_CONST_HANDLE
ADI_UART_RESULT adi_uart_IsTxComplete(ADI_UART_HANDLE const hDevice, bool *const pbComplete)
Function to let the API know if all the data had been drained from the Tx shift registers.
ADI_UART_RESULT adi_uart_ConfigBaudRate(ADI_UART_HANDLE const hDevice, uint16_t const nDivC, uint8_t const nDivM, uint16_t const nDivN, uint8_t const nOSR)
Set baudrate by configuring the fractional dividors.
ADI_UART_RESULT adi_uart_EnableAutobaud(ADI_UART_HANDLE const hDevice, bool const bEnable, bool const bAutobaudCallbackMode)
Enable/Disable UART autobaud detection as well as configures the device for autobaud detection.
ADI_UART_RESULT adi_uart_GetBaudRate(ADI_UART_HANDLE const hDevice, uint32_t *pnBaudRate, uint32_t *pAutobaudError)
Get the baudrate of the UART device instance. This is used in the scenario when a callback has not be...