Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
usbdux.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/usb.h>
#include <linux/fcntl.h>
#include <linux/compiler.h>
#include <linux/firmware.h>
#include "../comedidev.h"
#include "comedi_fc.h"

Go to the source code of this file.

Data Structures

struct  usbduxsub
 

Macros

#define BULK_TIMEOUT   1000
 
#define FIRMWARE   "usbdux_firmware.bin"
 
#define USBDUXSUB_FIRMWARE   0xA0
 
#define VENDOR_DIR_IN   0xC0
 
#define VENDOR_DIR_OUT   0x40
 
#define USBDUXSUB_CPUCS   0xE600
 
#define USBDUXSUB_MINOR   32
 
#define TB_LEN   0x2000
 
#define ISOINEP   6
 
#define ISOOUTEP   2
 
#define COMMAND_OUT_EP   1
 
#define COMMAND_IN_EP   8
 
#define PWM_EP   4
 
#define MIN_PWM_PERIOD   ((long)(1E9/300))
 
#define PWM_DEFAULT_PERIOD   ((long)(1E9/100))
 
#define NUMCHANNELS   8
 
#define SIZEADIN   ((sizeof(int16_t)))
 
#define SIZEINBUF   ((8*SIZEADIN))
 
#define SIZEINSNBUF   16
 
#define NUMOUTCHANNELS   8
 
#define SIZEDAOUT   ((sizeof(int8_t)+sizeof(int16_t)))
 
#define SIZEOUTBUF   ((8*SIZEDAOUT))
 
#define SIZEOFDUXBUFFER   ((8*SIZEDAOUT+2))
 
#define NUMOFINBUFFERSFULL   5
 
#define NUMOFOUTBUFFERSFULL   5
 
#define NUMOFINBUFFERSHIGH   10
 
#define NUMOFOUTBUFFERSHIGH   10
 
#define NUMUSBDUX   16
 
#define SUBDEV_AD   0
 
#define SUBDEV_DA   1
 
#define SUBDEV_DIO   2
 
#define SUBDEV_COUNTER   3
 
#define SUBDEV_PWM   4
 
#define RETRIES   10
 
#define FIRMWARE_MAX_LEN   0x2000
 
#define SENDADCOMMANDS   0
 
#define SENDDACOMMANDS   1
 
#define SENDDIOCONFIGCOMMAND   2
 
#define SENDDIOBITSCOMMAND   3
 
#define SENDSINGLEAD   4
 
#define READCOUNTERCOMMAND   5
 
#define WRITECOUNTERCOMMAND   6
 
#define SENDPWMON   7
 
#define SENDPWMOFF   8
 

Functions

 MODULE_DEVICE_TABLE (usb, usbdux_usb_table)
 
 module_comedi_usb_driver (usbdux_driver, usbdux_usb_driver)
 
 MODULE_AUTHOR ("Bernd Porr, [email protected]")
 
 MODULE_DESCRIPTION ("Stirling/ITL USB-DUX -- [email protected]")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_FIRMWARE (FIRMWARE)
 

Macro Definition Documentation

#define BULK_TIMEOUT   1000

Definition at line 104 of file usbdux.c.

#define COMMAND_IN_EP   8

Definition at line 135 of file usbdux.c.

#define COMMAND_OUT_EP   1

Definition at line 132 of file usbdux.c.

#define FIRMWARE   "usbdux_firmware.bin"

Definition at line 107 of file usbdux.c.

#define FIRMWARE_MAX_LEN   0x2000

Definition at line 822 of file usbdux.c.

#define ISOINEP   6

Definition at line 126 of file usbdux.c.

#define ISOOUTEP   2

Definition at line 129 of file usbdux.c.

#define MIN_PWM_PERIOD   ((long)(1E9/300))

Definition at line 141 of file usbdux.c.

#define NUMCHANNELS   8

Definition at line 147 of file usbdux.c.

#define NUMOFINBUFFERSFULL   5

Definition at line 181 of file usbdux.c.

#define NUMOFINBUFFERSHIGH   10

Definition at line 188 of file usbdux.c.

#define NUMOFOUTBUFFERSFULL   5

Definition at line 184 of file usbdux.c.

#define NUMOFOUTBUFFERSHIGH   10

Definition at line 192 of file usbdux.c.

#define NUMOUTCHANNELS   8

Definition at line 162 of file usbdux.c.

#define NUMUSBDUX   16

Definition at line 195 of file usbdux.c.

#define PWM_DEFAULT_PERIOD   ((long)(1E9/100))

Definition at line 144 of file usbdux.c.

#define PWM_EP   4

Definition at line 138 of file usbdux.c.

#define READCOUNTERCOMMAND   5

Definition at line 1063 of file usbdux.c.

#define RETRIES   10

Definition at line 213 of file usbdux.c.

#define SENDADCOMMANDS   0

Definition at line 1058 of file usbdux.c.

#define SENDDACOMMANDS   1

Definition at line 1059 of file usbdux.c.

#define SENDDIOBITSCOMMAND   3

Definition at line 1061 of file usbdux.c.

#define SENDDIOCONFIGCOMMAND   2

Definition at line 1060 of file usbdux.c.

#define SENDPWMOFF   8

Definition at line 1066 of file usbdux.c.

#define SENDPWMON   7

Definition at line 1065 of file usbdux.c.

#define SENDSINGLEAD   4

Definition at line 1062 of file usbdux.c.

#define SIZEADIN   ((sizeof(int16_t)))

Definition at line 150 of file usbdux.c.

#define SIZEDAOUT   ((sizeof(int8_t)+sizeof(int16_t)))

Definition at line 165 of file usbdux.c.

#define SIZEINBUF   ((8*SIZEADIN))

Definition at line 156 of file usbdux.c.

#define SIZEINSNBUF   16

Definition at line 159 of file usbdux.c.

#define SIZEOFDUXBUFFER   ((8*SIZEDAOUT+2))

Definition at line 178 of file usbdux.c.

#define SIZEOUTBUF   ((8*SIZEDAOUT))

Definition at line 172 of file usbdux.c.

#define SUBDEV_AD   0

Definition at line 198 of file usbdux.c.

#define SUBDEV_COUNTER   3

Definition at line 207 of file usbdux.c.

#define SUBDEV_DA   1

Definition at line 201 of file usbdux.c.

#define SUBDEV_DIO   2

Definition at line 204 of file usbdux.c.

#define SUBDEV_PWM   4

Definition at line 210 of file usbdux.c.

#define TB_LEN   0x2000

Definition at line 123 of file usbdux.c.

#define USBDUXSUB_CPUCS   0xE600

Definition at line 113 of file usbdux.c.

#define USBDUXSUB_FIRMWARE   0xA0

Definition at line 108 of file usbdux.c.

#define USBDUXSUB_MINOR   32

Definition at line 120 of file usbdux.c.

#define VENDOR_DIR_IN   0xC0

Definition at line 109 of file usbdux.c.

#define VENDOR_DIR_OUT   0x40

Definition at line 110 of file usbdux.c.

#define WRITECOUNTERCOMMAND   6

Definition at line 1064 of file usbdux.c.

Function Documentation

MODULE_AUTHOR ( "Bernd  Porr,
BerndPorr @f2s.com"   
)
module_comedi_usb_driver ( usbdux_driver  ,
usbdux_usb_driver   
)
MODULE_DESCRIPTION ( "Stirling/ITL USB-DUX -- [email protected] )
MODULE_DEVICE_TABLE ( usb  ,
usbdux_usb_table   
)
MODULE_FIRMWARE ( FIRMWARE  )
MODULE_LICENSE ( "GPL"  )