2008/11/25, Eur van Andel <[EMAIL PROTECTED]>: > > No way. We could make different versions via conditional compiling, but I > propose separate versions first, if need be with a list of supported PICs at > the Documentation section of the library. You're pretty confident that this is not the right way... How do you suggest that we determine the different versions of hardware periperhals? If we use the named bits of a register rather then the register as a whole, the compiler will help us to determine the different versions.
An other way is to create a script to determine all combinations of each register and - if we define which registers belong to which peripheral, it could determine all different hw versions of each peripheral. But if microchip did use different names for the same pins (or registers) then we get too much different versions (but we have to deal with them in the source anyway). And if there are peripheral with the same registers but different functionality (which might be the case with 16f88 i2c which looks the same as 16f877 i2c but does not support i2c-master), version numbers are lacking... > Interface proposal: > > CHANNELS = 8 > V_REF_PLUS = off > V_REF_MIN = off > > procedure set_channel(byte in channel) > function get_AD_result() return byte > function get_AD_result() return word > Can't tell you yet if this will do. There is no option to set the conversion time. The current adc-init sets the io ports and this is not so easy to determine with 16f88, since the supports 7 ADC ports in any combination. If we assume the user has to set the io direction himself (or more accurate: do not change it), we can ignore the CHANNEL setting and it will do for 16f88. > > Where the last two functions set the justification bit each time. I think we need different names for these functions. And why would they change the setting each time? And if it is set each time, I assume the user will have an option to tell *how* the justification is set? Joep --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
