[ct-user] LPT1INIT Source
Mark Bailey
kd4d at comcast.net
Mon Mar 21 14:24:34 EST 2005
Hi all:
This is short, so I'll just put it here. I built it with OPEN WATCOM
which is a free C development
environment that runs under Windows and will make DOS executables. This
isn't pretty, but... :-)
lpt1init.c
#include <stdio.h>
#define LPT1_BASE 0x378
int main()
{
unsigned char byte;
unsigned char status_register;
unsigned char data_register;
unsigned char control_register;
unsigned int status;
/* clear data register values...should clear DVK lines
* to SCKII
*/
data_register = 0x00;
status = outp(LPT1_BASE,data_register);
data_register = inp(LPT1_BASE);
status_register = inp(LPT1_BASE+1);
/*
* clear PTT and CW Keying. Select Radio 1
*/
control_register = (unsigned char) ((unsigned int) control_register & 0xc0);
control_register = (unsigned char) ((unsigned int) control_register | 0x09);
status = outp(LPT1_BASE+2,control_register);
control_register = inp(LPT1_BASE+2);
printf("data: %2x, status %2x, control %2x\n",
data_register,status_register,control_register);
}
More information about the CT-User
mailing list