Gentoo Archives: gentoo-embedded

From: David Relson <relson@×××××××××××××.com>
To: gentoo-embedded@l.g.o
Subject: [gentoo-embedded] serial port handling question
Date: Thu, 14 Jan 2010 00:54:32
Message-Id: 20100113185240.4bc9d721@osage.osagesoftware.com
1 G'day,
2
3 I'm porting some old DOS code to Linux for a medical device that is
4 being upgraded. Among other goodies, it has a sensor that sends data at
5 115KB to an onboard NS16550A (or equivalent).
6
7 The sensor is controlled (in part) by setting RTS on and off. I looked
8 high and low (pun intended) for an ioctl or similar call that would
9 allow this level of control and couldn't find anything. I finally ended
10 up using the ollowing lines of code:
11
12 outb(inportb(MCR) | 0x02, MCR); //DTR,RTS=ON
13 outb(inportb(MCR) & ~0x02, MCR); //DTR=ON,RTS=OFF
14
15 Directly tweaking the I/O port runs against the grain, but it's the
16 only thing I've found that works.
17
18 Is there a better way to control the chip?
19
20 Regards,
21
22 David

Replies

Subject Author
Re: [gentoo-embedded] serial port handling question Peter Stuge <peter@×××××.se>
Re: [gentoo-embedded] serial port handling question Daniel Stonier <d.stonier@×××××.com>
Re: [gentoo-embedded] serial port handling question Bob Dunlop <bob.dunlop@×××××××××.uk>