📄 inth2.h
字号:
//##################################################################
// Highest Priority level to process the request
//##################################################################
//##################################################################
// Total Number of interrupts
//##################################################################
#define LEV1_INTH_NUMBER_OF_INTERRUPTS 32
#define LEV2_INTH_NUMBER_OF_INTERRUPTS 64
//##################################################################
// function header
//##################################################################
//########################################################################################
// NAME : INTH2_DisableOneIt
//
// DESCRIPTION : Disable one interrupt
//
// PARAMETERS : UWORD8 ItIndex
//
// RETURN VALUE: None
//
// LIMITATIONS : None
//########################################################################################
void INTH2_DisableOneIt(UWORD32 ItIndex);
//########################################################################################
// NAME : INTH2_EnableOneIt
//
// DESCRIPTION : Enable one interrupt
//
// PARAMETERS : UWORD8 ItIndex See interrupt_mapping.h
//
// Fiq_or_Irq: INTH_IRQ or INTH_FIQ
//
// RETURN VALUE: None
//
// LIMITATIONS : Must be called on Incoming IT
//########################################################################################
void INTH2_EnableOneIt(UWORD8 ItIndex, BOOL Fiq_or_Irq);
//#####################################################################
// NAME : GetAndTestResetExtInth
//
// DESCRIPTION : Test all the register at reset and store the result
//
// PARAMETERS : None
//
// RETURN VALUE : None
//
// LIMITATIONS : Result must be initialized
//#####################################################################
BOOL INTH2_GetAndTestResetLev2Inth(void);
//########################################################################################
// NAME : INTH2_GetCurrentIt
//
// DESCRIPTION : Get the current It and valid the next one
//
//
// PARAMETERS : Fiq_or_Irq: INTH_IRQ or INTH_FIQ
//
//
// RETURN VALUE: Number of the active and acknowledged Interrupt
//
// LIMITATIONS : Must be called on Incoming IT
//########################################################################################
UWORD8 INTH2_GetCurrentIt (BOOL Fiq_or_Irq);
//############################################################################
// NAME : INTH2_InitLevel
//
// DESCRIPTION : Writes Level Register (Mask or Unmask interrupt)
//
// PARAMETERS : UWORD8 ItIndex See interrupt_mapping.h
//
// BOOL Fiq_or_Irq INTH_FIQ or INTH_IRQ
//
// UWORD8 Priority from 0 to 15
//
// BOOL SensitiveEdge FALLING_EDGE_SENSITIVE or LOW_LEVEL_SENSITIVE
//
// RETURN VALUE: None
//
// LIMITATIONS : None
//############################################################################
void INTH2_InitLevel (UWORD8 ItIndex,
BOOL Fiq_or_Irq,
UWORD8 Priority,
BOOL SensitiveEdge);
//#####################################################################
// NAME : INTH2_TestResetValue
//
// DESCRIPTION : Call all the test and reset functions
//
// PARAMETERS : None
//
// RETURN VALUE : None
//
// LIMITATIONS : None
//#####################################################################
void INTH2_TestResetValue(void);
//#####################################################################
// NAME : INTH2_TestResetValue
//
// DESCRIPTION : Call all the test and reset functions
//
// PARAMETERS : None
//
// RETURN VALUE : None
//
// LIMITATIONS : None
//#####################################################################
void INTH2_TestResetValue(void);
//########################################################################################
// NAME : INTH2_ValidNextInterrupt
//
// DESCRIPTION : Valid the next IT depending on the current one
//
//
// PARAMETERS : Fiq_or_Irq: INTH_IRQ or INTH_FIQ
//
//
// RETURN VALUE: None
//
// LIMITATIONS : Must be called on Incoming IT
//########################################################################################
void INTH2_ValidNextInterrupt (BOOL Fiq_or_Irq);
//########################################################################################
// NAME : INTH2_TestResetValue
//
// DESCRIPTION : Test the registers values at reset
//
//
// PARAMETERS : None
//
//
// RETURN VALUE: None
//
// LIMITATIONS : None
//########################################################################################
void INTH2_TestResetValue(void);
//########################################################################################
// NAME : INTH2_TestRegistersAccess
//
// DESCRIPTION : Test the registers values at reset
//
//
// PARAMETERS : None
//
//
// RETURN VALUE: None
//
// LIMITATIONS : None
//########################################################################################
void INTH2_TestRegistersAccess(void);
//########################################################################################
// NAME : INTH2_ClearInt
//
// DESCRIPTION : Clear the an IT when IT is not enabled (outside of a routine)
// Prefer use ValidNext in a routine
//
//
// PARAMETERS : ItNumber
//
//
// RETURN VALUE: None
//
// LIMITATIONS : None
//########################################################################################
void INTH2_ClearInt(UWORD8 ItIndex);
// ============================================
// IT macros
// ============================================
// ==========================================================================================
// Macro Name : INTH_AbortUnexpected
// Description : In the test that do not use the abort, this macro can check
// an unexpected abort returning an error.
#define INTH_AbortUnexpected() RES_Set(GENERAL_ABORT_UNEXPECTED);\
RES_GetFinal2(); \
RES_StopVhdl();
// ==========================================================================================
// Macro Name : INTH_IrqUnexpected
// Description : In the test that do not use the irq, this macro can check
// an unexpected irq returning an error and the irq number.
#define INTH_IrqUnexpected() RES_Set(GENERAL_IRQ_UNEXPECTED);\
RES_Set(DATA_STORE); \
RES_Set(INTH2_GetCurrentIt(INTH_IRQ)); \
INTH2_ValidNextInterrupt(INTH_IRQ);
// ==========================================================================================
// Macro Name : INTH_FiqUnexpected
// Description : In the test that do not use the fiq, this macro can check
// an unexpected fiq returning an error and the fiq number.
#define INTH_FiqUnexpected() RES_Set(GENERAL_FIQ_UNEXPECTED);\
RES_Set(DATA_STORE); \
RES_Set(INTH2_GetCurrentIt(INTH_FIQ)); \
INTH2_ValidNextInterrupt(INTH_FIQ);
// ==========================================================================================
// Macro Name : INTH_ExtIrqUnexpected
// Description : In the test that do not use the external irq, this macro can check
// an unexpected external irq returning an error and the ext irq number.
#define INTH_ExtIrqUnexpected() RES_Set(GENERAL_EXT_IRQ_UNEXPECTED); \
RES_Set(DATA_STORE); \
RES_Set(INTH2_Ack(INTH_IRQ,INTH_EXTERNAL)); \
INTH_ValidNext(INTH_IRQ,INTH_EXTERNAL);
// ==========================================================================================
// Macro Name : INTH_ExtFiqUnexpected
// Description : In the test that do not use the external fiq, this macro can check
// an unexpected external fiq returning an error and the ext fiq number.
#define INTH_ExtFiqUnexpected() RES_Set(GENERAL_EXT_FIQ_UNEXPECTED); \
RES_Set(DATA_STORE); \
RES_Set(INTH2_Ack(INTH_FIQ,INTH_EXTERNAL)); \
INTH_ValidNext(INTH_FIQ,INTH_EXTERNAL);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -