PDK API Guide for J721E
EventP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the 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 "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
50 #ifndef ti_osal_EventP__include
51 #define ti_osal_EventP__include
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 #include <stdint.h>
58 #include <stdbool.h>
59 #include <stddef.h>
60 
73 #define EventP_ID_NONE 0x0U
74 
77 #define EventP_ID_00 0x1U
78 
81 #define EventP_ID_01 0x2U
82 
85 #define EventP_ID_02 0x4U
86 
89 #define EventP_ID_03 0x8U
90 
93 #define EventP_ID_04 0x10U
94 
97 #define EventP_ID_05 0x20U
98 
101 #define EventP_ID_06 0x40U
102 
105 #define EventP_ID_07 0x80U
106 
109 #define EventP_ID_08 0x100U
110 
113 #define EventP_ID_09 0x200U
114 
117 #define EventP_ID_10 0x400U
118 
121 #define EventP_ID_11 0x800U
122 
125 #define EventP_ID_12 0x1000U
126 
129 #define EventP_ID_13 0x2000U
130 
133 #define EventP_ID_14 0x4000U
134 
137 #define EventP_ID_15 0x8000U
138 
141 #define EventP_ID_16 0x10000U
142 
145 #define EventP_ID_17 0x20000U
146 
149 #define EventP_ID_18 0x40000U
150 
153 #define EventP_ID_19 0x80000U
154 
157 #define EventP_ID_20 0x100000U
158 
161 #define EventP_ID_21 0x200000U
162 
165 #define EventP_ID_22 0x400000U
166 
169 #define EventP_ID_23 0x800000U
170 /* @} */
171 
175 typedef enum EventP_Status_e
176 {
180  EventP_FAILURE = (-(int32_t)1)
181 } EventP_Status;
182 
192 typedef uint8_t EventP_WaitMode;
193 /* EventP_wait will return when ANY of the bits set in mask are set in the Event bits */
194 #define EventP_WaitMode_ANY ( (uint8_t) 0U)
195 /* EventP_wait will return when ALL the bits set in mask are set in the Event bits */
196 #define EventP_WaitMode_ALL ( (uint8_t) 1U)
197 /* @} */
198 
202 #define EventP_WAIT_FOREVER (~((uint32_t)0U))
203 
207 #define EventP_NO_WAIT ((uint32_t)0U)
208 
209 
216 typedef void *EventP_Handle;
217 
224 typedef struct EventP_Params_s
225 {
226  void *instance;
227 } EventP_Params;
228 
237 
247 
253 extern void EventP_Params_init(EventP_Params *params);
254 
265 extern uint32_t EventP_wait(EventP_Handle handle, uint32_t eventMask,
266  uint8_t waitMode, uint32_t timeout);
267 
277 extern EventP_Status EventP_post(EventP_Handle handle, uint32_t eventMask);
278 
285 extern uint32_t EventP_getPostedEvents(EventP_Handle handle);
286 
287 #ifdef __cplusplus
288 }
289 #endif
290 
291 #endif /* ti_osal_EventP__include */
292 /* @} */
Basic EventP Parameters.
Definition: EventP.h:224
Definition: EventP.h:180
EventP_Status
Status codes for EventP APIs.
Definition: EventP.h:175
void EventP_Params_init(EventP_Params *params)
Initialize params structure to default values.
EventP_Status EventP_post(EventP_Handle handle, uint32_t eventMask)
Function for Event Post.
uint32_t EventP_wait(EventP_Handle handle, uint32_t eventMask, uint8_t waitMode, uint32_t timeout)
Function for Event Wait.
uint8_t EventP_WaitMode
This enumerator defines the Event wait modes.
Definition: EventP.h:192
EventP_Handle EventP_create(EventP_Params *params)
Function to create an event.
void * instance
Definition: EventP.h:226
void * EventP_Handle
Opaque client reference to an instance of a EventP.
Definition: EventP.h:216
uint32_t EventP_getPostedEvents(EventP_Handle handle)
Function to return Event Posted.
EventP_Status EventP_delete(EventP_Handle *handle)
Function to delete an event.
Definition: EventP.h:178