Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] please explain me the function to install irq

Status
Not open for further replies.

bikashh

Full Member level 5
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top