From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: Tony Howat <tony@i-r-genius.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Bit by bit parallel port control
Date: Mon, 11 Oct 2004 17:01:09 +0200 [thread overview]
Message-ID: <20041011150109.GN5033@lug-owl.de> (raw)
In-Reply-To: <20041011141018.M62685@i-r-genius.com>
[-- Attachment #1: Type: text/plain, Size: 1591 bytes --]
On Mon, 2004-10-11 15:10:13 +0100, Tony Howat <tony@i-r-genius.com>
wrote in message <20041011141018.M62685@i-r-genius.com>:
> I have tried using the /dev/port method and putb - I can seemingly set bits
> on the port OK. However, checking with a meter shows the line changing for a
> few milliseconds then returning to 0v. I need the levels to hold. I believe
> that's what SHOULD happen...
Don't mess with the hardware on your own! That's almost always a bug and
will cost you any later portability. Instead, just use the interface
Please use the userspace parport driver interface (provided by
ppdev.ko). Additionally it'll give you full portability to non-PC
hardware for free:-)
> There's plenty of sample code around, so I'm pretty confident I'm doing
> things right. My test code is here :
>
> http://www.i-r-genius.com/paralleltest.c
Not all that right:-) You access the hardware directly which is wrong.
Use the ppdev interface instead.
I've just put the program online
(http://lug-owl.de/~jbglaw/software/steckdose/steckdose.c) which
drives my relay box (basically a shift register + relay driver).
I guess the parport locking code isn't yet correct, but it should give
you a start to using ppdev...
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481 _ O _
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O
fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2004-10-11 15:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-11 14:10 Tony Howat
2004-10-11 15:01 ` Jan-Benedict Glaw [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041011150109.GN5033@lug-owl.de \
--to=jbglaw@lug-owl.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tony@i-r-genius.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®