public inbox for gentoo-embedded@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-embedded] serial port handling question
@ 2010-01-13 23:52 David Relson
  2010-01-14  2:55 ` Peter Stuge
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: David Relson @ 2010-01-13 23:52 UTC (permalink / raw
  To: gentoo-embedded

G'day,

I'm porting some old DOS code to Linux for a medical device that is
being upgraded.  Among other goodies, it has a sensor that sends data at
115KB to an onboard NS16550A (or equivalent).  

The sensor is controlled (in part) by setting RTS on and off. I looked
high and low (pun intended) for an ioctl or similar call that would
allow this level of control and couldn't find anything. I finally ended
up using the ollowing lines of code: 

 outb(inportb(MCR) |  0x02, MCR);  //DTR,RTS=ON
 outb(inportb(MCR) & ~0x02, MCR);  //DTR=ON,RTS=OFF

Directly tweaking the I/O port runs against the grain, but it's the
only thing I've found that works.

Is there a better way to control the chip?

Regards,

David



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-01-14 16:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-13 23:52 [gentoo-embedded] serial port handling question David Relson
2010-01-14  2:55 ` Peter Stuge
2010-01-14  4:30   ` David Relson
2010-01-14  5:08     ` Peter Stuge
2010-01-14 10:53       ` Peter Bell
2010-01-14  2:56 ` Daniel Stonier
2010-01-14  3:47   ` Peter Stuge
2010-01-14  4:09     ` David Relson
2010-01-14 10:05 ` Bob Dunlop
2010-01-14 12:29   ` David Relson
2010-01-14 16:17     ` Peter Stuge
2010-01-14 16:21       ` Relson, David
2010-01-14 16:29         ` Peter Stuge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox