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;
174 
175 /* @} */
176 
194 uint32_t SDL_VIM_getRevision( SDL_vimRegs *pRegs );
195 
208 uint32_t SDL_VIM_getNumIntrs( SDL_vimRegs *pRegs );
209 
228 int32_t SDL_VIM_cfgIntr(
229  SDL_vimRegs *pRegs,
230  uint32_t intrNum,
231  uint32_t pri,
232  SDL_VimIntrMap intrMap,
233  SDL_VimIntrType intrType,
234  uint32_t vecAddr
235 );
236 
256 int32_t SDL_VIM_verifyCfgIntr(
257  SDL_vimRegs *pRegs,
258  uint32_t intrNum,
259  uint32_t pri,
260  SDL_VimIntrMap intrMap,
261  SDL_VimIntrType intrType,
262  uint32_t vecAddr
263 );
264 
265 
279 int32_t SDL_VIM_getIntrType( SDL_vimRegs *pRegs, uint32_t intrNum);
280 
296 void SDL_VIM_setDedVectorAddr( SDL_vimRegs *pRegs, uint32_t dedVectorAddr );
297 
314 int32_t SDL_VIM_getDedVectorAddr( SDL_vimRegs *pRegs, uint32_t *pDedVectorAddr );
315 
336  SDL_vimRegs *pRegs,
337  SDL_VimIntrMap intrMap,
338  uint32_t *pIntrNum,
339  uint32_t *pPri
340 );
341 
355 uint32_t SDL_VIM_getIrqVectorAddress( SDL_vimRegs *pRegs );
356 
371 uint32_t SDL_VIM_getFiqVectorAddress( SDL_vimRegs *pRegs );
372 
394 uint32_t SDL_VIM_getGroupsIntrPending( SDL_vimRegs *pRegs, SDL_VimIntrMap intrMap );
395 
425  SDL_vimRegs *pRegs,
426  SDL_VimIntrMap intrMap,
427  uint32_t groupNum,
428  bool bMasked
429 );
430 
443 int32_t SDL_VIM_setIntrPending( SDL_vimRegs *pRegs, uint32_t intrNum );
444 
457 int32_t SDL_VIM_clrIntrPending( SDL_vimRegs *pRegs, uint32_t intrNum );
458 
471 int32_t SDL_VIM_ackIntr( SDL_vimRegs *pRegs, SDL_VimIntrMap intrMap );
472 
490 int32_t SDL_VIM_setIntrEnable( SDL_vimRegs *pRegs, uint32_t intrNum, bool bEnable );
491 
507 int32_t SDL_VIM_getStaticRegs( SDL_vimRegs *pRegs, SDL_vimStaticRegs *pStaticRegs);
508 
509 /* @} */
510 
511 #ifdef __cplusplus
512 }
513 #endif /* extern "C" */
514 
515 #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.
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 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 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