[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] [RFC] portpins
From: |
Theodore A. Roth |
Subject: |
[avr-libc-dev] [RFC] portpins |
Date: |
Fri, 17 Oct 2003 12:56:14 -0700 (PDT) |
On Fri, 17 Oct 2003, Joerg Wunsch wrote:
> As Theodore A. Roth wrote:
>
> > Argh!! The datasheets aren't even self consistent on this
> > matter. The register summary's tend to use either Pxn or PORTxn for
> > port pin names. While all the actual descriptions of the ports use
> > the Pxn notation and all the example code (at least what I've looked
> > at) uses the Pxn notation.
>
> I also find it fairly silly to have ten thousand different ways of
> saying `0' in the header files (which just reflects the datasheets).
> I'd personally prefer PA0, PA1, ... PF7, but you're right, we must be
> careful to not break backwards compatibility.
>
> IMHO, all these silly single-digit definitions can be centralized in
> <avr/io.h>. The device-specific header files are included first, so
> you can then examine them like:
>
> #ifdef PORTA
> #define PA0 0
> #define PA1 1
> ...
> #define PA7 7
> #define PORTA0 0
> ...
> ...
> #define DDRA7 7
> #endif /* PORTA */
>
> This avoids the maintenance of them in each individual header file.
> Since the datasheets are inconsistent about PORTA0 vs. PA0, we should
> probably simply provide both, since it doesn't cost us anything to do
> so.
>
> Well, there are few chips that have `stripped down' ports that don't
> have all bits. Hmm, too bad, this probably defeats that idea...
>
How's the attached patch look? I don't intend for this to go into
1.0.1, but more likely 1.0.2 unless there's a compelling reason not to
wait.
I'm not against the Pxn defs in io*.h...
I've been working a gui program that will read in the device readers
and display all the register names and bit names in a table very
similar to the register summary in the datasheet. I'm hoping that this
will make creating/verifying of the device headers _much_ simpler. The
headers will need a bit of massaging though before they are parseable
by my program. It's getting close to useable, but not yet ready for
mass consumption yet...
Ted Roth
avr-libc-portpins.diff
Description: Text document
[avr-libc-dev] [bug #5799] error(?) in iom162.h, nobody, 2003/10/17