SDL API Guide for J721E
sdl_vim.h
Go to the documentation of this file.
1 
39 #ifndef SDL_VIM_H
40 #define SDL_VIM_H
41 
42 #include <stdint.h>
43 #include <stdbool.h>
44 #include "sdlr_vim.h"
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
89 #define SDL_VIM_MAX_INTR_GROUPS (32U)
90 
92 #define SDL_VIM_NUM_INTRS_PER_GROUP (32U)
93 /* @} */
94 
95 
102 typedef uint32_t SDL_VimIntrType;
103 
111 #define SDL_VIM_INTR_TYPE_LEVEL ((uint32_t)0U)
112 
114 #define SDL_VIM_INTR_TYPE_PULSE ((uint32_t)1U)
115 /* @} */
116 
124 typedef uint32_t SDL_VimIntrMap;
125 
133 #define SDL_VIM_INTR_MAP_IRQ ((uint32_t)0U)
134 
136 #define SDL_VIM_INTR_MAP_FIQ ((uint32_t)1U)
137 
139 #define SDL_VIM_INTR_MAP_ALL ((uint32_t)2U)
140 /* @} */
141 
142 /* @} */
143 
155 typedef struct {
156  volatile uint32_t INTR_EN_SET;
157  volatile uint32_t INTR_EN_CLR;
158  volatile uint32_t INTMAP;
159  volatile uint32_t INTTYPE;
161 
167 typedef struct {
171  volatile uint32_t PID;
172  volatile uint32_t INFO;
173  volatile uint32_t IRQVEC;
174  volatile uint32_t FIQVEC;
175  volatile uint32_t DEDVEC;
177 
178 /* @} */
179 
197 uint32_t SDL_VIM_getRevision( SDL_vimRegs *pRegs );
198 
211 uint32_t SDL_VIM_getNumIntrs( SDL_vimRegs *pRegs );
212 
231 int32_t SDL_VIM_cfgIntr(
232  SDL_vimRegs *pRegs,
233  uint32_t intrNum,
234  uint32_t pri,
235  SDL_VimIntrMap intrMap,
236  SDL_VimIntrType intrType,
237  uint32_t vecAddr
238 );
239 
259 int32_t SDL_VIM_verifyCfgIntr(
260  SDL_vimRegs *pRegs,
261  uint32_t intrNum,
262  uint32_t pri,
263  SDL_VimIntrMap intrMap,
264  SDL_VimIntrType intrType,
265  uint32_t vecAddr
266 );
267 
268 
282 int32_t SDL_VIM_getIntrType( SDL_vimRegs *pRegs, uint32_t intrNum);
283 
299 void SDL_VIM_setDedVectorAddr( SDL_vimRegs *pRegs, uint32_t dedVectorAddr );
300 
317 int32_t SDL_VIM_getDedVectorAddr( SDL_vimRegs *pRegs, uint32_t *pDedVectorAddr );
318 
339  SDL_vimRegs *pRegs,
340  SDL_VimIntrMap intrMap,
341  uint32_t *pIntrNum,
342  uint32_t *pPri
343 );
344 
358 uint32_t SDL_VIM_getIrqVectorAddress( SDL_vimRegs *pRegs );
359 
374 uint32_t SDL_VIM_getFiqVectorAddress( SDL_vimRegs *pRegs );
375 
397 uint32_t SDL_VIM_getGroupsIntrPending( SDL_vimRegs *pRegs, SDL_VimIntrMap intrMap );
398 
428  SDL_vimRegs *pRegs,
429  SDL_VimIntrMap intrMap,
430  uint32_t groupNum,
431  bool bMasked
432 );
433 
446 int32_t SDL_VIM_setIntrPending( SDL_vimRegs *pRegs, uint32_t intrNum );
447 
460 int32_t SDL_VIM_clrIntrPending( SDL_vimRegs *pRegs, uint32_t intrNum );
461 
474 int32_t SDL_VIM_ackIntr( SDL_vimRegs *pRegs, SDL_VimIntrMap intrMap );
475 
493 int32_t SDL_VIM_setIntrEnable( SDL_vimRegs *pRegs, uint32_t intrNum, bool bEnable );
494 
510 int32_t SDL_VIM_getStaticRegs( SDL_vimRegs *pRegs, SDL_vimStaticRegs *pStaticRegs);
511 
512 /* @} */
513 
514 #ifdef __cplusplus
515 }
516 #endif /* extern "C" */
517 
518 #endif /* end of SDL_VIM_H_ definition */
uint32_t SDL_VIM_getRevision(SDL_vimRegs *pRegs)
Return revision of the VIM module.
int32_t SDL_VIM_clrIntrPending(SDL_vimRegs *pRegs, uint32_t intrNum)
Clear the raw interrupt status bit for the specified interrupt.
uint32_t SDL_VimIntrMap
This enumerator defines the possible output interrupt types. Each source interrupt can be configured ...
Definition: sdl_vim.h:124
void SDL_VIM_setDedVectorAddr(SDL_vimRegs *pRegs, uint32_t dedVectorAddr)
Set the DED interrupt vector address.
int32_t SDL_VIM_getDedVectorAddr(SDL_vimRegs *pRegs, uint32_t *pDedVectorAddr)
Get the DED interrupt vector address.
#define SDL_VIM_MAX_INTR_GROUPS
Definition: sdl_vim.h:89
int32_t SDL_VIM_ackIntr(SDL_vimRegs *pRegs, SDL_VimIntrMap intrMap)
Acknowledge servicing is complete for the specified interrupt type.
volatile uint32_t IRQVEC
Definition: sdl_vim.h:173
int32_t SDL_VIM_getIntrType(SDL_vimRegs *pRegs, uint32_t intrNum)
Get the interrupt type.
int32_t SDL_VIM_getActivePendingIntr(SDL_vimRegs *pRegs, SDL_VimIntrMap intrMap, uint32_t *pIntrNum, uint32_t *pPri)
Get information on the current highest priority pending interrupt.
uint32_t SDL_VIM_getIrqVectorAddress(SDL_vimRegs *pRegs)
Get the current IRQ vector address.
uint32_t SDL_VIM_getNumIntrs(SDL_vimRegs *pRegs)
Get the number of interrupts supported by this VIM.
volatile uint32_t FIQVEC
Definition: sdl_vim.h:174
volatile uint32_t INTTYPE
Definition: sdl_vim.h:159
uint32_t SDL_VIM_getGroupsIntrPending(SDL_vimRegs *pRegs, SDL_VimIntrMap intrMap)
Get bit-mask of masked interrupt status for all interrupt groups.
volatile uint32_t INTR_EN_CLR
Definition: sdl_vim.h:157
volatile uint32_t PID
Definition: sdl_vim.h:171
volatile uint32_t DEDVEC
Definition: sdl_vim.h:175
volatile uint32_t INTR_EN_SET
Definition: sdl_vim.h:156
uint32_t SDL_VIM_getFiqVectorAddress(SDL_vimRegs *pRegs)
Get the current FIQ vector address.
#define SDL_VIM_NUM_INTRS_PER_GROUP
Definition: sdl_vim.h:92
int32_t SDL_VIM_setIntrPending(SDL_vimRegs *pRegs, uint32_t intrNum)
Set the raw interrupt status bit for the specified interrupt.
uint32_t SDL_VimIntrType
This enumerator defines the possible interrupt types. Each source interrupt is either an active high ...
Definition: sdl_vim.h:102
int32_t SDL_VIM_verifyCfgIntr(SDL_vimRegs *pRegs, uint32_t intrNum, uint32_t pri, SDL_VimIntrMap intrMap, SDL_VimIntrType intrType, uint32_t vecAddr)
Read back Verify Configure a source interrupt.
int32_t SDL_VIM_getStaticRegs(SDL_vimRegs *pRegs, SDL_vimStaticRegs *pStaticRegs)
Read back of static registers for VIM.
uint32_t SDL_VIM_getGroupIntrPending(SDL_vimRegs *pRegs, SDL_VimIntrMap intrMap, uint32_t groupNum, bool bMasked)
Get bit-mask of raw or masked interrupt status for all interrupts within a group. ...
This structure defines the static register groups identified for VIM.
Definition: sdl_vim.h:167
This structure defines the group registers identified for VIM static registers.
Definition: sdl_vim.h:155
volatile uint32_t INTMAP
Definition: sdl_vim.h:158
int32_t SDL_VIM_cfgIntr(SDL_vimRegs *pRegs, uint32_t intrNum, uint32_t pri, SDL_VimIntrMap intrMap, SDL_VimIntrType intrType, uint32_t vecAddr)
Configure a source interrupt using VIM.
int32_t SDL_VIM_setIntrEnable(SDL_vimRegs *pRegs, uint32_t intrNum, bool bEnable)
Enable or disable interrupt status mask for the specified interrupt.
volatile uint32_t INFO
Definition: sdl_vim.h:172