avr-gcc-list
[Top][All Lists]
Advanced

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

RE: [avr-gcc-list] port access with avr-gdb


From: Larry Barello
Subject: RE: [avr-gcc-list] port access with avr-gdb
Date: Thu, 17 Jun 2004 06:19:28 -0700

1. I did the bit fields in all caps simply to mirror the Atmel data sheet.
I was typing in fast after dinner on Sunday...  Personally, I don't like the
fact that there is PINC0-7, PINB0-7, etc.  I would be happy with something
like avr-ioreg.portb.bit0 or something like that.

2. special function reg, reading UDR, etc.  Well, you have that problem
regardless how you access the register, right?  The alternative is to have a
struct/union for each register, or peripheral so you can't accidentally dump
the entire struct.  I have not used GDB (I wish to change that...) and the
struct I posted was a quick copy of the Atmel register description page -
hence the "all in one" nature.

3. collisions between #defines and the struct.  Well, yeah, how to deal with
that.  I dunno.  I suppose a start would be to make the struct all lower
case...

I get the feeling that having structs for peripherals & registers makes
sense and perhaps will work with some modifications.  As for "getting it
right", maybe #2 also helps here: With each peripheral carefully defined and
then cast to a proper address pointer it would be easier to get the entire
map correct.  It would be easier to generate new maps since the vast
majority of registers, bits and their location in the map are the same from
processor to processor.  One could just pick & choose which struct to use...
I think David Brown's examples point the way.



reply via email to

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