Issue 24: Migration: i2c
http://code.google.com/p/jallib/issues/detail?id=24

Comment #2 by jsuijs:
> Comment #1 by sebastien.lelong:
> Stef has a great i2c software lib, works nice, needs improvements
> particularly about
> delay procedures. This will save us time:
>
> http://oase.uci.ru.nl/~mientki/pic-tools/jal/libs2/i2c_software.jal
Did you ever take a look at the software layer on top of this?
In i2c_main_defs you can specify:
       const byte I2C_port = I2C_HW  ;either I2C_HW or I2C_SW
and this maps  the higher level routines to either library.

Pro: a generic library (e.g. to communicate with an i2c eeprom) can be used  
with
both the hw and sw implemantation and, since both libs have unique  
procedure names,
they can also be used at the same time by advanced users. (an other  
occurance of the
same feature is that you can switch libraries without adapting your code).
But this comes at a price: some extra code (to copy the parameters and jump  
to the
next procedure) and extra RAM usage (for the calling parameters).

With serial_hardware, we ignored the fact that there is also a software  
version and
code to glue this together. We could do the same for the base i2c lib, but  
if we
want higher-level routines, we can't.

Options:
1- Give the procedures in HW and SW the same name and include the one you  
need.
Pro: efficient code.
Con: SW and HW can't be used at the same time.

2- Keep the above level of Stef
Pro/Con: see above

3- Duplicate the above lib for both HW and SW.

Please let me know your opinion.

(@Seb: i2c slave is not on my list yet, since for beginners, it's even to  
complex to
use. But I'll am curious what the differences are between your and my own
implementation!)

Joep




-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
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