20 Oct 2004 11:24 AM |
|
I'm testing the LogicLoader API and I don't understand how do interrupt functions work. I founded html documentation in the sample_zoom_app example, where I can found more?
|
|
|
|
robinb@logicpd.comNew Member Posts:
20 Oct 2004 04:47 PM |
|
The interrupts use Lolo's interrupt handling mechanism.
To use interrupts, you should create an interrupt handler:
static int pcmcia_intr_handler(u_int intr, void *data, struct regs *regs){... intr_clear(IRQ_number);}
Then register the handler to an IRQ_number:
intr_register_handler(IRQ_number, pcmcia_intr_handler, NULL);
Enable your interrupt:
intr_enable(IRQ_number);
Enable global interrupts:
intr_set_mask(INTR_ENABLE);
|
|
|
|
21 Oct 2004 10:56 AM |
|
Thank you robinb, it's very clear.
I have tested it immediately.
I supposed the IRQ_number is uP Interrupt Source, indeed timer1 interrupt (IRQ_number 0x3D) works well.
I noted that if I use a wrong IRQ_number function intr_enable(IRQ_number) returns error printing:
enable_interrupt unknown intr xxxxxxxx
Only with the IRQ_number 0x26, 0x27, 0x30, 0x3D the function don't return error.
How can I use other interrupt source?
|
|
|
|
robinb@logicpd.comNew Member Posts:
01 Nov 2004 09:17 AM |
|
You raise a good point. Currently, Logicloader only supports enabling a small subset of possible interrupts. To use another interrupt source, you will need to write your own interrupt enabling routine. To write such a routine, you will need to read the processor's manual to determine what registers/bits need to be set to enable your interrupt and then set them in your code.
|
|
|
|