CT-User
[Top] [All Lists]

[ct-user] LPT1INIT Source

To: Steve Baron - KB3MM <SteveBaron@StarLinX.com>,ct-user@contesting.com
Subject: [ct-user] LPT1INIT Source
From: Mark Bailey <kd4d@comcast.net>
Date: Mon, 21 Mar 2005 14:24:34 -0500
List-post: <mailto:ct-user@contesting.com>
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);
}  
  



_______________________________________________
CT-User mailing list
CT-User@contesting.com
http://lists.contesting.com/mailman/listinfo/ct-user
CT on the web:  http://www.k1ea.com/

<Prev in Thread] Current Thread [Next in Thread>