[En-Nut-Discussion] Adding/Modifying Device Drivers

Ernst Stippl ernst at stippl.org
Wed Mar 21 20:33:31 CET 2007


Hello!


The documentation file dev_2at91__spi_8h.html describes the source
at91_spi.c
This is not a device driver, but a set of functions driving spi 0 on the
at91 architecture. Do they work for as an SW interface to SPI? 

I developed a device driver for an Ethernut 2.1 board some time ago and I
took the (avr) uart driver as an example.
It was not necessary to compile it with Nut/OS, I just included the
resulting source .c and .h files into my main program - that was good enough
for me.

The key was to understand the 2 structures NUTDEVICE and DCB. NUTDEVICE
needs to be set up to contain some basic information (the logical device
name, for example) and the addresses of the key functions of the driver.
(init, read, write control, ...)
On the other hand, NutRegisterDevice uses the address of the NUTDEVICE
structure to - register - the device and makes it possible "fopen" it by
using the "logical" name used in the NUTDEVICE structure.  

hth

Ernst

-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Andrew
Mieczkowski
Gesendet: Mittwoch, 21. März 2007 18:33
An: en-nut-discussion at egnite.de
Betreff: [En-Nut-Discussion] Adding/Modifying Device Drivers

Hello again,

     I apologize in advance for repeating some of the original information,
but I have done so in the attempt to add additional specificity and clarity
to my situation.

 

     I am using Nut/OS with an AT91SAM7XC256-EK board and I would like to
use the SPI as a communication method similar to the UART. I have the
Yagarto ARM toolchain installed, but I have been using the "make clean"
and "make install" to compile my program for the ARM so far.

 

    As the UART is so easily implemented, is there a similar driver for SPI
communication somewhere? I have extensively searched for SPI driver
implementations, but the only one I have been able to locate is the one for
a Memory Card. Although this driver exists, I seem to be unable to modify
the source and incorporate it into my project. When I was using the Ethernut
2 board, I could always "rebuild all", but the method to do so for the ARM
seems to be eluding me. I have also seen mention of modification of make
files to perform various functions, but has also not been as fruitful as I
had hoped.

 

   Any assistance or a point in the right direction would be greatly
appreciated.

 

Thanks Again,

 

 

Andrew Mieczkowski

 

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.12/724 - Release Date: 16.03.2007
12:12




More information about the En-Nut-Discussion mailing list