⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bbu_dd_irqcsl.h

📁 DSP芯片自检测程序
💻 H
📖 第 1 页 / 共 2 页
字号:
#define IRQ_MASK_03                 0x00000008
#define IRQ_MASK_04                 0x00000010
#define IRQ_MASK_05                 0x00000020
#define IRQ_MASK_06                 0x00000040
#define IRQ_MASK_07                 0x00000080
#define IRQ_MASK_08                 0x00000100
#define IRQ_MASK_09                 0x00000200
#define IRQ_MASK_10                 0x00000400
#define IRQ_MASK_11                 0x00000800
#define IRQ_MASK_12                 0x00001000
#define IRQ_MASK_13                 0x00002000
#define IRQ_MASK_14                 0x00004000
#define IRQ_MASK_15                 0x00008000
/*----------------------------------------------------------------------------*/

/******************************************************************************\
* global variable definitions for IRQ module
\******************************************************************************/
CSLAPI Uint32 _IRQ_eventTable[IRQ_EVENT_CNT+1];
CSLAPI Uint32 _IRQ_intTable[IRQ_INT_CNT];
/*----------------------------------------------------------------------------*/

/******************************************************************************\
* Interrupt inline function declarations
\******************************************************************************/
IDECL void   IRQ_enable(Uint32 eventId);
IDECL Uint32 IRQ_disable(Uint32 eventId);
IDECL void   IRQ_restore(Uint32 eventId, Uint32 ie);
IDECL void   IRQ_set(Uint32 eventId);
IDECL void   IRQ_clear(Uint32 eventId);
IDECL Uint32 IRQ_test(Uint32 eventId);
IDECL void   IRQ_reset(Uint32 eventId);
IDECL void   IRQ_resetAll();
IDECL void   IRQ_globalEnable();
IDECL Uint32 IRQ_globalDisable();
IDECL void   IRQ_globalRestore(Uint32 gie);
IDECL void   IRQ_nmiEnable();
IDECL void   IRQ_nmiDisable();

/******************************************************************************\
* Interrupt inline function definitions
\******************************************************************************/
/* Enables event interrupt by modifying the interrupt enable register (IER)   */
/* If the event is not mapped to an interrupt, then no action is taken        */
IDECL void IRQ_enable(Uint32 eventId)
{
    IER |= _IRQ_eventTable[eventId];
}
/*----------------------------------------------------------------------------*/

/* Disables the interrupt associated with the specified event by modifying    */
/* IER register. If the event is not mapped to an interrupt, then no action   */
/* is taken.                                                                  */
/* Returns the old event interrupt state (enable or disable)                  */                                      
IDECL Uint32 IRQ_disable(Uint32 eventId)
{
Uint32 ie;

    ie = IER & _IRQ_eventTable[eventId];
    IER &= ~_IRQ_eventTable[eventId];
  
    return ie;
}
/*----------------------------------------------------------------------------*/

/* Restores the event interrupt state. Be useful for temporarily disabling an */
/* event interrupt, then restoring it back.                                   */
IDECL void IRQ_restore(Uint32 eventId, Uint32 ie)
{
    if (ie)
    {
        IER |= _IRQ_eventTable[eventId];
    }
    else
    {
        IER &= ~_IRQ_eventTable[eventId];
    }
}
/*----------------------------------------------------------------------------*/

/* Sets the specified event by writing to the appropriate bit in the interrupt*/
/* set register (ISR). This allows software triggering of events interrupt.   */
/* If the event is not mapped to an interrupt, then no action is taken.       */
IDECL void IRQ_set(Uint32 eventId)
{
    ISR = _IRQ_eventTable[eventId];
}
/*----------------------------------------------------------------------------*/

/* Clears the event interrupt flag (IFR) by writing to the appropriate bit in */
/* the interrupt clear register (ICR). If the event is not mapped to an       */
/* interrupt, then no action is taken.                                        */
IDECL void IRQ_clear(Uint32 eventId)
{
    ICR = _IRQ_eventTable[eventId];
}
/*----------------------------------------------------------------------------*/

/* Test an event to see if its flag is set in the interrupt flag register     */
/* (IFR). If the event is not mapped to an interrupt, then no action is taken */
/* and this function returns 0.                                               */
/* Returns event interrupt flag: 0 or 1                                       */
IDECL Uint32 IRQ_test(Uint32 eventId)
{
    return (Uint32)((IFR & _IRQ_eventTable[eventId]) ? 1 : 0);
}
/*----------------------------------------------------------------------------*/

/* The function serves as a shortcut method of performing IRQ_disable(eventId)*/
/* followed by IRQ_clear(eventId).                                            */ 
IDECL void IRQ_reset(Uint32 eventId)
{
    IER &= ~_IRQ_eventTable[eventId];
    ICR = _IRQ_eventTable[eventId];
}
/*----------------------------------------------------------------------------*/

/* Resets all the interrupt events by disabling the global interrupt enable   */
/* bit (GIE) and then disabling and clearing all the interrupt bits of IER and*/
/* IFR.                                                                       */
IDECL void IRQ_resetAll()
{
    CHIP_CFSET(CSR,GIE,0);
    CHIP_CRSET(IER,0x00000000);
    CHIP_CRSET(ICR,0xFFFFFFFF);
}
/*----------------------------------------------------------------------------*/

/* The function globally enables interrupts by setting the GIE bit of the CSR */
/* register to 1.This function must be called if the GIE bit is not set before*/
/* enabling an interrupt event. See also IRQ_globalDisable();                 */
IDECL void IRQ_globalEnable()
{   
    CHIP_CFSET(CSR,GIE,1);
}
/*----------------------------------------------------------------------------*/

/* This function globally disables interrupts by clearing the GIE bit of the  */
/* CSR register. The old value of GIE is returned. Be useful for temporarily  */
/* disabling global interrupts, then restoring them back.                     */ 
IDECL Uint32 IRQ_globalDisable()
{
Uint32 gie;

    gie = CHIP_CFGET(CSR,GIE);
    CHIP_CFSET(CSR,GIE,0);
  
    return gie;
}
/*----------------------------------------------------------------------------*/

/* This function restores the global interrupt enable state to the value      */
/* passed in by writing to the GIE bit of the CSR register. Be useful for     */
/* temporarily disabling global interrupts, then restoring them back.         */
IDECL void IRQ_globalRestore(Uint32 gie)
{
    CHIP_CFSET(CSR,GIE,gie);
}
/*----------------------------------------------------------------------------*/

/* This function enables the NMI interrupt by setting the corresponding bit   */
/* in IER register to 1.                                                      */
IDECL void IRQ_nmiEnable()
{
    IER |= 0x00000002;
}
/*----------------------------------------------------------------------------*/

/* This function disables the NMI interrupt by setting the corresponding bit  */
/* in IER register to 0.                                                      */
IDECL void IRQ_nmiDisable()
{
    IER &= ~0x00000002;
}
/*----------------------------------------------------------------------------*/

/******************************************************************************\
* EDMA Global Typedef Declarations for interrupt
\******************************************************************************/  
typedef void (*EDMA_IntHandler)(Sint32 tccNum);
/*----------------------------------------------------------------------------*/

#endif /* _BBU_DD_IRQCSL_H_ */
/******************************************************************************\
* End of BBU_DD_IrqCsl.h
\******************************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -