[En-Nut-Discussion] Simple question about AT91SAM7X-EK

Matt Wood mattwood2000 at gmx.net
Sun Nov 5 20:23:39 CET 2006

Thanks Tim, that cleared things up for me.  Matt.

Tim DeBaillie wrote:
> On Thu, 2 Nov 2006, Matt Wood wrote:
>> Hi everybody, this is a simple question I'm sure, but its always the 
>> stupid one's that are the hardest for me :)  I cant seem to 
>> understand how to use the GPIO on the SAM7X board with Nut/OS.  All I 
>> want to be able to do is to turn a LED on and off, and sample input 
>> from the joystick switch.  The Nut/OS API docs are a little confusing 
>> to me and there is no example of this in any of the included exampmle 
>> programs. They do all the complicated stuff though.  Could someone 
>> please provide a code example for port I/O control on the SAM7X-EK 
>> board?  Thanks in advance.  Matt.
> Tunrs on an LED at pin PB20, which is on the SAM7x256 Eval Kit.
> outr(PIOB_PER, 0x00100000); //enable pio control
> outr(PIOB_OER, 0x00100000); //enable the output on the I/O line
> outr(PIOB_SODR, 0x00100000); //enable the led
> then to turn it off, you just do
> outr(PIOB_CODR, 0x00100000); //disable the led
> Cheers,
> Tim
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion

More information about the En-Nut-Discussion mailing list