/* Configures the interrupt associated with the given source, using the specified mode and interrupt handler.  */
void AIC_ConfigureIT(unsigned int source, unsigned int mode, void(*handler)(void))
/* Configures the interrupt associated with the given source, using the specified mode and interrupt handler.  */
void AIC_ConfigureIT(unsigned int source, unsigned int mode, void(*handler)(void))
{
    AT91C_BASE_AIC->AIC_IDCR = 1 << source;
    AT91C_BASE_AIC->AIC_SMR[source] = mode;
    AT91C_BASE_AIC->AIC_SVR[source] = (unsigned int) handler;
    AT91C_BASE_AIC->AIC_ICCR = 1 << source;
}