//////////////////////////////////////////////////////////////////////////////// // Example usage of the MDE 8255 lab trainer // This program simple counts through the full range of the 8 bits on the bus // // Created by: Travis Sidelinger // Date: 2005Oct20 // //////////////////////////////////////////////////////////////////////////////// // Includes #include <stdio.h> #include <unistd.h> #include <sys/io.h> #include "lib8255.h" int main(void) { /* Variables */ static int ret = 0; static char c = 0; /* Main */ MDEOpenLPTPort(0x378); // Open LPT1 port MDEConfigPort(0x378, BaseConfig); // Send command 80H to 8255 while(1) { MDEOutPB(0x378, c); // Output to port B usleep(20000); c++; } MDECloseDriver(); // Close the driver /* End */ return(ret); }