__inline unsigned int AT91F_AIC_ConfigureIt (<br /> AT91PS_AIC pAic, // arg pointer to the AIC registers<br /> unsigned int irq_id, // arg interrupt number to initialize<br /> unsigned int priority, // arg priority to give to the interrupt<br /> unsigned int src_type, // arg activation and sense of activation<br /> void (*newHandler) (void) ) // arg address of the interrupt handler<br />{<br /> unsigned int oldHandler;<br /> unsigned int mask ;<br /><br /> oldHandler = pAic->AIC_SVR[irq_id];<br /><br /> mask = 0x1 << irq_id ;<br /> //* Disable the interrupt on the interrupt controller<br /> pAic->AIC_IDCR = mask ;<br /> //* Save the interrupt handler routine pointer and the interrupt priority<br /> pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ;<br /> //* Store the Source Mode Register<br /> pAic->AIC_SMR[irq_id] = src_type | priority ;<br /> //* Clear the interrupt on the interrupt controller<br /> pAic->AIC_ICCR = mask ;<br /><br /> return oldHandler;<br />}<br />这个函数具体在做什么?什么时候调用?为什么要返回oldHandler? |
|