On Tue, Jan 30, 2007 at 04:55:35PM -0800, Frank Wu wrote: > Hi Andrew, > > It is very easy to get a SPI eeprom sample chip on line to be the SPI > device. > Maybe my question is not addressed clearly. What I want is how to use > SPI driver in eCos porting to at91sam7 evaluation board (I have the > board). Something like, > 1) Initialize the spi port > 2) write > 3) read > 4) use in interrupt/pulling mode
O.K. So you need to read the manual: http://ecos.sourceware.org/docs-latest/ref/io-spi.html There is already a driver for the AT91SAM7S and AT91SAM7X, so there is no need to write any new driver code. What you need is a structure for each device on the bus. eg see packages/devs/spi/arm/eb55/current/src/spi_eb55.c which declares a DataFlash device on the bus. And you need a device drives for the device, eg packages/disk/generic/mmc/current/src Unfortunately, i don't think there is a complete example in anoncvs of all the parts coming together for one development board :-( Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
