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 #include <ti/sysbios/knl/Event.h>
61 
62 /*
63  * Pre-defined Event Ids. Event_Ids are provided to simplify the specification
64  * of andMasks and orMasks arguments to Event_pend().
65  * Since each Event_Id is a bitmask composed of only a single bit,
66  * a group of Event_Ids within an andMask or orMask can be indicated by simply adding them together.
67  */
68 
72 #define EventP_ID_NONE Event_Id_NONE
73 
76 #define EventP_ID_00 Event_Id_00
77 
80 #define EventP_ID_01 Event_Id_01
81 
84 #define EventP_ID_02 Event_Id_02
85 
88 #define EventP_ID_03 Event_Id_03
89 
92 #define EventP_ID_04 Event_Id_04
93 
96 #define EventP_ID_05 Event_Id_05
97 
100 #define EventP_ID_06 Event_Id_06
101 
104 #define EventP_ID_07 Event_Id_07
105 
108 #define EventP_ID_08 Event_Id_08
109 
112 #define EventP_ID_09 Event_Id_09
113 
116 #define EventP_ID_10 Event_Id_10
117 
121 typedef enum EventP_Status_e
122 {
126  EventP_FAILURE = (-(int32_t)1)
127 } EventP_Status;
128 
132 #define EventP_WAIT_FOREVER (~((uint32_t)0U))
133 
137 #define EventP_NO_WAIT ((uint32_t)0U)
138 
139 
146 typedef void *EventP_Handle;
147 
154 typedef struct EventP_Params_s
155 {
156  void *instance;
157 } EventP_Params;
158 
166 extern EventP_Handle EventP_create(EventP_Params *params);
167 
173 extern void EventP_delete(EventP_Handle *handle);
174 
180 extern void EventP_Params_init(EventP_Params *params);
181 
191 extern uint32_t EventP_pend(EventP_Handle handle, uint32_t andMask,
192  uint32_t orMask, uint32_t timeout);
193 
200 extern void EventP_post(EventP_Handle handle, uint32_t eventMask);
201 
208 extern uint32_t EventP_getPostedEvents(EventP_Handle handle);
209 
210 #ifdef __cplusplus
211 }
212 #endif
213 
214 #endif /* ti_osal_EventP__include */
215 /* @} */
Basic EventP Parameters.
Definition: EventP.h:154
Definition: EventP.h:126
EventP_Status
Status codes for EventP APIs.
Definition: EventP.h:121
void EventP_delete(EventP_Handle *handle)
Function to delete an event.
uint32_t EventP_pend(EventP_Handle handle, uint32_t andMask, uint32_t orMask, uint32_t timeout)
Function for Event Pend.
void EventP_Params_init(EventP_Params *params)
Initialize params structure to default values.
EventP_Handle EventP_create(EventP_Params *params)
Function to create an event.
void * instance
Definition: EventP.h:156
void * EventP_Handle
Opaque client reference to an instance of a EventP.
Definition: EventP.h:146
uint32_t EventP_getPostedEvents(EventP_Handle handle)
Function for Event Post.
void EventP_post(EventP_Handle handle, uint32_t eventMask)
Function for Event Post.
Definition: EventP.h:124