Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
vmk80xx.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/errno.h>
#include <linux/input.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/usb.h>
#include <linux/uaccess.h>
#include "../comedidev.h"

Go to the source code of this file.

Data Structures

union  firmware_version
 
struct  vmk80xx_board
 
struct  vmk80xx_usb
 

Macros

#define VMK8055_DI_REG   0x00
 
#define VMK8055_DO_REG   0x01
 
#define VMK8055_AO1_REG   0x02
 
#define VMK8055_AO2_REG   0x03
 
#define VMK8055_AI1_REG   0x02
 
#define VMK8055_AI2_REG   0x03
 
#define VMK8055_CNT1_REG   0x04
 
#define VMK8055_CNT2_REG   0x06
 
#define VMK8061_CH_REG   0x01
 
#define VMK8061_DI_REG   0x01
 
#define VMK8061_DO_REG   0x01
 
#define VMK8061_PWM_REG1   0x01
 
#define VMK8061_PWM_REG2   0x02
 
#define VMK8061_CNT_REG   0x02
 
#define VMK8061_AO_REG   0x02
 
#define VMK8061_AI_REG1   0x02
 
#define VMK8061_AI_REG2   0x03
 
#define VMK8055_CMD_RST   0x00
 
#define VMK8055_CMD_DEB1_TIME   0x01
 
#define VMK8055_CMD_DEB2_TIME   0x02
 
#define VMK8055_CMD_RST_CNT1   0x03
 
#define VMK8055_CMD_RST_CNT2   0x04
 
#define VMK8055_CMD_WRT_AD   0x05
 
#define VMK8061_CMD_RD_AI   0x00
 
#define VMK8061_CMR_RD_ALL_AI   0x01 /* !non-active! */
 
#define VMK8061_CMD_SET_AO   0x02
 
#define VMK8061_CMD_SET_ALL_AO   0x03 /* !non-active! */
 
#define VMK8061_CMD_OUT_PWM   0x04
 
#define VMK8061_CMD_RD_DI   0x05
 
#define VMK8061_CMD_DO   0x06 /* !non-active! */
 
#define VMK8061_CMD_CLR_DO   0x07
 
#define VMK8061_CMD_SET_DO   0x08
 
#define VMK8061_CMD_RD_CNT   0x09 /* TODO: completely pointless? */
 
#define VMK8061_CMD_RST_CNT   0x0a /* TODO: completely pointless? */
 
#define VMK8061_CMD_RD_VERSION   0x0b /* internal usage */
 
#define VMK8061_CMD_RD_JMP_STAT   0x0c /* TODO: not implemented yet */
 
#define VMK8061_CMD_RD_PWR_STAT   0x0d /* internal usage */
 
#define VMK8061_CMD_RD_DO   0x0e
 
#define VMK8061_CMD_RD_AO   0x0f
 
#define VMK8061_CMD_RD_PWM   0x10
 
#define VMK80XX_MAX_BOARDS   COMEDI_NUM_BOARD_MINORS
 
#define TRANS_OUT_BUSY   1
 
#define TRANS_IN_BUSY   2
 
#define TRANS_IN_RUNNING   3
 
#define IC3_VERSION   (1 << 0)
 
#define IC6_VERSION   (1 << 1)
 
#define URB_RCV_FLAG   (1 << 0)
 
#define URB_SND_FLAG   (1 << 1)
 
#define dbgcm(fmt, arg...)
 
#define DIR_IN   1
 
#define DIR_OUT   2
 

Enumerations

enum  { DEVICE_VMK8055, DEVICE_VMK8061 }
 
enum  vmk80xx_model { VMK8055_MODEL, VMK8061_MODEL }
 
enum  {
  VMK80XX_SUBD_AI, VMK80XX_SUBD_AO, VMK80XX_SUBD_DI, VMK80XX_SUBD_DO,
  VMK80XX_SUBD_CNT, VMK80XX_SUBD_PWM
}
 

