fps200usb.h

来自「小程序,但是有点用出处的.进攻参考.请多多提意见.」· C头文件 代码 · 共 69 行

H
69
字号
#ifndef FPS200USB_H#define FPS200USB_H#define _BULK_DATA_LEN 64typedef struct{	unsigned char data[_BULK_DATA_LEN];	unsigned int size;	unsigned int pipe;}bulk_transfer_t,*pbulk_transfer_t;#define USB_BLOCK_SIZE 64#define FPS200USB_MINOR 240		/* some unassigned USB minor */#define FPS200USB_VERSION 0x1000#define IOCTL_FS_BULK              _IOWR('d', 0x30, bulk_transfer_t)#define IOCTL_FS_OVERRUNS	   _IOR('d',  0x15, int)#define IOCTL_FS_VERSION           _IOR('d', 0x3f, int) #ifdef __KERNEL__typedef enum { _stopped=0, _started } driver_state_t;typedef struct{  struct semaphore mutex;  struct usb_device *usbdev;  wait_queue_head_t wait;  wait_queue_head_t remove_ok;  wait_queue_head_t waitReadCompletion;  spinlock_t lock;  atomic_t pending_io;  driver_state_t state;  int remove_pending;  int got_mem;  int readptr;  int opened;  int statusDataReceived;  int fatal_error; /* true if a fatal error ocurred */  /* urb control to read data */  struct urb *read_urb;  unsigned char *bulk_in_buffer; /* the buffer to be used for reading */  unsigned int bulk_in_size; /* size of the buffer to read the image */#ifdef INTERRUPT_HANDLING  /* urb control to interrupt handler */  struct urb irq_urb; /* the urb to handle interrupts */  unsigned char icr_state; /* the state of the icr register (cache) */  unsigned char irq_status; /* the status of the interrupt */#endif  /* acquisition control */  int x;  /* start row */  int y;  /* start line */  int width; /* width of the image */  int height; /* height of the image */  int image_size;   /* total size of the image */  int header_size;  /* the size of the file header */  char *file_header; /* the header for the file */  int file_format;  /* the format of the file */} fps200usb_t,*pfps200usb_t;#endif#endif /* FPS200USB_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?