AM64x MCU+ SDK  08.02.00
uart_dma.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
39 #ifndef UART_DMA_H_
40 #define UART_DMA_H_
41 
42 #include <stdint.h>
43 #include <kernel/dpl/SystemP.h>
44 #include <drivers/uart.h>
45 
46 #ifdef __cplusplus
47 extern "C"
48 {
49 #endif
50 
63 typedef void* UART_DmaHandle;
64 
76 typedef int32_t (*UART_dmaOpenFxn)(UART_Handle uartHandle, void *uartDmaArgs);
77 
89 typedef int32_t (*UART_dmaTransferReadFxn)(UART_Object *obj,
90  UART_Transaction *transaction);
91 
103 typedef int32_t (*UART_dmaTransferWriteFxn)(UART_Object *obj,
104  UART_Transaction *transaction);
105 
116 typedef int32_t (*UART_dmaCloseFxn)(UART_Handle handle);
117 
126 typedef int32_t (*UART_dmaDisableChannelFxn)(UART_Handle handle, uint32_t isChannelTx);
127 
131 typedef struct UART_DmaFxns_s
132 {
138 } UART_DmaFxns;
139 
143 typedef struct UART_DmaConfig_s
144 {
147  void *uartDmaArgs;
153 
165 
173 int32_t UART_dmaClose(UART_Handle handle);
174 
183 int32_t UART_dmaDisableChannel(UART_Handle handle, uint32_t isChannelTx);
184 
194  UART_Transaction *transaction);
195 
205  UART_Transaction *transaction);
206 
209 #ifdef __cplusplus
210 }
211 #endif
212 
213 #endif /* UART_DMA_H_ */
UART_DmaFxns
Driver implementation callbacks.
Definition: uart_dma.h:132
UART_DmaFxns::dmaTransferWriteFxn
UART_dmaTransferWriteFxn dmaTransferWriteFxn
Definition: uart_dma.h:134
UART_DmaFxns::dmaTransferReadFxn
UART_dmaTransferReadFxn dmaTransferReadFxn
Definition: uart_dma.h:135
UART_DmaHandle
void * UART_DmaHandle
Handle to the UART DMA Config Object returned by UART_dmaOpen.
Definition: uart_dma.h:63
UART_dmaClose
int32_t UART_dmaClose(UART_Handle handle)
API to close an UART DMA channel.
index
uint16_t index
Definition: tisci_rm_proxy.h:3
SystemP.h
UART_DmaFxns::dmaCloseFxn
UART_dmaCloseFxn dmaCloseFxn
Definition: uart_dma.h:136
UART_dmaOpenFxn
int32_t(* UART_dmaOpenFxn)(UART_Handle uartHandle, void *uartDmaArgs)
Driver implementation to open a specific DMA driver channel - UDMA, EDMA etc.
Definition: uart_dma.h:76
UART_Handle
void * UART_Handle
A handle that is returned from a UART_open() call.
Definition: uart/v0/uart.h:85
UART_DmaConfig::uartDmaArgs
void * uartDmaArgs
Definition: uart_dma.h:147
UART_dmaOpen
UART_DmaHandle UART_dmaOpen(UART_Handle uartHandle, int32_t index)
API to open an UART DMA channel.
UART_dmaCloseFxn
int32_t(* UART_dmaCloseFxn)(UART_Handle handle)
Driver implementation to close a specific DMA driver channel - UDMA, EDMA etc.
Definition: uart_dma.h:116
UART_dmaTransferWriteFxn
int32_t(* UART_dmaTransferWriteFxn)(UART_Object *obj, UART_Transaction *transaction)
Driver implementation to do a DMA write using a specific DMA driver - UDMA, EDMA etc.
Definition: uart_dma.h:103
UART_dmaDisableChannel
int32_t UART_dmaDisableChannel(UART_Handle handle, uint32_t isChannelTx)
API to disable an DMA channel.
uart.h
UART_DmaFxns::dmaDisableChannelFxn
UART_dmaDisableChannelFxn dmaDisableChannelFxn
Definition: uart_dma.h:137
UART_Transaction
Data structure used with UART_read() and UART_write()
Definition: uart/v0/uart.h:423
UART_DmaConfig
UART DMA Configuration, these are filled by SysCfg based on the DMA driver that is selected.
Definition: uart_dma.h:144
UART_dmaTransferReadFxn
int32_t(* UART_dmaTransferReadFxn)(UART_Object *obj, UART_Transaction *transaction)
Driver implementation to do a DMA read using a specific DMA driver - UDMA, EDMA etc.
Definition: uart_dma.h:89
UART_dmaDisableChannelFxn
int32_t(* UART_dmaDisableChannelFxn)(UART_Handle handle, uint32_t isChannelTx)
Driver implementation to diisable a specific DMA driver channel - UDMA, EDMA etc.
Definition: uart_dma.h:126
UART_DmaConfig::fxns
UART_DmaFxns * fxns
Definition: uart_dma.h:145
UART_readInterruptDma
int32_t UART_readInterruptDma(UART_Object *obj, UART_Transaction *transaction)
API to read data using an UART DMA channel.
UART_Object
UART driver object.
Definition: uart/v0/uart.h:535
UART_DmaFxns::dmaOpenFxn
UART_dmaOpenFxn dmaOpenFxn
Definition: uart_dma.h:133
UART_writeInterruptDma
int32_t UART_writeInterruptDma(UART_Object *obj, UART_Transaction *transaction)
API to write data using an UART DMA channel.