////////////////////////////////////////////////////////////////////////////////
// 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);
    }
/var/www/sites/dokuwiki-2011-05-25a/data/pages/projects/libmdedriver/count.c.txt · Last modified: 2009/04/11 22:23 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki