]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/pdk.git/blob - packages/ti/drv/pcie/example/EDMA/commonEDMA.c
pcie-lld: add to PDK
[processor-sdk/pdk.git] / packages / ti / drv / pcie / example / EDMA / commonEDMA.c
1 \r
2 /*\r
3  * Copyright (C) 2009-2016 Texas Instruments Incorporated - http://www.ti.com/\r
4  *\r
5  *\r
6  *  Redistribution and use in source and binary forms, with or without\r
7  *  modification, are permitted provided that the following conditions\r
8  *  are met:\r
9  *\r
10  *    Redistributions of source code must retain the above copyright\r
11  *    notice, this list of conditions and the following disclaimer.\r
12  *\r
13  *    Redistributions in binary form must reproduce the above copyright\r
14  *    notice, this list of conditions and the following disclaimer in the\r
15  *    documentation and/or other materials provided with the\r
16  *    distribution.\r
17  *\r
18  *    Neither the name of Texas Instruments Incorporated nor the names of\r
19  *    its contributors may be used to endorse or promote products derived\r
20  *    from this software without specific prior written permission.\r
21  *\r
22  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
23  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
24  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
25  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
26  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
27  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
28  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
29  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
30  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
31  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
32  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
33  *\r
34 */\r
35 \r
36 #include "PCIeEDMA.h"\r
37 \r
38 \r
39 /* Flag variable to check transfer completion on channel 1 */\r
40 volatile short irqRaised1 = 0;\r
41 \r
42 /* Callback functions are used to handle interrupts. This is currently not enabled in this exmaple code.\r
43  * To see how the callback function is used, refer to the EDMA LLD example project.\r
44  */\r
45 \r
46 /* Callback function 1 */\r
47 void pcie_edma_cb_isr1 (uint32_t tcc, EDMA3_RM_TccStatus status,\r
48                         void *appData)\r
49     {\r
50     (void)tcc;\r
51     (void)appData;\r
52 \r
53     switch (status)\r
54         {\r
55         case EDMA3_RM_XFER_COMPLETE:\r
56             /* Transfer completed successfully */\r
57             irqRaised1 = 1;\r
58             break;\r
59         case EDMA3_RM_E_CC_DMA_EVT_MISS:\r
60             /* Transfer resulted in DMA event miss error. */\r
61             irqRaised1 = -1;\r
62             break;\r
63         case EDMA3_RM_E_CC_QDMA_EVT_MISS:\r
64             /* Transfer resulted in QDMA event miss error. */\r
65             irqRaised1 = -2;\r
66             break;\r
67         default:\r
68             break;\r
69         }\r
70     }\r
71 \r