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

Go to the source code of this file.

Data Structures

struct  dt9812_flash_data
 
struct  dt9812_read_multi
 
struct  dt9812_write_byte
 
struct  dt9812_write_multi
 
struct  dt9812_rmw_byte
 
struct  dt9812_rmw_multi
 
struct  dt9812_usb_cmd
 
struct  usb_dt9812
 
struct  comedi_dt9812
 
struct  slot_dt9812
 

Macros

#define DT9812_DIAGS_BOARD_INFO_ADDR   0xFBFF
 
#define DT9812_MAX_WRITE_CMD_PIPE_SIZE   32
 
#define DT9812_MAX_READ_CMD_PIPE_SIZE   32
 
#define F020_SFR_P4   0x84
 
#define F020_SFR_P1   0x90
 
#define F020_SFR_P2   0xa0
 
#define F020_SFR_P3   0xb0
 
#define F020_SFR_AMX0CF   0xba
 
#define F020_SFR_AMX0SL   0xbb
 
#define F020_SFR_ADC0CF   0xbc
 
#define F020_SFR_ADC0L   0xbe
 
#define F020_SFR_ADC0H   0xbf
 
#define F020_SFR_DAC0L   0xd2
 
#define F020_SFR_DAC0H   0xd3
 
#define F020_SFR_DAC0CN   0xd4
 
#define F020_SFR_DAC1L   0xd5
 
#define F020_SFR_DAC1H   0xd6
 
#define F020_SFR_DAC1CN   0xd7
 
#define F020_SFR_ADC0CN   0xe8
 
#define F020_MASK_ADC0CF_AMP0GN0   0x01
 
#define F020_MASK_ADC0CF_AMP0GN1   0x02
 
#define F020_MASK_ADC0CF_AMP0GN2   0x04
 
#define F020_MASK_ADC0CN_AD0EN   0x80
 
#define F020_MASK_ADC0CN_AD0INT   0x20
 
#define F020_MASK_ADC0CN_AD0BUSY   0x10
 
#define F020_MASK_DACxCN_DACxEN   0x80
 
#define DT9812_MAX_NUM_MULTI_BYTE_RDS   ((DT9812_MAX_WRITE_CMD_PIPE_SIZE - 4 - 1) / sizeof(u8))
 
#define DT9812_MAX_NUM_MULTI_BYTE_WRTS
 
#define DT9812_MAX_NUM_MULTI_BYTE_RMWS
 
#define DT9812_NUM_SLOTS   16
 
#define devpriv   ((struct comedi_dt9812 *)dev->private)
 

Enumerations

enum  { DT9812_DEVID_DT9812_10, DT9812_DEVID_DT9812_2PT5 }
 
enum  dt9812_gain {
  DT9812_GAIN_0PT25 = 1, DT9812_GAIN_0PT5 = 2, DT9812_GAIN_1 = 4, DT9812_GAIN_2 = 8,
  DT9812_GAIN_4 = 16, DT9812_GAIN_8 = 32, DT9812_GAIN_16 = 64
}
 
enum  {
  DT9812_LEAST_USB_FIRMWARE_CMD_CODE = 0, DT9812_W_FLASH_DATA = 0, DT9812_R_FLASH_DATA = 1, DT9812_R_SINGLE_BYTE_REG = 2,
  DT9812_W_SINGLE_BYTE_REG = 3, DT9812_R_MULTI_BYTE_REG = 4, DT9812_W_MULTI_BYTE_REG = 5, DT9812_RMW_SINGLE_BYTE_REG = 6,
  DT9812_RMW_MULTI_BYTE_REG = 7, DT9812_R_SINGLE_BYTE_SMBUS = 8, DT9812_W_SINGLE_BYTE_SMBUS = 9, DT9812_R_MULTI_BYTE_SMBUS = 10,
  DT9812_W_MULTI_BYTE_SMBUS = 11, DT9812_R_SINGLE_BYTE_DEV = 12, DT9812_W_SINGLE_BYTE_DEV = 13, DT9812_R_MULTI_BYTE_DEV = 14,
  DT9812_W_MULTI_BYTE_DEV = 15, DT9812_W_DAC_THRESHOLD = 16, DT9812_W_INT_ON_CHANGE_MASK = 17, DT9812_W_CGL = 18,
  DT9812_R_MULTI_BYTE_USBMEM = 19, DT9812_W_MULTI_BYTE_USBMEM = 20, DT9812_START_SUBSYSTEM = 21, DT9812_STOP_SUBSYSTEM = 22,
  DT9812_CALIBRATE_POT = 23, DT9812_W_DAC_FIFO_SIZE = 24, DT9812_W_CGL_DAC = 25, DT9812_R_SINGLE_VALUE_CMD = 26,
  DT9812_W_SINGLE_VALUE_CMD = 27, DT9812_MAX_USB_FIRMWARE_CMD_CODE
}
 

Functions

 MODULE_DEVICE_TABLE (usb, dt9812_table)
 
 module_init (usb_dt9812_init)
 
 module_exit (usb_dt9812_exit)
 
 MODULE_AUTHOR ("Anders Blomdell <[email protected]>")
 
 MODULE_DESCRIPTION ("Comedi DT9812 driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define devpriv   ((struct comedi_dt9812 *)dev->private)

Definition at line 327 of file dt9812.c.

#define DT9812_DIAGS_BOARD_INFO_ADDR   0xFBFF

Definition at line 57 of file dt9812.c.

#define DT9812_MAX_NUM_MULTI_BYTE_RDS   ((DT9812_MAX_WRITE_CMD_PIPE_SIZE - 4 - 1) / sizeof(u8))

Definition at line 198 of file dt9812.c.

#define DT9812_MAX_NUM_MULTI_BYTE_RMWS
Value:
sizeof(struct dt9812_rmw_byte))

