Fluke RUSKA 7750i User Manual page 72

Air data test set
Table of Contents

Advertisement

RUSKA 7750i
Users Manual
5-16
void interrupt serial_int ( )
{
char ch;
if ((inportb (portbase + 2) & 0x07) == 0x04)
{ ch = inportb (portbase);
if (ch == XON)
transmit_enabled = TRUE;
else if (ch == XOFF)
transmit_enabled = FALSE;
else
{ inqueue[inq_in++] = ch;
if (inq_in == QUEUE_SIZE)
inq_in = 0;
}
}
outportb (0x20, 0x20);
}
/*--------------------------------------------------------------------*/
/* serial_initialize : initialize serial port
/*--------------------------------------------------------------------*/
void serial_initialize ( )
{
char msg[10];
int divisor;
unsigned v;
portbase = 0x3F8;
intnum
= 4;
outportb (portbase + 3, 0x80);
outportb (portbase + 1, 0);
outportb (portbase,
outportb (portbase + 3, 3);
*/
old_vector = getvect (intnum + 8);
setvect (intnum + 8, serial_int);
v = inportb (0x21);
v &= ~(1 << intnum);
outportb (0x21, v);
outportb (portbase + 1, 0x01);
outportb (portbase + 4, 0x0B);
serial_write (CLEAR);
}
/*--------------------------------------------------------------------*/
/* serial_close : turn off serial receive interrupt
/*--------------------------------------------------------------------*/
void serial_close ( )
{
unsigned v;
outportb (portbase + 1, 0);
outportb (portbase + 4, 0);
v = inportb (0x21);
v |= 1 << intnum;
outportb (0x21, v);
setvect (intnum + 8, old_vector);
}
/*--------------------------------------------------------------------*/
/* serial_write : write a single character to serial port
/*--------------------------------------------------------------------*/
void serial_write (char ch)
{
while (!transmit_enabled)
;
while ((inportb (portbase + 5) & 0x20) == 0)
;
outportb (portbase, ch);
}
/*--------------------------------------------------------------------*/
/* COM1 = 0x3F8, COM2 = 0x2F8 */
/* COM1 = 4,
0x0C);
/* 9600 Baud */
/* 8 Databits, No Parity, 1 Stopbit
/* Save old interrupt vector */
/* Set new interrupt vector */
/* Enable interrupt */
/* Enable receive interrupt */
/* Enable Interrupt, DTR, RTS */
*/
COM2 = 3
*/
*/
*/

Advertisement

Table of Contents
loading

Table of Contents