bikashh
Full Member level 5
Dear friends,
i am configuring I2c in my project. but not able to understand it..
unsigned long install_irq( unsigned long IntNumber, void *HandlerAddr, unsigned long Priority )
{
unsigned long *vect_addr;
unsigned long *vect_prio;
VICIntEnClr = 1 << IntNumber; /* Disable Interrupt */
if ( IntNumber >= VIC_SIZE ) //if interrupt no not recognized
{
return ( FALSE );
}
else
{
/* find first un-assigned VIC address for the handler */
vect_addr = (unsigned long *)(VIC_BASE_ADDR + VECT_ADDR_INDEX + IntNumber*4);
vect_prio = (unsigned long *)(VIC_BASE_ADDR + VECT_PRIO_INDEX + IntNumber*4);
*vect_addr = (unsigned long)HandlerAddr; /* set interrupt vector */
*vect_prio = Priority;
VICIntEnable = 1 << IntNumber; /* Enable Interrupt */
return( TRUE );
}
}
also can we write the above routine like this for uart
VICVectAddr6 = (uint32_t)uart0ISR;
VICVectCntl6 = 15;
VICIntEnable = VIC_BIT(VIC_UART0);
thanks in advance
i am configuring I2c in my project. but not able to understand it..
unsigned long install_irq( unsigned long IntNumber, void *HandlerAddr, unsigned long Priority )
{
unsigned long *vect_addr;
unsigned long *vect_prio;
VICIntEnClr = 1 << IntNumber; /* Disable Interrupt */
if ( IntNumber >= VIC_SIZE ) //if interrupt no not recognized
{
return ( FALSE );
}
else
{
/* find first un-assigned VIC address for the handler */
vect_addr = (unsigned long *)(VIC_BASE_ADDR + VECT_ADDR_INDEX + IntNumber*4);
vect_prio = (unsigned long *)(VIC_BASE_ADDR + VECT_PRIO_INDEX + IntNumber*4);
*vect_addr = (unsigned long)HandlerAddr; /* set interrupt vector */
*vect_prio = Priority;
VICIntEnable = 1 << IntNumber; /* Enable Interrupt */
return( TRUE );
}
}
also can we write the above routine like this for uart
VICVectAddr6 = (uint32_t)uart0ISR;
VICVectCntl6 = 15;
VICIntEnable = VIC_BIT(VIC_UART0);
thanks in advance