avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] [bug #5799] error(?) in iom162.h


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] [bug #5799] error(?) in iom162.h
Date: Fri, 17 Oct 2003 21:34:40 +0200
User-agent: Mutt/1.2.5i

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...
-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]