fb4ff1e7636139ec531310a8892a7ef5c3d17b06
[keystone-rtos/edma3_lld.git] / packages / ti / sdo / edma3 / rm / sample / bios6_edma3_rm_sample.h
1 /*******************************************************************************\r
2 **+--------------------------------------------------------------------------+**\r
3 **|                            ****                                          |**\r
4 **|                            ****                                          |**\r
5 **|                            ******o***                                    |**\r
6 **|                      ********_///_****                                   |**\r
7 **|                      ***** /_//_/ ****                                   |**\r
8 **|                       ** ** (__/ ****                                    |**\r
9 **|                           *********                                      |**\r
10 **|                            ****                                          |**\r
11 **|                            ***                                           |**\r
12 **|                                                                          |**\r
13 **|         Copyright (c) 1998-2006 Texas Instruments Incorporated           |**\r
14 **|                        ALL RIGHTS RESERVED                               |**\r
15 **|                                                                          |**\r
16 **| Permission is hereby granted to licensees of Texas Instruments           |**\r
17 **| Incorporated (TI) products to use this computer program for the sole     |**\r
18 **| purpose of implementing a licensee product based on TI products.         |**\r
19 **| No other rights to reproduce, use, or disseminate this computer          |**\r
20 **| program, whether in part or in whole, are granted.                       |**\r
21 **|                                                                          |**\r
22 **| TI makes no representation or warranties with respect to the             |**\r
23 **| performance of this computer program, and specifically disclaims         |**\r
24 **| any responsibility for any damages, special or consequential,            |**\r
25 **| connected with the use of this program.                                  |**\r
26 **|                                                                          |**\r
27 **+--------------------------------------------------------------------------+**\r
28 *******************************************************************************/\r
29 \r
30 /** \file   bios6_edma3_rm_sample.h\r
31 \r
32     \brief Header file for the Demo application for the EDMA3 Resource Manager.\r
33 \r
34     (C) Copyright 2006, Texas Instruments, Inc\r
35 \r
36     \version    1.0   Anuj Aggarwal         - Created\r
37                 1.1   Anuj Aggarwal         - Made the sample app generic\r
38                                             - Removed redundant arguments\r
39                                               from Cache-related APIs\r
40                                             - Added new function for Poll mode\r
41                                               testing\r
42 \r
43  */\r
44 \r
45 #ifndef _BIOS6_EDMA3_RM_SAMPLE_H_\r
46 #define _BIOS6_EDMA3_RM_SAMPLE_H_\r
47 \r
48 #include <ti/sysbios/ipc/Semaphore.h>\r
49 \r
50 #include <ti/sdo/edma3/rm/edma3_rm.h>\r
51 \r
52 #ifdef __cplusplus\r
53 extern "C" {\r
54 #endif\r
55 \r
56 /* To enable debug traces in the EDMA3 sample app */\r
57 #define EDMA3_DEBUG_PRINT\r
58 \r
59 #ifdef EDMA3_DEBUG_PRINT\r
60 #include <stdio.h>\r
61 #define EDMA3_DEBUG_PRINTF           printf\r
62 #endif /* EDMA3_DEBUG_PRINT */\r
63 \r
64 /**\r
65  * \brief SoC specific TC related information. Specified in the sample\r
66  * configuration file (bios_edma3_sample_cfg.c).\r
67  */\r
68 extern unsigned int numEdma3Tc;\r
69 extern unsigned int ccXferCompInt;\r
70 extern unsigned int ccErrorInt;\r
71 extern unsigned int tcErrorInt[8];\r
72 \r
73 extern unsigned int hwIntXferComp;\r
74 extern unsigned int hwIntCcErr;\r
75 extern unsigned int hwIntTcErr;\r
76 \r
77 EDMA3_RM_Result edma3init();\r
78 EDMA3_RM_Result edma3deinit();\r
79 \r
80 \r
81 /**\r
82  * Counting Semaphore related functions (OS dependent) should be\r
83  * called/implemented by the application. A handle to the semaphore\r
84  * is required while opening the driver/resource manager instance.\r
85  */\r
86 \r
87 /**\r
88  * \brief   EDMA3 OS Semaphore Create\r
89  *\r
90  *      This function creates a counting semaphore with specified\r
91  *      attributes and initial value. It should be used to create a semaphore\r
92  *      with initial value as '1'. The semaphore is then passed by the user\r
93  *      to the EDMA3 RM for proper sharing of resources.\r
94  * \param   initVal [IN] is initial value for semaphore\r
95  * \param   attrs [IN] is the semaphore attributes ex: Fifo type\r
96  * \param   hSem [OUT] is location to recieve the handle to just created\r
97  *      semaphore\r
98  * \return  EDMA3_RM_SOK if succesful, else a suitable error code.\r
99  */\r
100 EDMA3_RM_Result edma3OsSemCreate(int initVal,\r
101                                                         const Semaphore_Params *semParams,\r
102                                 EDMA3_OS_Sem_Handle *hSem);\r
103 \r
104 \r
105 \r
106 /**\r
107  * \brief   EDMA3 OS Semaphore Delete\r
108  *\r
109  *      This function deletes or removes the specified semaphore\r
110  *      from the system. Associated dynamically allocated memory\r
111  *      if any is also freed up.\r
112  * \warning OsSEM services run in client context and not in a thread\r
113  *      of their own. If there exist threads pended on a semaphore\r
114  *      that is being deleted, results are undefined.\r
115  * \param   hSem [IN] handle to the semaphore to be deleted\r
116  * \return  EDMA3_RM_SOK if succesful else a suitable error code\r
117  */\r
118 EDMA3_RM_Result edma3OsSemDelete(EDMA3_OS_Sem_Handle hSem);\r
119 \r
120 #ifdef __cplusplus\r
121 }\r
122 #endif /* extern "C" */\r
123 \r
124 #endif\r
125 \r