[SOLVED] please explain me the function to install irq

Status
Not open for further replies.

bikashh

Full Member level 5
Joined
Nov 28, 2009
Messages
264
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
india
Activity points
3,132
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
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…