TI-RTOS Drivers  tidrivers_full_2_20_00_08
HwiP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, 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  */
50 #ifndef ti_drivers_ports_HwiP__include
51 #define ti_drivers_ports_HwiP__include
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 #include <stdint.h>
58 #include <stdbool.h>
59 #include <stddef.h>
60 
66 typedef void *HwiP_Handle;
67 
71 typedef enum HwiP_Status {
72  HwiP_OK = 0,
74 } HwiP_Status;
75 
79 typedef void (*HwiP_Fxn)(uintptr_t arg);
80 
90 typedef struct HwiP_Params {
91  char *name;
95  uintptr_t arg;
96  uint32_t priority;
97 } HwiP_Params;
98 
104 extern void HwiP_clearInterrupt(int interruptNum);
105 
119 extern HwiP_Handle HwiP_create(int interruptNum, HwiP_Fxn hwiFxn,
120  HwiP_Params *params);
121 
129 extern HwiP_Status HwiP_delete(HwiP_Handle handle);
130 
146 extern uintptr_t HwiP_disable(void);
147 
153 extern void HwiP_disableInterrupt(int interruptNum);
154 
160 extern void HwiP_enableInterrupt(int interruptNum);
161 
172 extern void HwiP_Params_init(HwiP_Params *params);
173 
179 extern void HwiP_restore(uintptr_t key);
180 
181 #ifdef __cplusplus
182 }
183 #endif
184 
185 #endif /* ti_drivers_ports_HwiP__include */
uint32_t priority
Definition: HwiP.h:96
uintptr_t HwiP_disable(void)
Function to disable interrupts to enter a critical region.
void HwiP_enableInterrupt(int interruptNum)
Function to enable a single interrupt.
Definition: HwiP.h:72
char * name
Definition: HwiP.h:91
HwiP_Handle HwiP_create(int interruptNum, HwiP_Fxn hwiFxn, HwiP_Params *params)
Function to create an interrupt on CortexM devices.
HwiP_Status HwiP_delete(HwiP_Handle handle)
Function to delete an interrupt on CortexM devices.
uintptr_t arg
Definition: HwiP.h:95
void HwiP_disableInterrupt(int interruptNum)
Function to disable a single interrupt.
struct HwiP_Params HwiP_Params
Basic HwiP Parameters.
void HwiP_restore(uintptr_t key)
Function to restore interrupts to exit a critical region.
Definition: HwiP.h:73
void * HwiP_Handle
Opaque client reference to an instance of a HwiP.
Definition: HwiP.h:66
void HwiP_Params_init(HwiP_Params *params)
Initialize params structure to default values.
Basic HwiP Parameters.
Definition: HwiP.h:90
void HwiP_clearInterrupt(int interruptNum)
Function to clear a single interrupt.
HwiP_Status
Status codes for HwiP APIs.
Definition: HwiP.h:71
void(* HwiP_Fxn)(uintptr_t arg)
Prototype for the entry function for a hardware interrupt.
Definition: HwiP.h:79
Copyright 2016, Texas Instruments Incorporated