From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27114 invoked by alias); 31 Jan 2007 07:17:43 -0000 Received: (qmail 27104 invoked by uid 22791); 31 Jan 2007 07:17:42 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 31 Jan 2007 07:17:37 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1HC9in-0001pE-00; Wed, 31 Jan 2007 08:17:33 +0100 Date: Wed, 31 Jan 2007 07:17:00 -0000 To: Frank Wu Cc: ecos-discuss Message-ID: <20070131071733.GI22661@lunn.ch> Mail-Followup-To: Frank Wu , ecos-discuss References: <591a86200701301236l4e646c1cma2db1aa361bebea@mail.gmail.com> <20070130205126.GE22661@lunn.ch> <591a86200701301655n5763facwb31e7abd33dd6cf1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <591a86200701301655n5763facwb31e7abd33dd6cf1@mail.gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Andrew Lunn X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] at91sam7 spi test code X-SW-Source: 2007-01/txt/msg00182.txt.bz2 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