PDK API Guide for AM65xx
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 0x0
74 
77 #define EventP_ID_00 0x1
78 
81 #define EventP_ID_01 0x2
82 
85 #define EventP_ID_02 0x4
86 
89 #define EventP_ID_03 0x8
90 
93 #define EventP_ID_04 0x10
94 
97 #define EventP_ID_05 0x20
98 
101 #define EventP_ID_06 0x40
102 
105 #define EventP_ID_07 0x80
106 
109 #define EventP_ID_08 0x100
110 
113 #define EventP_ID_09 0x200
114 
117 #define EventP_ID_10 0x400
118 
121 #define EventP_ID_11 0x800
122 
125 #define EventP_ID_12 0x1000
126 
129 #define EventP_ID_13 0x2000
130 
133 #define EventP_ID_14 0x4000
134 
137 #define EventP_ID_15 0x8000
138 
141 #define EventP_ID_16 0x10000
142 
145 #define EventP_ID_17 0x20000
146 
149 #define EventP_ID_18 0x40000
150 
153 #define EventP_ID_19 0x80000
154 
157 #define EventP_ID_20 0x100000
158 
161 #define EventP_ID_21 0x200000
162 
165 #define EventP_ID_22 0x400000
166 
169 #define EventP_ID_23 0x800000
170 /* @} */
171 
175 typedef enum EventP_Status_e
176 {
180  EventP_FAILURE = (-(int32_t)1)
181 } EventP_Status;
182 
186 typedef enum EventP_WaitMode_e {
194 
198 #define EventP_WAIT_FOREVER (~((uint32_t)0U))
199 
203 #define EventP_NO_WAIT ((uint32_t)0U)
204 
205 
212 typedef void *EventP_Handle;
213 
220 typedef struct EventP_Params_s
221 {
222  void *instance;
223 } EventP_Params;
224 
233 
243 
249 extern void EventP_Params_init(EventP_Params *params);
250 
261 extern uint32_t EventP_wait(EventP_Handle handle, uint32_t eventMask,
262  uint8_t waitMode, uint32_t timeout);
263 
275 extern uint32_t EventP_pend(EventP_Handle handle, uint32_t andMask,
276  uint32_t orMask, uint32_t timeout);
277 
287 extern EventP_Status EventP_post(EventP_Handle handle, uint32_t eventMask);
288 
295 extern uint32_t EventP_getPostedEvents(EventP_Handle handle);
296 
297 #ifdef __cplusplus
298 }
299 #endif
300 
301 #endif /* ti_osal_EventP__include */
302 /* @} */
Basic EventP Parameters.
Definition: EventP.h:220
Definition: EventP.h:180
EventP_Status
Status codes for EventP APIs.
Definition: EventP.h:175
uint32_t EventP_pend(EventP_Handle handle, uint32_t andMask, uint32_t orMask, uint32_t timeout)
Function for Event Pend [NOTE: This will be obsolete in next release. Please migrate to new API Event...
Definition: EventP.h:190
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.
EventP_Handle EventP_create(EventP_Params *params)
Function to create an event.
void * instance
Definition: EventP.h:222
void * EventP_Handle
Opaque client reference to an instance of a EventP.
Definition: EventP.h:212
uint32_t EventP_getPostedEvents(EventP_Handle handle)
Function to return Event Posted.
Definition: EventP.h:187
EventP_Status EventP_delete(EventP_Handle *handle)
Function to delete an event.
EventP_WaitMode
Event wait modes for EventP_wait API.
Definition: EventP.h:186
Definition: EventP.h:178