Using the serial port for GPIO.

Ben Scott dragonhawk at gmail.com
Fri May 12 11:37:00 EDT 2006


  In addition to the other fine answers already given...

On 5/12/06, Scott Garman <sgarman at iname.com> wrote:
> Has anyone here ever used the Linux serial port drivers as general
> purpose I/O?

  Yes.  But not me.  :)

  Many UPSes use DSR, CD, CTS, etc., as signals for power failure, low
battery, etc.  They don't actually use RS-232 at all.  (Others do
actually send serial data.)  The software that monitors UPSes thus has
to do what you're describing.

> If I have no other options, my plan is to write a /proc kernel driver so
> user space programs can get access to this information ...

  I'm pretty sure you don't need to write a new driver.  All the
signals "from the modem" can be read, and most of the signals "to the
modem" can be set, using the existing serial driver.  Any modem
program (e.g., minicom) does this.

-- Ben




More information about the gnhlug-discuss mailing list