/*----------------------------*/ /* USBIO */ /*----------------------------*/ #include #include #include #include "musbiobase.h" void printUsageAndExit() { char **pp; static char *usage[] = { "Usage:", " usbio -h|-l|-i -p0|-p1 [-bn]", " -h : Set Hi", " -l : Set Lo", " -i : Get Status", " -p0 : Select Port0", " -p1 : Select Port1", " -bn : Select Bit No", " n= 0..7 (If select -p1 then n= 0..3)", " If not set -bn then All Data in Select Port", NULL, }; for(pp = usage; *pp!=NULL;pp++) fprintf(stderr,"%s\n",*pp); exit(1); }; int main(int argc,char *argv[]) { int i; int ret; int dat; int modsw; int portno; int bitno; int msk; struct usb_bus *bus; struct usb_device *dev; usb_dev_handle *udev; unsigned char ctl[8]; ctl[0]=ctl[1]=ctl[2]=ctl[3]=ctl[4]=ctl[5]=ctl[6]=ctl[7]=0; modsw = -1; portno = 0; bitno = -1; msk = 0; if(argc < 2) printUsageAndExit(); for(i=1;i