Hi Joep,

On 01/03/12 06:13 pm, Joep Suijs wrote:

2012/1/3 Rob Hamerling<[email protected]>:

However some (newer) PICs do not use the name RCREG1 but RC1REG (and the
same naming convention for other USART registers). Although this seems a
better naming convention to me, at the moment it is used for a minority of
PICs. So it seems we need to add another alias RCREG1 for RC1REG (etc for
related registers).

If this is the best option, we could adopt this as the jallib standard
way to name similar registers.

One reason to have multiple aliases for the same register or pin is to support similar libraries of different origin (using different names). It would be better to modify the library to use a single 'standard' name, but we have to agree about names and someone has to do the migration... (while some authors forbid that!)

Take serial libraries: it is nice to be able to use a library written for PICs with a single USART (using unnumbered register names) also for (the first USART of) PICs with 2 USARTs. Almost as nice would it be to be able to use a library supporting 2 USARTs for a PIC with 1 USART. So multiple aliases are a nice service of the device files.

In stead of adding aliasses to each device file, we could also have
them in the library for the registers and fields used in that library.
Especially the mapping of rcreg to rcreg1 (or the other way around) is
obvious and would simplify the device files.

The main goal of the device files is - if possible - to hide differences between PICs for libraries and user programs. But it should also allow a program or library) to use PIC specific features! I don't think a library needs to declare aliases, since it is supposed to use standard(!) names.

One reason for the growing amount of aliases is that we want to be able to use existing libraries for new PICs with different naming conventions or with more modules or features than forseen at the time the library was designed (e.g. the extended midrange PICs).

Regards, Rob.

PS: I'm not afraid that compiler cannot handle the many aliases. And adding aliases itself is not the main problem! Preventing conflicts (such as duplicate names) takes a lot of time because of the many differences between PICs.



--
R. Hamerling, Netherlands --- http://www.robh.nl

--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to