target/linux/at91/image/dfboot/src/include/lib_AT91RM9200.h
//*----------------------------------------------------------------------------
//* \fn    AT91F_AIC_ConfigureIt
//* \brief Interrupt Handler Initialization
//*----------------------------------------------------------------------------
\fn    AT91F_AIC_ConfigureIt
\brief Interrupt Handler Initialization
\ fn AT91F_AIC_ConfigureIt \ brief Interrupt Handler Initialization
static inline unsigned int AT91F_AIC_ConfigureIt (
	AT91PS_AIC pAic,  
	unsigned int irq_id,     
	unsigned int priority,   
	unsigned int src_type,   
	void (*newHandler) (void) ) 
{
	unsigned int oldHandler;
    unsigned int mask ;
    oldHandler = pAic->AIC_SVR[irq_id];
    mask = 0x1 << irq_id ;
    pAic->AIC_IDCR = mask ;
    pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ;
    pAic->AIC_SMR[irq_id] = src_type | priority  ;
    pAic->AIC_ICCR = mask ;
	return oldHandler;
}
static inline unsigned int AT91F_AIC_ConfigureIt ( AT91PS_AIC pAic , unsigned int irq_id , unsigned int priority , unsigned int src_type , void ( * newHandler ) ( void ) ) { unsigned int oldHandler ; unsigned int mask ; oldHandler = pAic -> AIC_SVR [ irq_id ] ; mask = 0x1 << irq_id ; pAic -> AIC_IDCR = mask ; pAic -> AIC_SVR [ irq_id ] = ( unsigned int ) newHandler ; pAic -> AIC_SMR [ irq_id ] = src_type | priority ; pAic -> AIC_ICCR = mask ; return oldHandler ; }
\fn    AT91F_AIC_ConfigureIt
\brief Interrupt Handler Initialization
\ fn AT91F_AIC_ConfigureIt \ brief Interrupt Handler Initialization
// \arg pointer to the AIC registers // \arg interrupt number to initialize // \arg priority to give to the interrupt // \arg activation and sense of activation // \arg address of the interrupt handler //* Disable the interrupt on the interrupt controller //* Save the interrupt handler routine pointer and the interrupt priority //* Store the Source Mode Register //* Clear the interrupt on the interrupt controller