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 ) id 1NVFsg-0006Hv-KJ for garchives@archives.gentoo.org; Thu, 14 Jan 2010 02:56:18 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A8653E092F; Thu, 14 Jan 2010 02:56:16 +0000 (UTC) Received: from mail-pz0-f199.google.com (mail-pz0-f199.google.com [209.85.222.199]) by pigeon.gentoo.org (Postfix) with ESMTP id 75C47E092F for ; Thu, 14 Jan 2010 02:56:16 +0000 (UTC) Received: by pzk37 with SMTP id 37so14638583pzk.10 for ; Wed, 13 Jan 2010 18:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=lE6t1WET9/TiKEWTh/JG6/4qxvmZ8xw2nAge6meumtU=; b=ovCIZH2zTf7gxQw6tUIpXazuKg9No6OvEPh43puQJQkNpoTfuUiqAJ0l28zPeRtgRK ryvAH3YKJz4wnZy2by7mEzNxsCnXGXdPSvKUejTl140BcoDN6ttWcYqa4XGVh9IC2BG/ bRsgMdtUDJRbVYRDEFEDOn4CgmD+JqZUuCs3M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=CxYaPxQcwIZSDZdcFp+bFyobvO3NwHZz9ZAeVXmmVs88EbsnLg/oShrNIjfJ6cwesm Qn3EuVXL8k60j5ftYVClFhtHgzyoEyz+AadcxGV3JdCwwiFntrGBXrcsoiMYAoe/mY9Z PftrdcB2/MVd+jWS6SLDzHG8DBddF7U/dHaOM= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-embedded@lists.gentoo.org Reply-to: gentoo-embedded@lists.gentoo.org MIME-Version: 1.0 Received: by 10.115.84.32 with SMTP id m32mr115461wal.140.1263437775075; Wed, 13 Jan 2010 18:56:15 -0800 (PST) In-Reply-To: <20100113185240.4bc9d721@osage.osagesoftware.com> References: <20100113185240.4bc9d721@osage.osagesoftware.com> Date: Thu, 14 Jan 2010 11:56:14 +0900 Message-ID: <27dfa3d1001131856u29a0b5e0s82001c90956b27c@mail.gmail.com> Subject: Re: [gentoo-embedded] serial port handling question From: Daniel Stonier To: gentoo-embedded@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: cff83103-a6da-411a-98fd-4c1a5108c224 X-Archives-Hash: 6d02f7e867e56e502bfada031adba6dc I've never actually used the RTS on - always had it off. But just in case you didn't find the details there's a setting in the termios options structure for rts - have you tried that? 'man termios' - look for CRTSCTS. I usually use a bit of code to set the flag off for my connections: ******************************* termios options; // Disable Flow control #if defined(CRTSCTS) =C2=A0 =C2=A0 options.c_cflag &=3D ~CRTSCTS; // Disable hardware flow contr= ol (old) #elif defined (CNEW_RTSCTS) =C2=A0 =C2=A0 options.c_cflag &=3D ~CNEW_RTSCTS; // Disable hardware flow c= ontrol (new) #endif tcsetattr(file_descriptor,TCSAFLUSH,&options); ******************************* Above, file_descriptor is the handle you get back from the previously called open(...). 2010/1/14 David Relson > > G'day, > > I'm porting some old DOS code to Linux for a medical device that is > being upgraded. =C2=A0Among other goodies, it has a sensor that sends dat= a 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: > > =C2=A0outb(inportb(MCR) | =C2=A00x02, MCR); =C2=A0//DTR,RTS=3DON > =C2=A0outb(inportb(MCR) & ~0x02, MCR); =C2=A0//DTR=3DON,RTS=3DOFF > > 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 > -- Phone : +82-10-5400-3296 (010-5400-3296) HomePage: http://snorriheim.dnsdojo.com/ Yujin Robot: http://www.yujinrobot.com/ Projects: http://snorriheim.dnsdojo.com/redmine/projects Embedded Control Libraries: http://snorriheim.dnsdojo.com/redmine/wiki/ecl