[ECOS] How to integrate two different 16x5x DUART hardware into a application?

Andrew Lunn andrew@lunn.ch
Wed Sep 20 10:08:00 GMT 2006

On Wed, Sep 20, 2006 at 09:47:42AM +0000, wang cui wrote:
> On my target board, I use LPC2220 as processor, there is another Phlips 
> 16C2550B DUART chip.
> In my application, I should make use of 4 UART channels.
> As I looked over the serial infrastructure of eCos, I think it is hard to 
> use the "16x5x generic serial device drivers" for both chip concurrently.
> 1. The "ser_16x5x.c" rely on a "CYGDAT_IO_SERIAL_GENERIC_16X5X_INL", and 
> this macro has been defined in "ARM LPC2XXX serial device drivers" package. 
> How to add 16C2550B's description info to "ser_16x5x.c"?
> 2. "ser_16x5x.c" use "CYGPRI_IO_SERIAL_GENERIC_16X5X_STEP" macro to reflect 
> delta of UART registers. In LPC2XXX, the UART's register step is 4 bytes, 
> while on my target board, 16C2550B has been designed with register step 2 
> bytes. How to solve this condition?

A quick and dirty solution would be to duplicate the
CYGPKG_IO_SERIAL_GENERIC_16X5X package. I.E. make a second copy with
the name CYGPKG_IO_SERIAL_GENERIC_16X5X_DUP and rename all the CDL
variables in the second copy in the same way. 

Doing a clean solution so that one instance of the driver can drive
multiple 16x5 chips is going to take quiet a bit of work. 


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

More information about the Ecos-discuss mailing list