AM62L FreeRTOS SDK  11.00.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 
78 typedef struct
79 {
82  uint8_t einfoPresent;
84  uint8_t psInfoPresent;
87  uint8_t errorHandling;
90  uint8_t descType;
92  uint8_t psLocation;
94  uint16_t sopOffset;
97  uint16_t defaultRxCQ;
100 
104 typedef struct
105 {
109  uint32_t mappedFlowGrp;
116  uint32_t mappedChNum;
125 
126 /* ========================================================================== */
127 /* Function Declarations */
128 /* ========================================================================== */
129 
141 int32_t Udma_flowFree(Udma_FlowHandle flowHandle);
142 
170 int32_t Udma_flowAttach(Udma_DrvHandle drvHandle,
171  Udma_FlowHandle flowHandle,
172  uint32_t flowStart,
173  uint32_t flowCnt);
174 
189 int32_t Udma_flowDetach(Udma_FlowHandle flowHandle);
190 
205 int32_t Udma_flowConfig(Udma_FlowHandle flowHandle,
206  uint32_t flowIdx,
207  const Udma_FlowPrms *flowPrms);
208 
218 uint32_t Udma_flowGetNum(Udma_FlowHandle flowHandle);
219 
229 uint32_t Udma_flowGetCount(Udma_FlowHandle flowHandle);
230 
231 /*
232  * Structure Init functions
233  */
241 void UdmaFlowPrms_init(Udma_FlowPrms *flowPrms, uint32_t chType);
242 
269  Udma_FlowHandle flowHandle,
270  uint32_t mappepdFlowNum,
271  const Udma_FlowAllocMappedPrms *flowAllocMappedPrms);
272 
273 
274 /* ========================================================================== */
275 /* Static Function Definitions */
276 /* ========================================================================== */
277 
278 /* None */
279 
280 /* ========================================================================== */
281 /* Internal/Private Structure Declarations */
282 /* ========================================================================== */
283 
287 typedef struct Udma_FlowObject_t
288 {
289  uintptr_t rsv[6U];
292 
293 #ifdef __cplusplus
294 }
295 #endif
296 
297 #endif /* #ifndef UDMA_FLOW_H_ */
298 
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:105
Udma_FlowPrms::einfoPresent
uint8_t einfoPresent
Definition: udma_flow.h:82
Udma_FlowAllocMappedPrms::mappedFlowGrp
uint32_t mappedFlowGrp
Definition: udma_flow.h:109
Udma_FlowPrms::sopOffset
uint16_t sopOffset
Definition: udma_flow.h:94
Udma_FlowPrms::descType
uint8_t descType
Definition: udma_flow.h:90
Udma_FlowHandle
void * Udma_FlowHandle
UDMA flow handle.
Definition: udma_types.h:73
Udma_ChHandle
void * Udma_ChHandle
UDMA channel handle.
Definition: udma_types.h:67
Udma_FlowPrms::psLocation
uint8_t psLocation
Definition: udma_flow.h:92
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_FlowAllocMappedPrms::mappedChNum
uint32_t mappedChNum
Definition: udma_flow.h:116
UdmaFlowPrms_init
void UdmaFlowPrms_init(Udma_FlowPrms *flowPrms, uint32_t chType)
Udma_FlowPrms structure init function.
Udma_FlowObject
Opaque UDMA flow object.
Definition: udma_flow.h:288
Udma_FlowPrms::ChHandle
Udma_ChHandle ChHandle
Definition: udma_flow.h:80
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::defaultRxCQ
uint16_t defaultRxCQ
Definition: udma_flow.h:97
Udma_FlowPrms::errorHandling
uint8_t errorHandling
Definition: udma_flow.h:87
Udma_FlowAllocMappedPrms::ChHandle
Udma_ChHandle ChHandle
Definition: udma_flow.h:106
Udma_FlowPrms
UDMA RX channel flow parameters.
Definition: udma_flow.h:79
Udma_DrvHandle
void * Udma_DrvHandle
UDMA driver handle.
Definition: udma_types.h:65
Udma_FlowPrms::psInfoPresent
uint8_t psInfoPresent
Definition: udma_flow.h:84
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.