/*ISO_out.c Isolated Digital output application for the 37e12 */ /*! @defgroup ISO_out ISO_out - ISO_out.c This module is used to build the ISO_out application. ISO_out is used to write to the external high-drive port of the 37e12. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define ARGCHECK(num){if(argc!=num){printf("invalid number of arguements\n");help();return -1;}} #define OPENDEV(filed,dev){if((filed = open(dev, O_RDWR))<=0){printf("couldn't open %s\n",dev);return -1;}} static int help(void) { const char *help_table = "********************************************** *ISO_out * *Nathan Z. Gustavson * *Emac.inc * *"__DATE__" * *usage: * *ISO_out device data * *ex: * *ISO_out /dev/37e12 0xAA * *Sends 0xAA out the ISO digital port * *of /dev/37e12 * **********************************************\n"; printf("%s",help_table); return 0; } int main(int argc, char **argv) { int fd; isodata data; ARGCHECK(3); OPENDEV(fd,argv[1]); data = strtoul(argv[2],NULL,0); ioctl(fd,ISO_DIG_OUT,&data); close(fd); return 0; }