Category : Files from Magazines
Archive   : DDJSRC.ZIP
Filename : SERIAL.H

 
Output of file : SERIAL.H contained in archive : DDJSRC.ZIP
/* ---------- serial.h ---------------
* Serial Port Definitions
*/
extern int ticker, COMPORT;
extern char *nextin, *nextout;
/* ----------- serial prototypes ----------- */
void initcomport(void);
int readcomm(void);
int writecomm(int);
void clear_serial_queue(void);
/* -------- timer prototypes --------- */
void sleep(unsigned);
int set_timer(unsigned);
void intercept_timer(void);
void restore_timer(void);
void restore_serialint(void);
/* ----------------- macros ------------------- */
#define comstat() (inp(LINESTATUS))
#define input_char_ready() (nextin!=nextout)
#define timed_out() (ticker==0)
#define set_timer(secs) ticker=secs*182/10+1
#define XON 17
#define XOFF 19
/* ---------------- serial port addresses ----------------- */
/* - 8250 UART base port address: COM1 = 3f8, COM2 = 2f8 - */
#define BASEPORT (0x3f8-((COMPORT-1)<<8))
#define TXDATA BASEPORT /* transmit data */
#define RXDATA BASEPORT /* receive data */
#define DIVLSB BASEPORT /* baud rate divisor lsb */
#define DIVMSB (BASEPORT+1) /* baud rate divisor msb */
#define INTENABLE (BASEPORT+1) /* interrupt enable */
#define INTIDENT (BASEPORT+2) /* interrupt ident'n */
#define LINECTL (BASEPORT+3) /* line control */
#define MODEMCTL (BASEPORT+4) /* modem control */
#define LINESTATUS (BASEPORT+5) /* line status */
#define MODEMSTATUS (BASEPORT+6) /* modem status */
/* --------------- serial interrupt stuff ------------------ */
#define IRQ (4-(COMPORT-1)) /* 0-7 = IRQ0-IRQ7 */
#define COMINT (12-(COMPORT-1)) /* interrupt vector 12/11*/
#define COMIRQ (~(1 << IRQ))
#define PIC01 0x21 /*8259 Programmable Interrupt Controller*/
#define PIC00 0x20 /* " " " " */
#define EOI 0x20 /* End of Interrupt command */
#define TIMER 0x1c /* PC timer interrupt vector */
/* --------------- line status register values ------------- */
#define XMIT_DATA_READY 0x20
/* ------------ modem control register values -------------- */
#define DTR 1
#define RTS 2
#define OUT2 8
/* ----------- interrupt enable register signals ------------ */
#define DATAREADY 1
/* ------------- serial input interrupt buffer -------------- */
#define BUFSIZE 1024
#define SAFETYLEVEL (BUFSIZE/4)
#define THRESHOLD (SAFETYLEVEL*3)
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif


  3 Responses to “Category : Files from Magazines
Archive   : DDJSRC.ZIP
Filename : SERIAL.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/