AM263x MCU+ SDK  08.03.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 
90 typedef int32_t (*UART_dmaTransferReadFxn)(UART_Object *obj, const UART_Attrs *attrs,
91  UART_Transaction *transaction);
92 
105 typedef int32_t (*UART_dmaTransferWriteFxn)(UART_Object *obj, const UART_Attrs *attrs,
106  UART_Transaction *transaction);
107 
118 typedef int32_t (*UART_dmaCloseFxn)(UART_Handle handle);
119 
128 typedef int32_t (*UART_dmaDisableChannelFxn)(UART_Handle handle, uint32_t isChannelTx);
129 
133 typedef struct UART_DmaFxns_s
134 {
140 } UART_DmaFxns;
141 
145 typedef struct UART_DmaConfig_s
146 {
149  void *uartDmaArgs;
155 
166 UART_DmaHandle UART_dmaOpen(UART_Handle uartHandle, int32_t index);
167 
175 int32_t UART_dmaClose(UART_Handle handle);
176 
185 int32_t UART_dmaDisableChannel(UART_Handle handle, uint32_t isChannelTx);
186 
196 int32_t UART_writeInterruptDma(UART_Object *obj, const UART_Attrs *attrs,
197  UART_Transaction *transaction);
198 
208 int32_t UART_readInterruptDma(UART_Object *obj, const UART_Attrs *attrs,
209  UART_Transaction *transaction);
210 
213 #ifdef __cplusplus
214 }
215 #endif
216 
217 #endif /* UART_DMA_H_ */
UART_DmaFxns
Driver implementation callbacks.
Definition: uart_dma.h:134
UART_DmaFxns::dmaTransferWriteFxn
UART_dmaTransferWriteFxn dmaTransferWriteFxn
Definition: uart_dma.h:136
UART_DmaFxns::dmaTransferReadFxn
UART_dmaTransferReadFxn dmaTransferReadFxn
Definition: uart_dma.h:137
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.
SystemP.h
UART_DmaFxns::dmaCloseFxn
UART_dmaCloseFxn dmaCloseFxn
Definition: uart_dma.h:138
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:149
UART_readInterruptDma
int32_t UART_readInterruptDma(UART_Object *obj, const UART_Attrs *attrs, UART_Transaction *transaction)
API to read data using an UART DMA channel.
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:118
UART_dmaDisableChannel
int32_t UART_dmaDisableChannel(UART_Handle handle, uint32_t isChannelTx)
API to disable an DMA channel.
uart.h
UART_writeInterruptDma
int32_t UART_writeInterruptDma(UART_Object *obj, const UART_Attrs *attrs, UART_Transaction *transaction)
API to write data using an UART DMA channel.
UART_dmaTransferWriteFxn
int32_t(* UART_dmaTransferWriteFxn)(UART_Object *obj, const UART_Attrs *attrs, UART_Transaction *transaction)
Driver implementation to do a DMA write using a specific DMA driver - UDMA, EDMA etc.
Definition: uart_dma.h:105
UART_DmaFxns::dmaDisableChannelFxn
UART_dmaDisableChannelFxn dmaDisableChannelFxn
Definition: uart_dma.h:139
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:146
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:128
UART_DmaConfig::fxns
UART_DmaFxns * fxns
Definition: uart_dma.h:147
UART_Object
UART driver object.
Definition: uart/v0/uart.h:535
UART_DmaFxns::dmaOpenFxn
UART_dmaOpenFxn dmaOpenFxn
Definition: uart_dma.h:135
UART_Attrs
UART instance attributes - used during init time.
Definition: uart/v0/uart.h:517
UART_dmaTransferReadFxn
int32_t(* UART_dmaTransferReadFxn)(UART_Object *obj, const UART_Attrs *attrs, UART_Transaction *transaction)
Driver implementation to do a DMA read using a specific DMA driver - UDMA, EDMA etc.
Definition: uart_dma.h:90