home *** CD-ROM | disk | FTP | other *** search
- /* asisetv.c
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1985-1990 Greenleaf Software Inc. All Rights Reserved.
- *
- * int asisetv(port,addr8250,intn,addr8259,irq,brkdly,wmodem,wtime,rtime,
- * sh_ioad,sh_bmask)
- * int port; - Port 0..MAX_PORT
- * unsigned addr8250; - Absolute I/O Address of 8250 Type UART
- * int intn; - Interrupt Number (Refers to vector)
- * unsigned addr8259; - Absolute I/O Address of 8259 type interrupt
- * controller
- * int irq; - IRQ number for 8259 (IRQ1..IRQ8)
- * int brkdly; - Duration of break signal, multiple of 54.9ms 1..255
- * int wmodem; - YES or NO - Controls WAIT for CTS,DSR and CD
- * (polled mode)
- * int wtime; - Polled mode write timeout for asputc()
- * int rtime; - Polled mode Read Timeout for asgetc()
- * unsigned sh_ioad; - Absolute I/O Address of Status Port on Shared
- * hardware - make 0 if not shared hardware.
- * unsigned sh_bmask; - Bit mask for Shared Hardware Status Port to
- * indicate that this port has interrupted.
- *
- *
- * DESCRIPTION
- * This function determines most of the hardware dependent parameters for
- * the port. These parameters will be used for all subsequent communications
- * functions in the library.
- *
- * SIDE EFFECTS
- * none.
- *
- * RETURNS
- *
- *
- * Value Meaning
- * ------- --------
- * ASSUCCESS Successful
- * ASINVPORT Requested port is out of range
- * ASINVPAR Invalid parameter
- * ASINUSE Port already in use
- *
- * MODIFICATIONS
- * 19-MAY-1988 14:10:49.45 version 2.11
- * Removed range checking of some parameters.
- */
- #include <stdio.h>
- #include "gf.h"
- #include "asiports.h"
-
-
- int GF_CONV asisetv(port,addr8250,intn,addr8259,irq,brkdly,wmodem,wtime,rtime,
- sh_ioad,sh_bmask)
- int port,intn,irq,brkdly,wmodem,wtime,rtime;
- unsigned addr8250,addr8259,sh_ioad,sh_bmask;
- {
-
- if(port<0 || port>MAX_PORT)
- return(ASINVPORT);
- if(_aschkcnl(port)!=NULL)
- return(ASINUSE);
- as_8250port[port]=addr8250;
- as_intnums[port]=intn;
- if(!(addr8259==0x20)&&!(addr8259==0xA0)&&!(addr8259>=0x100&&
- addr8259<=0x3ff))
- return (ASINVPAR);
- as_8259ports[port]=addr8259;
- if(irq<1||irq>8)
- return (ASINVPAR);
- as_8259irq[port]=irq;
- if(brkdly<1||brkdly>255)
- return (ASINVPAR);
- as_brkdly[port]=brkdly;
- as_wmodem[port]=wmodem;
- as_wtime[port]=wtime;
- as_rtime[port]=rtime;
- as_shioad[port]=sh_ioad;
- as_shbmask[port]=sh_bmask;
- return(ASSUCCESS);
- }
-
-