4 * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name Texas Instruments nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 * \brief This file includes internal (private) definitions to the SCR module
37 * \see scrApi.h, scr.c
47 ***********************************************************************
48 * Constant definitions.
49 ***********************************************************************
53 ***********************************************************************
55 ***********************************************************************
58 /** \enum EScrClientState
59 * \brief enumerates the different states a client may be in .\n
63 SCR_CS_IDLE = 0, /**< client is idle */
64 SCR_CS_PENDING, /**< client is pending to use the channel */
65 SCR_CS_RUNNING, /**< client is using the channel */
67 * client was using the channel, but was aborted,
68 * and complete notification is expected.
74 ***********************************************************************
76 ***********************************************************************
80 ***********************************************************************
81 * Structure definitions.
82 ***********************************************************************
85 /** \struct TScrClient
86 * \brief This structure contains information for a specific client
90 EScrClientState state[ SCR_RESOURCE_NUM_OF_RESOURCES ]; /**< the client current state, per resource */
91 TScrCB clientRequestCB; /**< the client's callback function */
92 TI_HANDLE ClientRequestCBObj; /**< the client's object */
93 EScePendReason currentPendingReason[ SCR_RESOURCE_NUM_OF_RESOURCES ];
95 * the reason why this client is pending
101 * \brief This structure contains the SCR object data
105 TI_HANDLE hOS; /**< a handle to the OS object */
106 TI_HANDLE hReport; /**< a handle to the report object */
107 TI_BOOL statusNotficationPending; /**<
108 * whether the SCR is in the process of
109 * notifying a status change to a client
110 * (used to solve re-entrance problem)
112 EScrClientId runningClient[ SCR_RESOURCE_NUM_OF_RESOURCES ];
114 * The index of the current running client
115 * (SCR_CID_NO_CLIENT if none), per resource
117 EScrGroupId currentGroup; /**< the current group */
118 EScrModeId currentMode; /**< the current mode */
119 TScrClient clientArray[ SCR_CID_NUM_OF_CLIENTS ]; /**< array holding all clients' info */
124 ***********************************************************************
125 * External functions definitions
126 ***********************************************************************
130 * \date 01-Dec-2004\n
131 * \brief Searches the client database for a client with matching state, from startFrom to endAt\n
133 * Function Scope \e Private.\n
134 * \param hScr - handle to the SCR object.\n
135 * \param requiredState - the state to match.\n
136 * \param eResource - the resource to macth.\n
137 * \param startFrom - the highest priority to begin searching from.\n
138 * \param endAt - the lowest priority to include in the search.\n
139 * \return the client ID if found, SCR_CID_NO_CLIENT if not found.\n
141 EScrClientId scrFindHighest( TI_HANDLE hScr,
142 EScrClientState requiredState,
143 EScrResourceId eResource,
147 #endif /* __SCR_H__ */