AD Instruments AD2817C Manual De Usuario página 111

Medidor lcr
Tabla de contenido

Publicidad

Idiomas disponibles

Idiomas disponibles

AD2817C Operation Manual
if( c == '\n' ) break;
*ps = c;
ps++;
}
*ps = 0;
}
/* send a character to serial port */
void send_port( int port,char c )
{
union REGS r;
r.x.dx = port;
r.h.ah = 1;
r.h.al = c;
int86( 0x14,&r,&r );
if( r.h.ah & 128 )
{ printf( "\nE00:Serial port send error!" );
exit(1);
}
}
/* read a character from serial port */
char read_port( int port )
{ union REGS r;
r.x.dx = port;
r.h.ah = 2;
int86( 0x14,&r,&r );
if( r.h.ah & 128 )
{ printf( "\nE01:Serial port read error!" );
exit(1);
}
return r.h.al;
}
/* check the status of serial port */
int check_stat( int port )
{ union REGS r;
r.x.dx = port;
r.h.ah = 3;
int86( 0x14,&r,&r );
return r.x.ax;
}
/* initialize the serial port */
void port_init( int port,unsigned char code )
/* serial port */
/* int14 function1:send character */
/* character to be sent */
/* check ah.7,if set by int86( 0x14,&r,&r ),mean trans error */
/* serial port */
/* int14 function2:read character */
/* if ah.7 be set,mean trans error */
/* serial port */
/* int14 function3:read status */
/* ax.7 show serial operation, ax.8 show serial recive ready */
46

Publicidad

Capítulos

Tabla de contenido
loading

Tabla de contenido