61 #include <adi_processor.h> 62 #include <adi_uart_config.h> 63 #include <rtos_map/adi_rtos_map.h> 64 #include <drivers/dma/adi_dma.h> 65 #include <drivers/pwr/adi_pwr.h> 76 #define ADI_UART_UNIDIR_MEMORY_SIZE (48u + (60u + ADI_SEM_SIZE)) 81 #define ADI_UART_BIDIR_MEMORY_SIZE (48u + (60u + ADI_SEM_SIZE)*2u) 293 ADI_UART_ONE_STOPBIT = 0x00,
308 ADI_UART_DATA_TRANSFER_MODE_NONE,
327 uint32_t
const nDeviceNum,
328 ADI_UART_DIRECTION
const eDirection,
330 uint32_t
const nMemSize,
331 ADI_UART_HANDLE *
const phDevice
335 ADI_UART_HANDLE
const hDevice
348 ADI_UART_HANDLE
const hDevice,
350 uint32_t
const nBufSize,
355 ADI_UART_HANDLE
const hDevice,
357 uint32_t
const nBufSize,
362 ADI_UART_HANDLE
const hDevice,
363 void **
const ppBuffer,
368 ADI_UART_HANDLE
const hDevice,
369 void **
const ppBuffer,
373 ADI_UART_HANDLE
const hDevice,
374 bool *
const pbAvailable
378 ADI_UART_HANDLE
const hDevice,
379 bool *
const pbAvailable
387 ADI_UART_HANDLE
const hDevice,
389 uint32_t
const nBufSize,
395 ADI_UART_HANDLE
const hDevice,
397 uint32_t
const nBufSize,
408 ADI_UART_HANDLE
const hDevice,
413 ADI_UART_HANDLE
const hDevice,
415 bool const bAutobaudCallbackMode
419 ADI_UART_HANDLE
const hDevice,
420 ADI_UART_TRIG_LEVEL
const eTriglevel
424 ADI_UART_HANDLE
const hDevice,
429 ADI_UART_HANDLE
const hDevice,
430 uint32_t *pnBaudRate,
431 uint32_t *pAutobaudError
435 ADI_UART_HANDLE
const hDevice,
440 ADI_UART_HANDLE
const hDevice,
443 ADI_UART_WORDLEN
const eWordLength
447 ADI_UART_HANDLE
const hDevice,
448 uint16_t
const nDivC,
450 uint16_t
const nDivN,
459 ADI_UART_CONST_HANDLE
const hDevice
463 ADI_UART_CONST_HANDLE
const hDevice
467 ADI_UART_CONST_HANDLE
const hDevice
472 ADI_UART_CONST_HANDLE
const hDevice
476 ADI_UART_HANDLE
const hDevice,
477 bool *
const pbComplete
485 ADI_UART_HANDLE
const hDevice,
486 const ADI_CALLBACK pfCallback,
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.
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. This function sets up the apropriate interrupts associated with the transaction and marks the buffer as submitted.
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_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. This will set up the Rx channel for notification on incoming data using either the DMA or UART interrupts, as well as mark the buffer as submitted.
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. Call to this function will not return until the entire buffer is transmitted. Returns error if this function is called when device is operating in ADI_UART_DATA_TRANSFER_MODE_NONBLOCKING. i.e Function "adi_uart_SubmitTxBuffer()" is called and the transfer is not yet complete.
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.
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...