HwiP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2025, 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  */
138 #ifndef ti_dpl_HwiP__include
139 #define ti_dpl_HwiP__include
140 
141 #include <stdint.h>
142 #include <stdbool.h>
143 #include <stddef.h>
144 
145 #ifdef __cplusplus
146 extern "C" {
147 #endif
148 
158 #define HwiP_STRUCT_SIZE (28)
159 
166 typedef union HwiP_Struct
167 {
168  uint32_t dummy;
170 } HwiP_Struct;
171 
177 typedef void *HwiP_Handle;
178 
182 typedef enum
183 {
184  HwiP_OK = 0,
186 } HwiP_Status;
187 
191 typedef void (*HwiP_Fxn)(uintptr_t arg);
192 
205 typedef struct
206 {
207  uintptr_t arg;
208  uint32_t priority;
212  bool enableInt;
213 } HwiP_Params;
214 
230 extern int HwiP_swiPIntNum;
231 
245 extern HwiP_Handle HwiP_construct(HwiP_Struct *handle, int interruptNum, HwiP_Fxn hwiFxn, HwiP_Params *params);
246 
255 extern void HwiP_destruct(HwiP_Struct *handle);
256 
262 extern void HwiP_clearInterrupt(int interruptNum);
263 
279 extern HwiP_Handle HwiP_create(int interruptNum, HwiP_Fxn hwiFxn, HwiP_Params *params);
280 
290 extern void HwiP_delete(HwiP_Handle handle);
291 
307 extern uintptr_t HwiP_disable(void);
308 
312 extern void HwiP_enable(void);
313 
319 extern void HwiP_disableInterrupt(int interruptNum);
320 
326 extern void HwiP_enableInterrupt(int interruptNum);
327 
335 extern bool HwiP_inISR(void);
336 
344 extern bool HwiP_interruptsEnabled(void);
345 
356 extern void HwiP_Params_init(HwiP_Params *params);
357 
364 extern void HwiP_plug(int interruptNum, void *fxn);
365 
371 extern void HwiP_post(int interruptNum);
372 
378 extern void HwiP_restore(uintptr_t key);
379 
388 extern void HwiP_setFunc(HwiP_Handle handle, HwiP_Fxn fxn, uintptr_t arg);
389 
396 extern void HwiP_setPriority(int interruptNum, uint32_t priority);
397 
405 void HwiP_dispatchInterrupt(int interruptNum);
406 
407 #ifdef __cplusplus
408 }
409 #endif
410 
411 #endif /* ti_dpl_HwiP__include */
void HwiP_enable(void)
Function to enable interrupts.
bool enableInt
Definition: HwiP.h:212
uint32_t priority
Definition: HwiP.h:208
ADC_Params params
Definition: Driver_Init.h:11
void HwiP_dispatchInterrupt(int interruptNum)
Function to call the HW ISR function registered by HwiP_construct()
uintptr_t HwiP_disable(void)
Function to disable interrupts to enter a critical region.
HwiP structure.
Definition: HwiP.h:166
void HwiP_destruct(HwiP_Struct *handle)
Function to destruct a hardware interrupt object.
void HwiP_setFunc(HwiP_Handle handle, HwiP_Fxn fxn, uintptr_t arg)
Function to overwrite HwiP function and arg.
void HwiP_enableInterrupt(int interruptNum)
Function to enable a single interrupt.
union HwiP_Struct HwiP_Struct
HwiP structure.
HwiP_Handle HwiP_construct(HwiP_Struct *handle, int interruptNum, HwiP_Fxn hwiFxn, HwiP_Params *params)
Function to construct a hardware interrupt object.
uint32_t dummy
Definition: HwiP.h:168
Definition: HwiP.h:184
bool HwiP_inISR(void)
Function to return a status based on whether it is in an interrupt context.
void HwiP_plug(int interruptNum, void *fxn)
Function to plug an interrupt vector.
bool HwiP_interruptsEnabled(void)
Function to determine whether interrupts are currently enabled.
HwiP_Handle HwiP_create(int interruptNum, HwiP_Fxn hwiFxn, HwiP_Params *params)
Function to create an interrupt on CortexM devices.
void HwiP_post(int interruptNum)
Function to generate an interrupt.
void HwiP_setPriority(int interruptNum, uint32_t priority)
Function to set the priority of a hardware interrupt.
#define HwiP_STRUCT_SIZE
Number of bytes greater than or equal to the size of any RTOS HwiP object.
Definition: HwiP.h:158
uintptr_t arg
Definition: HwiP.h:207
void HwiP_disableInterrupt(int interruptNum)
Function to disable a single interrupt.
void HwiP_restore(uintptr_t key)
Function to restore interrupts to exit a critical region.
Definition: HwiP.h:185
uint8_t data[(28)]
Definition: HwiP.h:169
void * HwiP_Handle
Opaque client reference to an instance of a HwiP.
Definition: HwiP.h:177
void HwiP_delete(HwiP_Handle handle)
Function to delete an interrupt on CortexM devices.
int HwiP_swiPIntNum
Interrupt number posted by SwiP.
void HwiP_Params_init(HwiP_Params *params)
Initialize params structure to default values.
Basic HwiP Parameters.
Definition: HwiP.h:205
void HwiP_clearInterrupt(int interruptNum)
Function to clear a single interrupt.
HwiP_Status
Status codes for HwiP APIs.
Definition: HwiP.h:182
void(* HwiP_Fxn)(uintptr_t arg)
Prototype for the entry function for a hardware interrupt.
Definition: HwiP.h:191
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale