This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: Modifications to to ADC LPC24xx


Dear Uwe,

I was aiming to support both the lpc21xx and lpc22xx. I am planning
to setup a user selectable timer channel (T0 ch:0-3, T0 ch:0-1)  to start
the hardware conversion, and use the ADC ISR to place the individual 
conversions into the appropriate channel buffer. This is in contrast
to what I understand from your code i.e. to use the Timer interrupt to read
out all the contents of the individual data registers. (please correct me
if I am wrong)

The problem is that to support the lpc22xx and lpc22xx with 01 suffix
is almost the same as supporting lpc24xx. So even if the code is
split into lpc21xx/22xx and lpc24xx variants, there would be just
as many #if  #else #endif constructs in the lpc21xx/22xx code as
in a single lpc2xxx implementation.

So an option to suite everyone who might use the ADC driver for lpc2xxx
family would be:
a)
   - lpc24xx and lpc21xx/22xx with 01 suffix in the same code. 
        (there are nevertheless differences in the lpc22xx/24xx architecture)
   - lpc21xx/22xx code with no suffix in the same code
b)
  - single (all encompassing) lpc2xxx driver with #if constructs only in
    a few places. E.g. write separate group specific ISR, DSR, init etc.
    for the LPC24xx and lpc21xx/lpc22xx group with suffix and an other
    for the lpc21xx/lpc22xx group with no suffix. It might be wiser
    to use a few macros to control which larger chunk of code should be 
    implemented.

I tend to prefer the latter method.

Also from my experience as a newcomer to eCOS, I would expect lpc2xxx 
driver to support lpc21xx/22xx/24xx platforms.

Please let me know your thought. I am ready to copy it to a new location
if that serves best.


Regards,


Peter



----- Original Message ----
From: Uwe Kindler <uwe_kindler@web.de>
To: Peter Huszar <duci750@yahoo.com>
Cc: ecos-discuss@sourceware.org
Sent: Saturday, December 27, 2008 12:01:37 PM
Subject: Re: [ECOS] Re: Modifications to to ADC LPC24xx

Hello Peter,

I personally would prefer a LPC2xxx specific version of the ADC driver because of the hardware differences - but it is a matter of taste. Personally I'do not like a lot of #if #endif in the code. The LPC24xx differs in pin configuration, number of interrupt priorities and ADC hardware layout. I suggest to copy the existing code to a new location and to create a LPC2xxx specific ADC driver (should work for LPC21xx and LPC22xx varaiants ?)

Regards, Uwe

-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


      


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]