[En-Nut-Discussion] SAM7256-ex interrupt

Lars Tore Skau larstore at gmail.com
Thu May 8 09:27:37 CEST 2008


I am using GPIO interrupt on the Olimex SAM9260 card.. i guess it should the
sam7 should be quite similar. Maybe this code could help you on your way..it
will enable interrupt on pin "DOWN" connected to PIOB


 outr(PMC_PCER, _BV(PIOB_ID)); //enable clock
 outr(PIOB_PER, _BV(DOWN)); //Enable PIO
 outr(PIOB_ODR, _BV(DOWN)); //Output disable, in other words, enable :)
 outr(PIOB_IER, _BV(DOWN)); //enable interrupt on UP
 inb(PIOB_ISR); //read to clear register
 NutRegisterIrqHandler(&sig_PIO, button_isr, 0);
 NutIrqSetPriority(&sig_PIO, 1);
 NutIrqSetMode(&sig_PIO, NUT_IRQMODE_LOWLEVEL);
 NutIrqEnable(&sig_PIO);
 outr(AIC_IECR, _BV(PIOB_ID));

LT


On Wed, May 7, 2008 at 10:31 PM, Andreas Wickström <
andreas.wickstroem at spray.se> wrote:

> Hi
>
> Has anyone tried to use gpio or irq interrupt with the olimex card. If
> someone has got some working code for that I would very much like to have
> that or an explanation in how to activate a gpio interrupt.
>
> /Andreas
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>



More information about the En-Nut-Discussion mailing list