/* Flash.c WinSystems UIO48 driver Demonstration Program * * $Header: /home/steve/uio48/RCS/flash.c,v 1.1 2005/04/22 20:08:19 steve Exp $ * * $Id: flash.c,v 1.1 2005/04/22 20:08:19 steve Exp $ * * $Log: flash.c,v $ * Revision 1.1 2005/04/22 20:08:19 steve * Initial revision * * * * Compile with : * * * gcc flash.c uio48io.o -o flash * * * */ /* Remove the comments from around this define for the UIO96 or for any two chip scenario */ /* #define TWO_CHIPS 1 */ #include #include #include "uio48.h" main(int argc, char *argv[]) { int x; x = read_bit(1,1); /* Just a test for availability */ if(x < 0) { printf("Can't access device UIO48A - Aborting\n"); exit(1); } #ifdef TWO_CHIPS x = read_bit(2,1); /* Test this one too */ if(x < 0) { printf("Can't access device UIO48B - Aborting\n"); exit(1); } #endif while(1) { for(x=1; x<=48; x++) { set_bit(1,x); /* Turn on the LED */ usleep(50000); clr_bit(1,x); /* Turn off the LED */ } #ifdef TWO_CHIPS for(x=1; x<=48; x++) { set_bit(2,x); usleep(50000); clr_bit(2,x); } #endif } }