From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-embedded+bounces-3316-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1NVDyq-0001gp-4G
	for garchives@archives.gentoo.org; Thu, 14 Jan 2010 00:54:32 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id B834AE1224
	for <garchives@archives.gentoo.org>; Thu, 14 Jan 2010 00:54:31 +0000 (UTC)
Received: from mail.osagesoftware.com (osagesoftware.com [216.144.204.42])
	by pigeon.gentoo.org (Postfix) with ESMTP id 6A3C6E07F5
	for <gentoo-embedded@lists.gentoo.org>; Wed, 13 Jan 2010 23:52:41 +0000 (UTC)
Received: from osage.osagesoftware.com (osage.osagesoftware.com [192.168.1.10])
	by mail.osagesoftware.com (Postfix) with ESMTP id F0F5A7BC35
	for <gentoo-embedded@lists.gentoo.org>; Wed, 13 Jan 2010 18:52:40 -0500 (EST)
Date: Wed, 13 Jan 2010 18:52:40 -0500
From: David Relson <relson@osagesoftware.com>
To: gentoo-embedded@lists.gentoo.org
Subject: [gentoo-embedded] serial port handling question
Message-ID: <20100113185240.4bc9d721@osage.osagesoftware.com>
Organization: Osage Software Systems, Inc.
X-Mailer: Claws Mail 3.7.3 (GTK+ 2.16.6; x86_64-pc-linux-gnu)
Precedence: bulk
List-Post: <mailto:gentoo-embedded@lists.gentoo.org>
List-Help: <mailto:gentoo-embedded+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-embedded+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-embedded+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-embedded.gentoo.org>
X-BeenThere: gentoo-embedded@lists.gentoo.org
Reply-to: gentoo-embedded@lists.gentoo.org
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Archives-Salt: 0cbaa2a5-1566-4490-a8e0-2e516335b82e
X-Archives-Hash: b704b36ea5173d6c486a5527f35c6fcc

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