PDK API Guide for AM64x
RegisterIntr.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-present, 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  */
48 #ifndef ti_osal_RegisterIntr__include
49 #define ti_osal_RegisterIntr__include
50 
51 #include <ti/osal/EventCombinerP.h>
52 #include <ti/osal/HwiP.h>
53 #include <ti/osal/MuxIntcP.h>
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 #include <stdint.h>
60 #include <stdbool.h>
61 #include <stddef.h>
62 typedef void (*Osal_IsrRoutine)(uintptr_t arg);
66 typedef struct {
67  char *name;
68  int32_t corepacEventNum;
69  int32_t intVecNum;
71  uintptr_t arg;
72  uint32_t priority;
84  uint32_t triggerSensitivity;
92  uint32_t enableIntr;
96 
100 #define OSAL_REGINT_INTVEC_EVENT_COMBINER (16)
101 
105 typedef struct {
109 
117 typedef struct {
123 
132 typedef int32_t OsalInterruptRetCode_e;
134 #define OSAL_INT_SUCCESS ((int32_t) 0)
135 
136 #define OSAL_INT_ERR_INVALID_PARAMS ((int32_t) -1)
137 
138 #define OSAL_INT_ERR_HWICREATE ((int32_t) -2)
139 
140 #define OSAL_INT_ERR_EVENTCOMBINER_REG ((int32_t) -3)
141 
142 #define OSAL_INT_ERR_DELETE ((int32_t) -4)
143 
144 #define OSAL_INT_UNSUPPORTED ((int32_t) -5)
145 /* @} */
146 
157  HwiP_DirectFxn isrFxn, HwiP_Handle *hwiPHandlePtr);
167 OsalInterruptRetCode_e Osal_DeleteInterrupt(HwiP_Handle hwiPhandle,int32_t corepacEventNum);
172 void Osal_EnableInterrupt(int32_t corepacEvent,int32_t interruptNum);
177 void Osal_DisableInterrupt(int32_t corepacEvent,int32_t interruptNum);
182 void Osal_ClearInterrupt(int32_t corepacEvent,int32_t interruptNum);
183 #ifdef __cplusplus
184 }
185 #endif
186 
187 #endif /* ti_osal_RegisterIntr__include */
188 /* @} */
void(* Osal_IsrRoutine)(uintptr_t arg)
Definition: RegisterIntr.h:62
Osal_IsrRoutine isrRoutine
Definition: RegisterIntr.h:70
Event Combiner routines for the RTOS Porting Interface.
OsalInterruptRetCode_e Osal_RegisterInterrupt(OsalRegisterIntrParams_t *interruptRegParams, HwiP_Handle *hwiPHandlePtr)
Function to register interrupt with parameters provided.
void Osal_RegisterInterrupt_initParams(OsalRegisterIntrParams_t *interruptRegParams)
Function to initialize the interrupt registration configuration data structure.
void Osal_ClearInterrupt(int32_t corepacEvent, int32_t interruptNum)
Function to clear the interrupt corresponding to an event number.
OsalInterruptRetCode_e Osal_DeleteInterrupt(HwiP_Handle hwiPhandle, int32_t corepacEventNum)
Function to delete interrupt corresponding to an event number.
OsalInterruptRetCode_e Osal_RegisterInterruptDirect(OsalRegisterIntrParams_t *interruptRegParams, HwiP_DirectFxn isrFxn, HwiP_Handle *hwiPHandlePtr)
Function to register direct interrupt with parameters provided.
Basic MuxIntcP Input Parameters.
Definition: MuxIntcP.h:99
void * HwiP_Handle
Opaque client reference to an instance of a HwiP.
Definition: HwiP.h:81
Interrupt Configuration parameters This is the data structure used to configure the interrupts in the...
Definition: RegisterIntr.h:117
Interrupt Configuration parameters for the corepac (c6x/a15/m5/a8/a9)
Definition: RegisterIntr.h:66
void(* HwiP_DirectFxn)(void)
Prototype for the entry function for a hardware interrupt registered using HwiP_createDirect.
Definition: HwiP.h:127
OsalRegisterIntParams_corepac_t corepacConfig
Definition: RegisterIntr.h:118
int32_t OsalInterruptRetCode_e
Return error codes for Osal Interrupt functions.
Definition: RegisterIntr.h:132
Basic MuxIntcP Output Parameters.
Definition: MuxIntcP.h:114
uintptr_t arg
Definition: RegisterIntr.h:71
Interrupt Controller Mux module for the RTOS Porting Interface.
MuxIntcP_inParams * muxInParams
Definition: RegisterIntr.h:106
char * name
Definition: RegisterIntr.h:67
void Osal_DisableInterrupt(int32_t corepacEvent, int32_t interruptNum)
Function to disable the interrupt corresponding to an event number.
uint32_t priority
Definition: RegisterIntr.h:72
void Osal_EnableInterrupt(int32_t corepacEvent, int32_t interruptNum)
Function to enable the interrupt corresponding to an event number.
OsalRegisterIntParams_socmux_t socMuxConfig
Definition: RegisterIntr.h:119
Interrupt Configuration parameters for soc mux prior to reaching the core.
Definition: RegisterIntr.h:105
MuxIntcP_outParams * muxOutParams
Definition: RegisterIntr.h:107
uint32_t triggerSensitivity
Definition: RegisterIntr.h:84
int32_t corepacEventNum
Definition: RegisterIntr.h:68
int32_t intVecNum
Definition: RegisterIntr.h:69
uint32_t enableIntr
Definition: RegisterIntr.h:92
Hardware Interrupt module for the RTOS Porting Interface.