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