Functions

 MODULE_DEVICE_TABLE (usb, vmk80xx_usb_id_table)
 
 module_comedi_usb_driver (vmk80xx_driver, vmk80xx_usb_driver)
 
 MODULE_AUTHOR ("Manuel Gebele <[email protected]>")
 
 MODULE_DESCRIPTION ("Velleman USB Board Low-Level Driver")
 
 MODULE_SUPPORTED_DEVICE ("K8055/K8061 aka VM110/VM140")
 
 MODULE_VERSION ("0.8.01")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define dbgcm (   fmt,
  arg... 
)
Value:
do { \
if (dbgcm) \
printk(KERN_DEBUG fmt, ##arg); \
} while (0)

Definition at line 134 of file vmk80xx.c.

#define DIR_IN   1

Definition at line 502 of file vmk80xx.c.

#define DIR_OUT   2

Definition at line 503 of file vmk80xx.c.

#define IC3_VERSION   (1 << 0)

Definition at line 122 of file vmk80xx.c.

#define IC6_VERSION   (1 << 1)

Definition at line 123 of file vmk80xx.c.

#define TRANS_IN_BUSY   2

Definition at line 119 of file vmk80xx.c.

#define TRANS_IN_RUNNING   3

Definition at line 120 of file vmk80xx.c.

#define TRANS_OUT_BUSY   1

Definition at line 118 of file vmk80xx.c.

#define URB_RCV_FLAG   (1 << 0)

Definition at line 125 of file vmk80xx.c.

#define URB_SND_FLAG   (1 << 1)

Definition at line 126 of file vmk80xx.c.

#define VMK8055_AI1_REG   0x02

Definition at line 76 of file vmk80xx.c.

#define VMK8055_AI2_REG   0x03

Definition at line 77 of file vmk80xx.c.

#define VMK8055_AO1_REG   0x02

Definition at line 74 of file vmk80xx.c.

#define VMK8055_AO2_REG   0x03

Definition at line 75 of file vmk80xx.c.

#define VMK8055_CMD_DEB1_TIME   0x01

Definition at line 92 of file vmk80xx.c.

#define VMK8055_CMD_DEB2_TIME   0x02

Definition at line 93 of file vmk80xx.c.

#define VMK8055_CMD_RST   0x00

Definition at line 91 of file vmk80xx.c.

#define VMK8055_CMD_RST_CNT1   0x03

Definition at line 94 of file vmk80xx.c.

#define VMK8055_CMD_RST_CNT2   0x04

Definition at line 95 of file vmk80xx.c.

#define VMK8055_CMD_WRT_AD   0x05

Definition at line 96 of file vmk80xx.c.

#define VMK8055_CNT1_REG   0x04

Definition at line 78 of file vmk80xx.c.

#define VMK8055_CNT2_REG   0x06

Definition at line 79 of file vmk80xx.c.

#define VMK8055_DI_REG   0x00

Definition at line 72 of file vmk80xx.c.

#define VMK8055_DO_REG   0x01

Definition at line 73 of file vmk80xx.c.

#define VMK8061_AI_REG1   0x02

Definition at line 88 of file vmk80xx.c.

#define VMK8061_AI_REG2   0x03

Definition at line 89 of file vmk80xx.c.

#define VMK8061_AO_REG   0x02

Definition at line 87 of file vmk80xx.c.

#define VMK8061_CH_REG   0x01

Definition at line 81 of file vmk80xx.c.

#define VMK8061_CMD_CLR_DO   0x07

Definition at line 105 of file vmk80xx.c.

#define VMK8061_CMD_DO   0x06 /* !non-active! */

Definition at line 104 of file vmk80xx.c.

#define VMK8061_CMD_OUT_PWM   0x04

Definition at line 102 of file vmk80xx.c.

#define VMK8061_CMD_RD_AI   0x00

Definition at line 98 of file vmk80xx.c.

#define VMK8061_CMD_RD_AO   0x0f

Definition at line 113 of file vmk80xx.c.

#define VMK8061_CMD_RD_CNT   0x09 /* TODO: completely pointless? */

Definition at line 107 of file vmk80xx.c.

#define VMK8061_CMD_RD_DI   0x05

Definition at line 103 of file vmk80xx.c.

#define VMK8061_CMD_RD_DO   0x0e

Definition at line 112 of file vmk80xx.c.

#define VMK8061_CMD_RD_JMP_STAT   0x0c /* TODO: not implemented yet */

Definition at line 110 of file vmk80xx.c.

#define VMK8061_CMD_RD_PWM   0x10

Definition at line 114 of file vmk80xx.c.

#define VMK8061_CMD_RD_PWR_STAT   0x0d /* internal usage */

Definition at line 111 of file vmk80xx.c.

#define VMK8061_CMD_RD_VERSION   0x0b /* internal usage */

Definition at line 109 of file vmk80xx.c.

#define VMK8061_CMD_RST_CNT   0x0a /* TODO: completely pointless? */

Definition at line 108 of file vmk80xx.c.

#define VMK8061_CMD_SET_ALL_AO   0x03 /* !non-active! */

Definition at line 101 of file vmk80xx.c.

#define VMK8061_CMD_SET_AO   0x02

Definition at line 100 of file vmk80xx.c.

#define VMK8061_CMD_SET_DO   0x08

Definition at line 106 of file vmk80xx.c.

#define VMK8061_CMR_RD_ALL_AI   0x01 /* !non-active! */

Definition at line 99 of file vmk80xx.c.

#define VMK8061_CNT_REG   0x02

Definition at line 86 of file vmk80xx.c.

#define VMK8061_DI_REG   0x01

Definition at line 82 of file vmk80xx.c.

#define VMK8061_DO_REG   0x01

Definition at line 83 of file vmk80xx.c.

#define VMK8061_PWM_REG1   0x01

Definition at line 84 of file vmk80xx.c.

#define VMK8061_PWM_REG2   0x02

Definition at line 85 of file vmk80xx.c.

#define VMK80XX_MAX_BOARDS   COMEDI_NUM_BOARD_MINORS

Definition at line 116 of file vmk80xx.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
DEVICE_VMK8055 
DEVICE_VMK8061 

Definition at line 67 of file vmk80xx.c.

anonymous enum
Enumerator:
VMK80XX_SUBD_AI 
VMK80XX_SUBD_AO 
VMK80XX_SUBD_DI 
VMK80XX_SUBD_DO 
VMK80XX_SUBD_CNT 
VMK80XX_SUBD_PWM 

Definition at line 176 of file vmk80xx.c.

Enumerator:
VMK8055_MODEL 
VMK8061_MODEL 

Definition at line 140 of file vmk80xx.c.

Function Documentation

MODULE_AUTHOR ( "Manuel Gebele <[email protected]>"  )
module_comedi_usb_driver ( vmk80xx_driver  ,
vmk80xx_usb_driver   
)
MODULE_DESCRIPTION ( "Velleman USB Board Low-Level Driver"  )
MODULE_DEVICE_TABLE ( usb  ,
vmk80xx_usb_id_table   
)
MODULE_LICENSE ( "GPL"  )
MODULE_SUPPORTED_DEVICE ( "K8055/K8061 aka VM110/VM140"  )
MODULE_VERSION ( "0.8.01"  )