[comp.sys.amiga.programmer] ASDG DSB DTR control

DXB132@psuvm.psu.edu (06/20/91)

This information was posted to the net a while ago, but it slipped by me.
Could someone with documentation on the ASDG dual serial board describe
the command extensions defined by ASDG for controlling DTR? I'd like to
be compatible. Thanks!!!

-- Dan Babcock

mcr@Sandelman.OCUnix.on.ca (Michael Richardson) (06/22/91)

In article <91171.021857DXB132@psuvm.psu.edu> DXB132@psuvm.psu.edu writes:
>This information was posted to the net a while ago, but it slipped by me.
>Could someone with documentation on the ASDG dual serial board describe
>the command extensions defined by ASDG for controlling DTR? I'd like to
>be compatible. Thanks!!!

  My experience is that trying to send characters to the internal
serial port while the DTR is down occasionally crashes serial.device.
It has been awhile since I tried though. There is no problem sending
characters to the ASDG board while DTR is down. 

  From welmat/src/welmat/session/modemio.c:

/* DTR.c -- handle DTR */
/****************************************/
/* Set com DTR line                     */
/* FALSE = DTR off; TRUE = dtr on       */
/* I hate bit bashing.                  */
/****************************************/

SetInternalDTR(fd,set)
MHANDLE fd;
int set;
{
  struct CIA *Ciab;
  char tbuf[20];

#ifdef DTR_DEBUG
  sprintf(tbuf,"DTR is %d\n",set);
  M_DEBUG(M_DEBUG_FATAL,tbuf);
#endif
  Ciab=(struct CIA *)0xBFD000;
  Disable();
  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 */

  Enable();
}

/****************************************************/
/* ASDG Dual Serial Board (and presumably 4 board)  */
/*  DTR control support.                            */
/****************************************************/
#define SIOCMD_SETCTRLLINES 0x10
#define SIOB_RTSB  0
#define SIOB_DTRB  1
#define SIOB_RTSF  (1<<SIOB_RTSB)
#define SIOB_DTRF  (1<<SIOB_DTRB)

SetAsdgDTR(fd,set)
MHANDLE fd;
int set;
{
  register IOExtSer *ios;

  ios=&fd->IOutil;

  ios->IOSer.io_Command=SIOCMD_SETCTRLLINES;
  ios->IOSer.io_Offset=SIOB_DTRF;
  if(set==TRUE) {
    ios->IOSer.io_Length=SIOB_DTRF;
  }
  else {
    ios->IOSer.io_Length=0;
  }
  DoIO(ios);
}

/*************************************************/



-- 
   :!mcr!:            |  The postmaster never | So much mail, 
   Michael Richardson |    resolves twice.    |  so little time.
HOME: mcr@sandelman.ocunix.on.ca 	Bell: (613) 237-5629
    Small Ottawa nodes contact me about joining ocunix.on.ca!