Definition at line 226 of file dt9812.c.

#define DT9812_MAX_NUM_MULTI_BYTE_WRTS
Value:
sizeof(struct dt9812_write_byte))

Definition at line 211 of file dt9812.c.

#define DT9812_MAX_READ_CMD_PIPE_SIZE   32

Definition at line 59 of file dt9812.c.

#define DT9812_MAX_WRITE_CMD_PIPE_SIZE   32

Definition at line 58 of file dt9812.c.

#define DT9812_NUM_SLOTS   16

Definition at line 264 of file dt9812.c.

#define F020_MASK_ADC0CF_AMP0GN0   0x01

Definition at line 81 of file dt9812.c.

#define F020_MASK_ADC0CF_AMP0GN1   0x02

Definition at line 82 of file dt9812.c.

#define F020_MASK_ADC0CF_AMP0GN2   0x04

Definition at line 83 of file dt9812.c.

#define F020_MASK_ADC0CN_AD0BUSY   0x10

Definition at line 87 of file dt9812.c.

#define F020_MASK_ADC0CN_AD0EN   0x80

Definition at line 85 of file dt9812.c.

#define F020_MASK_ADC0CN_AD0INT   0x20

Definition at line 86 of file dt9812.c.

#define F020_MASK_DACxCN_DACxEN   0x80

Definition at line 89 of file dt9812.c.

#define F020_SFR_ADC0CF   0xbc

Definition at line 70 of file dt9812.c.

#define F020_SFR_ADC0CN   0xe8

Definition at line 79 of file dt9812.c.

#define F020_SFR_ADC0H   0xbf

Definition at line 72 of file dt9812.c.

#define F020_SFR_ADC0L   0xbe

Definition at line 71 of file dt9812.c.

#define F020_SFR_AMX0CF   0xba

Definition at line 68 of file dt9812.c.

#define F020_SFR_AMX0SL   0xbb

Definition at line 69 of file dt9812.c.

#define F020_SFR_DAC0CN   0xd4

Definition at line 75 of file dt9812.c.

#define F020_SFR_DAC0H   0xd3

Definition at line 74 of file dt9812.c.

#define F020_SFR_DAC0L   0xd2

Definition at line 73 of file dt9812.c.

#define F020_SFR_DAC1CN   0xd7

Definition at line 78 of file dt9812.c.

#define F020_SFR_DAC1H   0xd6

Definition at line 77 of file dt9812.c.

#define F020_SFR_DAC1L   0xd5

Definition at line 76 of file dt9812.c.

#define F020_SFR_P1   0x90

Definition at line 65 of file dt9812.c.

#define F020_SFR_P2   0xa0

Definition at line 66 of file dt9812.c.

#define F020_SFR_P3   0xb0

Definition at line 67 of file dt9812.c.

#define F020_SFR_P4   0x84

Definition at line 64 of file dt9812.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
DT9812_DEVID_DT9812_10 
DT9812_DEVID_DT9812_2PT5 

Definition at line 91 of file dt9812.c.

anonymous enum
Enumerator:
DT9812_LEAST_USB_FIRMWARE_CMD_CODE 
DT9812_W_FLASH_DATA 
DT9812_R_FLASH_DATA 
DT9812_R_SINGLE_BYTE_REG 
DT9812_W_SINGLE_BYTE_REG 
DT9812_R_MULTI_BYTE_REG 
DT9812_W_MULTI_BYTE_REG 
DT9812_RMW_SINGLE_BYTE_REG 
DT9812_RMW_MULTI_BYTE_REG 
DT9812_R_SINGLE_BYTE_SMBUS 
DT9812_W_SINGLE_BYTE_SMBUS 
DT9812_R_MULTI_BYTE_SMBUS 
DT9812_W_MULTI_BYTE_SMBUS 
DT9812_R_SINGLE_BYTE_DEV 
DT9812_W_SINGLE_BYTE_DEV 
DT9812_R_MULTI_BYTE_DEV 
DT9812_W_MULTI_BYTE_DEV 
DT9812_W_DAC_THRESHOLD 
DT9812_W_INT_ON_CHANGE_MASK 
DT9812_W_CGL 
DT9812_R_MULTI_BYTE_USBMEM 
DT9812_W_MULTI_BYTE_USBMEM 
DT9812_START_SUBSYSTEM 
DT9812_STOP_SUBSYSTEM 
DT9812_CALIBRATE_POT 
DT9812_W_DAC_FIFO_SIZE 
DT9812_W_CGL_DAC 
DT9812_R_SINGLE_VALUE_CMD 
DT9812_W_SINGLE_VALUE_CMD 
DT9812_MAX_USB_FIRMWARE_CMD_CODE 

Definition at line 111 of file dt9812.c.

Enumerator:
DT9812_GAIN_0PT25 
DT9812_GAIN_0PT5 
DT9812_GAIN_1 
DT9812_GAIN_2 
DT9812_GAIN_4 
DT9812_GAIN_8 
DT9812_GAIN_16 

Definition at line 101 of file dt9812.c.

Function Documentation

MODULE_AUTHOR ( "Anders Blomdell <[email protected]>"  )
MODULE_DESCRIPTION ( "Comedi DT9812 driver )
MODULE_DEVICE_TABLE ( usb  ,
dt9812_table   
)
module_exit ( usb_dt9812_exit  )
module_init ( usb_dt9812_init  )
MODULE_LICENSE ( "GPL"  )