From: "Rasmus Stougaard" <stou.nospam@gmail.com>
To: "Rasmus Stougaard" <stou.nospam@gmail.com>,
ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Problem reading buttons on AT91sam7s-ek
Date: Tue, 02 Oct 2007 13:04:00 -0000 [thread overview]
Message-ID: <dbc951020710020604x78903db7p14ed2eb367a534ec@mail.gmail.com> (raw)
In-Reply-To: <20071002114722.GA30037@lunn.ch>
> > // Enable the clock to the GPIO (enable input sampling)
> > HAL_WRITE_UINT32(AT91_PMC + AT91_PMC_PCER, AT91_PMC_PCER_PIOA);
>
> You only need to enable the clock once. You could move this outside of
> the read function.
Ok thanks again, will do that. I also plan to convert my example to a
macro, to save the overhead of making the function call.
>
> Maybe i should add a macro to var_io.h to enable/disable the clock?
That might be a good idea, or add a comment to
HAL_ARM_AT91_GPIO_CFG_DIRECTION
and
HAL_ARM_AT91_GPIO_GET
stating that the clock must be enabled to receive inputs. At least it
was not obvios to me, and others might benefit too :-)
By the way can you point me to an example/documentation of how to use
HAL_ARM_AT91_GPIO_CFG_INTERRUPT
I want to setup the buttons to generate interupts for handling user input.
I have found some domentation of how to set up ISR and DSR using
cyg_interrupt_create().
However, I can figure out how to map a GPIO pin to trigger the interrupt vector?
Cheers
Rasmus
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
next prev parent reply other threads:[~2007-10-02 13:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-01 12:27 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 [this message]
2007-10-02 13:40 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dbc951020710020604x78903db7p14ed2eb367a534ec@mail.gmail.com \
--to=stou.nospam@gmail.com \
--cc=ecos-discuss@ecos.sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).