打印

ARM中断函数配置问题

[复制链接]
1343|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
kingjie|  楼主 | 2007-5-5 21:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
__inline unsigned int AT91F_AIC_ConfigureIt (
    AT91PS_AIC pAic,  // arg pointer to the AIC registers
    unsigned int irq_id,     // arg interrupt number to initialize
    unsigned int priority,   // arg priority to give to the interrupt
    unsigned int src_type,   // arg activation and sense of activation
    void (*newHandler) (void) ) // arg address of the interrupt handler
{
    unsigned int oldHandler;
    unsigned int mask ;

    oldHandler = pAic->AIC_SVR[irq_id];

    mask = 0x1 << irq_id ;
    //* Disable the interrupt on the interrupt controller
    pAic->AIC_IDCR = mask ;
    //* Save the interrupt handler routine pointer and the interrupt priority
    pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ;
    //* Store the Source Mode Register
    pAic->AIC_SMR[irq_id] = src_type | priority  ;
    //* Clear the interrupt on the interrupt controller
    pAic->AIC_ICCR = mask ;

    return oldHandler;
}
这个函数具体在做什么?什么时候调用?为什么要返回oldHandler?

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

5

帖子

1

粉丝