Submittal of Modified Header files for I/O Register direct Assignment

Prepared by:  Chris Morse and Don Carveth,  Feb.10, 2002

We are releasing for general use and comment a set of revised header files that allow use of direct assignment operators for I/O register access, i.e. x = PORTA  or  PORTA = x, instead of inp(PORTA)  or outp(x, PORTA).  The method is also compatible with Imagecrafts methodology.

The new header files include a modified iomacros.h file that includes new macros that are compatible with those listed in the AVR-libc-reference (plus versions of macros in the original iomacros.h file but not listed, plus a few others).  All of the macros compile down to the most efficient instructions available and 16 bit assignment operations work as required.

In addition, a provision to use the original headers as is, is included and toggled by a compiler flag, the intent being that these files replace the current ones in upcoming releases of the AVR library.  If our new assignment mode is compatible enough then this provision could be eliminated later releases.

The attached zip file contains modified header files for io-avr.h, iomacros.h and all of the machine specific header files such as io2313.h, as well as instructions to install and use, and a discussion about the advantages of this method and why the existing header files should be replaced.

We have tested the basic operations but field testing is needed before they can be declared to be bulletproof.  Please direct any comments to either Chris (chris@morsetech.net) or Don Carveth(don@botgoodies.com).

We are sending this package to Marek, the current overseer of the AVR-GCC system, hoping that it becomes a part of the new release.

This process has been a model of cooperative development.  Take a look at these postings in the AVR GCC forum for the history of how we got to this point:  "Header files to allow use of Assignment operator on AVR Registers",  "I/O Register Access - Imagecraft".

Chris Morse and Don Carveth
