[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Serial interrupt programming
- From: fred smith <fredex fcshome stoneham ma us>
- To: "redhat-list redhat com" <redhat-list redhat com>
- Subject: Re: Serial interrupt programming
- Date: Fri Feb 1 07:01:07 2002
On Fri, Feb 01, 2002 at 09:31:11AM +0100, Fabio Degiovanni wrote:
> Hello,
> I would like to program a serial interrupt under Linux in an ANSI C
> code. Where can I found information and examples?
> Thank you
> Fabio Degiovanni
Are you trying to write your own device driver for a serial port? Or
are you just trying to write a C (or whatever) program that uses a
serial port?
Unless you are doing the first of those, you don't ever touch interrupts
on any Unix-like system. Any "real OS" will provide you with services for
using serial communications devices, and LInux certainly falls into that
category.
You open a serial port just like it was a file (which it is), set the
parameters (speed, parity, etc.) with ioctl() calls, then read()/write(),
and when you're done use close(), just like a file.
I suggest you look for the Linux Serial Programming HOWTO (that name is
from memory, it may be slightly different) for all the gory details.
Fred
--
---- Fred Smith -- fredex fcshome stoneham ma us -----------------------------
"For the word of God is living and active. Sharper than any double-edged
sword, it penetrates even to dividing soul and spirit, joints and marrow;
it judges the thoughts and attitudes of the heart."
---------------------------- Hebrews 4:12 (niv) ------------------------------
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]