[En-Nut-Discussion] Device Drivers

Ed Anuff ed at anuff.com
Mon Aug 16 18:57:29 CEST 2004


Thanks, the debug0.c file is exactly what I was looking for as an
example.

I am looking to be able to use printf/scanf which is why I was looking
at creating a device driver.  The FTDI chip simplifies the USB
communications to the point where it really can be used in that fashion.

Ed


-----Original Message-----
Date: Mon, 16 Aug 2004 10:37:29 +0200
From: Harald Kipp <harald.kipp at egnite.de>
Subject: Re: [En-Nut-Discussion] Device Drivers
To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
Message-ID: <5.1.1.6.0.20040816102429.0323b658 at egnite.de>
Content-Type: text/plain; charset="us-ascii"; format=flowed

Hi Ed,

the main thing a driver provides is the NUTDEVICE
structure. Very simple drivers are devDebug0 and
devDebug1. They are output only and do not use
interrupts.

Please note, that Nut/OS drivers are required only,
if you want to make use of printf/scanf etc. This
may not fit to USB. Some interfaces need more than
just simple I/O. For example twif.c (I2C) uses a
completely different API. It's not a driver in the
sense of providing standard I/O access.

Don't be mislead by PC OS drivers. Their major task
is to run in kernel mode. With AVR, there's no memory
or I/O protection. Thus, no driver is required to
access the hardware or to process interrupts.

Harald

At 17:10 15.08.2004 -0700, you wrote:
>Content-class: urn:content-classes:message
>Content-Type: multipart/alternative;
>         boundary="----_=_NextPart_001_01C48325.60E87B36"
>
>What are the basics of writing a device driver?  I ve got an ATMega128 
>board with an FTDI245 USB chip on it and I d like to create a simple 
>driver for it so that I can read and write to it using standard i/o.  I
m 
>trying to follow the uart driver code as an example but I m having some

>difficulty is figuring it out.  Is there any sort of simple example 
>available or any additional information that could be helpful?
>
>
>
>Ed






More information about the En-Nut-Discussion mailing list