This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Wallclock device driver structure?
- From: Jonathan Larmour <jlarmour at redhat dot com>
- To: Grant Edwards <grante at visi dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Wed, 05 Dec 2001 07:44:48 +0000
- Subject: Re: [ECOS] Wallclock device driver structure?
- References: <20011204111802.A25774@visi.com>
Grant Edwards wrote:
>
> I'm looking into writing a driver for a Dallas DS1511W RTC and
> I've noticed that the other Dallas drivers are done in two
> different ways: one is a C++ file that's compiled and linked,
> and the other is an ".inl" file that is apparently included by
> the wallclock wrapper functions.
>
> Is there any reason to prefer one method over the other?
The C++ files are used when the driver is completely board specific. The
.inl files are used when trying to write a generic driver, i.e. a driver
that can be instantiated slightly differently on different platforms.
Ideally most drivers would start off as "generic" just in case that chipset
is reused, but that doesn't often happen. Jesper is our hero for stepping
up to do this type of stuff normally.
If you are intending to contribute this back, base it off the .inl style,
with a generic package, and a separate instantiation. If your doing it
purely for yourself, you'll probably find the .cxx version a little
simpler, although not that much frankly.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine