AM64x MCU+ SDK  11.02.00
udma_flow.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018-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 
48 #ifndef UDMA_FLOW_H_
49 #define UDMA_FLOW_H_
50 
51 /* ========================================================================== */
52 /* Include Files */
53 /* ========================================================================== */
54 
55 /* None */
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 /* ========================================================================== */
62 /* Macros & Typedefs */
63 /* ========================================================================== */
64 
66 #define UDMA_DEFAULT_FLOW_ID (0x3FFFU)
67 
69 #define UDMA_FLOW_INVALID ((uint32_t) 0xFFFF0000U)
70 
71 /* ========================================================================== */
72 /* Structure Declarations */
73 /* ========================================================================== */
74 
75 
79 typedef struct
80 {
81  uint32_t mappedFlowGrp;
88  uint32_t mappedChNum;
97 
98 /* ========================================================================== */
99 /* Function Declarations */
100 /* ========================================================================== */
101 
123  Udma_FlowHandle flowHandle,
124  const Udma_FlowAllocMappedPrms *flowAllocMappedPrms);
125 
139 int32_t Udma_flowFree(Udma_FlowHandle flowHandle);
140 
171 int32_t Udma_flowAttach(Udma_DrvHandle drvHandle,
172  Udma_FlowHandle flowHandle,
173  uint32_t flowStart,
174  uint32_t flowCnt);
175 
206  Udma_FlowHandle flowHandle,
207  uint32_t mappepdFlowNum,
208  const Udma_FlowAllocMappedPrms *flowAllocMappedPrms);
209 
226 int32_t Udma_flowDetach(Udma_FlowHandle flowHandle);
227 
247 int32_t Udma_flowConfig(Udma_FlowHandle flowHandle,
248  uint32_t flowIdx,
249  const Udma_FlowPrms *flowPrms);
250 
262 uint32_t Udma_flowGetNum(Udma_FlowHandle flowHandle);
263 
277 uint32_t Udma_flowGetCount(Udma_FlowHandle flowHandle);
278 
279 /*
280  * Structure Init functions
281  */
289 void UdmaFlowPrms_init(Udma_FlowPrms *flowPrms, uint32_t chType);
290 
291 /* ========================================================================== */
292 /* Static Function Definitions */
293 /* ========================================================================== */
294 
295 /* None */
296 
297 /* ========================================================================== */
298 /* Internal/Private Structure Declarations */
299 /* ========================================================================== */
300 
301 /* None */
302 
303 #ifdef __cplusplus
304 }
305 #endif
306 
307 #endif /* #ifndef UDMA_FLOW_H_ */
308 
Udma_flowDetach
int32_t Udma_flowDetach(Udma_FlowHandle flowHandle)
UDMA flow detach API.
Udma_flowGetNum
uint32_t Udma_flowGetNum(Udma_FlowHandle flowHandle)
Returns the start flow number managed by this flow handle.
Udma_FlowAllocMappedPrms
UDMA RX channel mapped flow alloc parameters.
Definition: udma_flow.h:80
Udma_FlowAllocMappedPrms::mappedFlowGrp
uint32_t mappedFlowGrp
Definition: udma_flow.h:81
Udma_DrvHandle
struct Udma_DrvObjectInt * Udma_DrvHandle
UDMA driver handle.
Definition: udma_types.h:84
Udma_flowConfig
int32_t Udma_flowConfig(Udma_FlowHandle flowHandle, uint32_t flowIdx, const Udma_FlowPrms *flowPrms)
This API configures the flow configurations.
Udma_flowAttachMapped
int32_t Udma_flowAttachMapped(Udma_DrvHandle drvHandle, Udma_FlowHandle flowHandle, uint32_t mappepdFlowNum, const Udma_FlowAllocMappedPrms *flowAllocMappedPrms)
UDMA mapped flow attach API. This API is used to attach to an already allocated mapped flow....
Udma_FlowHandle
struct Udma_FlowObjectInt * Udma_FlowHandle
UDMA flow handle.
Definition: udma_types.h:92
Udma_FlowAllocMappedPrms::mappedChNum
uint32_t mappedChNum
Definition: udma_flow.h:88
Udma_flowAllocMapped
int32_t Udma_flowAllocMapped(Udma_DrvHandle drvHandle, Udma_FlowHandle flowHandle, const Udma_FlowAllocMappedPrms *flowAllocMappedPrms)
UDMA mapped flow allocation API. In devices like AM64x, flows are tied to channels....
UdmaFlowPrms_init
void UdmaFlowPrms_init(Udma_FlowPrms *flowPrms, uint32_t chType)
Udma_FlowPrms structure init function.
Udma_flowAttach
int32_t Udma_flowAttach(Udma_DrvHandle drvHandle, Udma_FlowHandle flowHandle, uint32_t flowStart, uint32_t flowCnt)
UDMA flow attach API. This API is used to attach to an already allocated flow. This API differs from ...
Udma_FlowPrms
UDMA RX channel flow parameters.
Definition: udma_types.h:558
Udma_flowFree
int32_t Udma_flowFree(Udma_FlowHandle flowHandle)
UDMA free flows.
Udma_flowGetCount
uint32_t Udma_flowGetCount(Udma_FlowHandle flowHandle)
Returns the number of flows managed by this flow handle.