public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Problem reading buttons on AT91sam7s-ek
@ 2007-10-01 12:27 Rasmus Stougaard
  2007-10-01 14:28 ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Rasmus Stougaard @ 2007-10-01 12:27 UTC (permalink / raw)
  To: ecos-discuss

Hi

I am trying to read the state of the buttons on a AT91sam7s-ek
evaluation kit from atmel.

I figure that something like:

    cyg_uint32 value;
    HAL_ARM_AT91_GPIO_CFG_DIRECTION(AT91_GPIO_PA20, AT91_PIN_IN);
    HAL_ARM_AT91_GPIO_CFG_PULLUP(AT91_GPIO_PA20, AT91_PIN_PULLUP_ENABLE);
    HAL_ARM_AT91_GPIO_GET(AT91_GPIO_PA20, value);
    trace(" AT91_GPIO_PA20 %d\n", value);

Should configure the pin for input and print the current state of the
of the pin.

However, the state returned in value is always zero, so I must be
doing something wrong.

Any hints much apreciated.

Regards
Rasmus Stougaard

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-10-02 13:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-01 12:27 [ECOS] Problem reading buttons on AT91sam7s-ek Rasmus Stougaard
2007-10-01 14:28 ` Andrew Lunn
2007-10-02 11:40   ` Rasmus Stougaard
2007-10-02 11:47     ` Andrew Lunn
2007-10-02 13:04       ` Rasmus Stougaard
2007-10-02 13:40         ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).