🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #11223

Re: DTR and serial.device

#11223
From: Marco Papa
Date: Sun, 29 Jan 1989 06:27
52 lines
2249 bytes
In article <10511@well.UUCP> jimbo@well.UUCP (Jim Bolton) writes:
>I would like a bit of help concerning the Amiga's RS-232 port and serial
>device.  I hope someone can help answer my question.
>I've almost completed a bbs/conference application and early today was
>looking at the way I handle DTR.  Currently to drop DTR I close the serial
>device, wait 1 second, and then reopen the serial device.
....
>So, I would like to know if it is possible to inhibit DTR on the Amiga's
>RS-232 serial port and if so could you point me in the right direction.

This is some code that might be helpful to you. [Gee, I come back after a week
at the MIT X Conference and I am back 350 messages, gulp!].

/*
 * dtr.c -- handle DTR
 */

#include <exec/types.h>
#include <hardware/cia.h>

/*********************************/
/* set com DTR line              */
/* false = DTR off; DTR = dtr on */
/*********************************/

static struct CIA *Ciab;		/* this breaks the 1.2 cia.h include */

SetDTR(set)
  int  set;
{
  Ciab = (struct CIA *) 0xBFD000;
  Forbid();
  Ciab->ciaddra |= CIAF_COMDTR; /* set DTR as output */
  if (set) Ciab->ciapra &= ~CIAF_COMDTR; /* set DTR low */
     else  Ciab->ciapra |=  CIAF_COMDTR; /* set DTR high */
  Permit();
}

DropDTR()
{
   SetDTR(FALSE);	/* drop DTR */
   Delay(2L);		/* wait 40 msec. */
   SetDTR(TRUE);	/* set DTR */
}

Enjoy.

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
 "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID: <15000@oberon.USC.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!elroy!orion.cf.uci.edu!oberon!pollux.usc.edu!papa
References: <10511@well.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!elroy!orion.cf.uci.edu!oberon!pollux.usc.edu!papa
From: papa@pollux.usc.edu (Marco Papa)
Newsgroups: comp.sys.amiga.tech
Subject: Re: DTR and serial.device
Keywords: serial, RS232, modem
Message-ID: <15000@oberon.USC.EDU>
Date: 29 Jan 89 06:27:33 GMT
References: <10511@well.UUCP>
Sender: news@oberon.USC.EDU
Reply-To: papa@pollux.usc.edu (Marco Papa)
Distribution: usa
Organization: Felsina Software, Los Angeles, CA
Lines: 52