This is the mail archive of the ecos-discuss@sources.redhat.com 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]

more than one serial drivers


Yes. I have an Atmel AT91 with the two built-in USARTs
and an external 4-port USART controller. The EB40(A)
eCos port comes with a serial driver for the two
built-in USARTs.  I kind of cheated and just made the
config think that there are 6 USARTs instead of 2. But
I did of course need a different driver for the other
4. I just based the architecture on the at91_serial
driver.

I modified/added the following files:

C:\ecos-2.0b1\packages\hal\arm\at91\v2_0b1\include\hal_platform_ints.h
- hook in additional interrupts

ext_serial.c, ext_serial.h - added directly to
C:\ecos-2.0b1\packages\devs\serial\arm\at91\v2_0b1\src,
along side at91_serial.*. In the .c file, I just
followed the template from at91_serial.c and called my
ports CYGPKG_IO_SERIAL_EXT_USART_SERIAL2-5

C:\ecos-2.0b1\packages\devs\serial\arm\at91\v2_0b1\cdl\ser_arm_at91.cdl
- added 4 more cdl_components. This is what 1 of them
looks like

    cdl_component CYGPKG_IO_SERIAL_EXT_USART_SERIAL2 {
	display       "External serial port 2 driver"
	flavor        bool
	default_value 2

	description   "
	    This option includes the serial device driver for
the External 
	    port 2 (serial C)."

	cdl_option CYGDAT_IO_SERIAL_EXT_USART_SERIAL2_NAME {
	    display       "Device name for External serial
port 2 driver"
	    flavor        data
	    default_value {"\"/dev/ser2\""}
	    description   "
		This option specifies the name of the serial device
for the 
		External port 2."
	}

	cdl_option CYGNUM_IO_SERIAL_EXT_USART_SERIAL2_BAUD {
	    display       "Baud rate for the External serial
port 2 driver"
	    flavor        data
	    legal_values  { 50 75 110 "134_5" 150 200 300 600
1200 1800 2400 3600
			  4800 7200 9600 14400 19200 38400 57600 115200
230400
	    }
	    default_value 19200
	    description   "
		This option specifies the default baud rate (speed)
for the 
		External port 2."
	}

	cdl_option CYGNUM_IO_SERIAL_EXT_USART_SERIAL2_BUFSIZE
{
	    display       "Buffer size for the External
serial port 2 driver"
	    flavor        data
	    legal_values  0 to 8192
	    default_value 128
	    description   "
		This option specifies the size of the internal
buffers used 
		for the External port 2."
	}
    }

This might not be the best way, but it's one way!

Good luck.



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


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