PDK API Guide for J721E
HwiP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-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  */
58 #ifndef ti_osal_HwiP__include
59 #define ti_osal_HwiP__include
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
65 #include <stdint.h>
66 #include <stdbool.h>
67 #include <stddef.h>
68 
69 /*********************************************************************
70  * @def HWIP_USE_DEFAULT_PRIORITY
71  * Use the default priority for the interrupts
72  *
73  *********************************************************************/
74 #define HWIP_USE_DEFAULT_PRIORITY (~((uint32_t)0))
75 
81 typedef void *HwiP_Handle;
82 
86 typedef enum HwiP_Status_e {
87  HwiP_OK = 0,
88  HwiP_FAILURE = (-(int32_t)1)
89 } HwiP_Status;
90 
97 typedef enum
98 {
99 
102 
105 
108 
111 
114 
117 
119 
123 typedef void (*HwiP_Fxn)(uintptr_t arg);
124 
134 typedef struct HwiP_Params_s {
135  char *name;
139  uintptr_t arg;
140  uint32_t priority;
141  uint32_t enableIntr;
143  uint32_t evtId;
144 #if defined (__ARM_ARCH_7A__) || defined(__aarch64__) || defined (__TI_ARM_V7R4__)
145  uint32_t triggerSensitivity;
149 #endif
150 } HwiP_Params;
151 
157 extern void HwiP_clearInterrupt(int32_t interruptNum);
158 
172 extern HwiP_Handle HwiP_create(int32_t interruptNum, HwiP_Fxn hwiFxn,
173  const HwiP_Params *hwipParams);
174 
182 extern HwiP_Status HwiP_delete(HwiP_Handle hwiPhandle);
183 
199 extern uintptr_t HwiP_disable(void);
200 
206 extern void HwiP_disableInterrupt(int32_t interruptNum);
207 
213 extern void HwiP_enableInterrupt(int32_t interruptNum);
214 
225 extern void HwiP_Params_init(HwiP_Params *hwipParams);
226 
232 extern void HwiP_restore(uintptr_t key);
238 HwiP_Handle HwiP_getHandle(int32_t interruptNum);
244 int32_t HwiP_getEventId(int32_t interruptNum);
252 extern int32_t HwiP_post(uint32_t interruptNum);
253 
254 #ifdef __cplusplus
255 }
256 #endif
257 
258 #endif /* ti_osal_HwiP__include */
259 /* @} */
uint32_t enableIntr
Definition: HwiP.h:141
Basic HwiP Parameters.
Definition: HwiP.h:134
char * name
Definition: HwiP.h:135
void HwiP_disableInterrupt(int32_t interruptNum)
Function to disable a single interrupt.
void HwiP_clearInterrupt(int32_t interruptNum)
Function to clear a single interrupt.
Definition: HwiP.h:101
Definition: HwiP.h:87
Definition: HwiP.h:107
void * HwiP_Handle
Opaque client reference to an instance of a HwiP.
Definition: HwiP.h:81
uint32_t evtId
Definition: HwiP.h:143
void HwiP_enableInterrupt(int32_t interruptNum)
Function to enable a single interrupt.
void HwiP_Params_init(HwiP_Params *hwipParams)
Initialize params structure to default values.
void HwiP_restore(uintptr_t key)
Function to restore interrupts to exit a critical region.
uint32_t priority
Definition: HwiP.h:140
HwiP_Status HwiP_delete(HwiP_Handle hwiPhandle)
Function to delete an interrupt on CortexM devices.
void(* HwiP_Fxn)(uintptr_t arg)
Prototype for the entry function for a hardware interrupt.
Definition: HwiP.h:123
int32_t HwiP_post(uint32_t interruptNum)
Function to post the Hwi interrupt by software.
uintptr_t arg
Definition: HwiP.h:139
Definition: HwiP.h:104
HwiP_Handle HwiP_getHandle(int32_t interruptNum)
Function to get HwiP Handle from an interrupt number.
Definition: HwiP.h:110
HwiP_Handle HwiP_create(int32_t interruptNum, HwiP_Fxn hwiFxn, const HwiP_Params *hwipParams)
Function to create an interrupt on CortexM devices.
HwiP_Status
Status codes for HwiP APIs.
Definition: HwiP.h:86
Definition: HwiP.h:88
uintptr_t HwiP_disable(void)
Function to disable interrupts to enter a critical region.
OSAL_armGicTrigType_t
Enumerates the types different trigger types. Please refer to Section 4.3.13 Interrupt Configuration ...
Definition: HwiP.h:97
int32_t HwiP_getEventId(int32_t interruptNum)
Function to get the eventId associated with an interrupt number.