Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ni_at_a2150.c File Reference
#include <linux/interrupt.h>
#include <linux/slab.h>
#include "../comedidev.h"
#include <linux/ioport.h>
#include <linux/io.h>
#include <asm/dma.h>
#include "8253.h"
#include "comedi_fc.h"

Go to the source code of this file.

Data Structures

struct  a2150_board
 
struct  a2150_private
 

Macros

#define A2150_SIZE   28
 
#define A2150_DMA_BUFFER_SIZE   0xff00 /* size in bytes of dma buffer */
 
#define CONFIG_REG   0x0
 
#define CHANNEL_BITS(x)   ((x) & 0x7)
 
#define CHANNEL_MASK   0x7
 
#define CLOCK_SELECT_BITS(x)   (((x) & 0x3) << 3)
 
#define CLOCK_DIVISOR_BITS(x)   (((x) & 0x3) << 5)
 
#define CLOCK_MASK   (0xf << 3)
 
#define ENABLE0_BIT   0x80 /* enable (don't internally ground) channels 0 and 1 */
 
#define ENABLE1_BIT   0x100 /* enable (don't internally ground) channels 2 and 3 */
 
#define AC0_BIT   0x200 /* ac couple channels 0,1 */
 
#define AC1_BIT   0x400 /* ac couple channels 2,3 */
 
#define APD_BIT   0x800 /* analog power down */
 
#define DPD_BIT   0x1000 /* digital power down */
 
#define TRIGGER_REG   0x2 /* trigger config register */
 
#define POST_TRIGGER_BITS   0x2
 
#define DELAY_TRIGGER_BITS   0x3
 
#define HW_TRIG_EN   0x10 /* enable hardware trigger */
 
#define FIFO_START_REG   0x6 /* software start aquistion trigger */
 
#define FIFO_RESET_REG   0x8 /* clears fifo + fifo flags */
 
#define FIFO_DATA_REG   0xa /* read data */
 
#define DMA_TC_CLEAR_REG   0xe /* clear dma terminal count interrupt */
 
#define STATUS_REG   0x12 /* read only */
 
#define FNE_BIT   0x1 /* fifo not empty */
 
#define OVFL_BIT   0x8 /* fifo overflow */
 
#define EDAQ_BIT   0x10 /* end of acquisition interrupt */
 
#define DCAL_BIT   0x20 /* offset calibration in progress */
 
#define INTR_BIT   0x40 /* interrupt has occurred */
 
#define DMA_TC_BIT   0x80 /* dma terminal count interrupt has occurred */
 
#define ID_BITS(x)   (((x) >> 8) & 0x3)
 
#define IRQ_DMA_CNTRL_REG   0x12 /* write only */
 
#define DMA_CHAN_BITS(x)   ((x) & 0x7) /* sets dma channel */
 
#define DMA_EN_BIT   0x8 /* enables dma */
 
#define IRQ_LVL_BITS(x)   (((x) & 0xf) << 4) /* sets irq level */
 
#define FIFO_INTR_EN_BIT   0x100 /* enable fifo interrupts */
 
#define FIFO_INTR_FHF_BIT   0x200 /* interrupt fifo half full */
 
#define DMA_INTR_EN_BIT   0x800 /* enable interrupt on dma terminal count */
 
#define DMA_DEM_EN_BIT   0x1000 /* enables demand mode dma */
 
#define I8253_BASE_REG   0x14
 
#define I8253_MODE_REG   0x17
 
#define HW_COUNT_DISABLE   0x30 /* disable hardware counting of conversions */
 
#define thisboard   ((const struct a2150_board *)dev->board_ptr)
 
#define devpriv   ((struct a2150_private *)dev->private)
 
#define ONE_THIRD_SECOND   333333333
 

Enumerations

enum  { a2150_c, a2150_s }
 

Functions

 module_comedi_driver (ni_at_a2150_driver)
 
 MODULE_AUTHOR ("Comedi http://www.comedi.org")
 
 MODULE_DESCRIPTION ("Comedi low-level driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define A2150_DMA_BUFFER_SIZE   0xff00 /* size in bytes of dma buffer */

Definition at line 79 of file ni_at_a2150.c.

#define A2150_SIZE   28

Definition at line 78 of file ni_at_a2150.c.

#define AC0_BIT   0x200 /* ac couple channels 0,1 */

Definition at line 93 of file ni_at_a2150.c.

#define AC1_BIT   0x400 /* ac couple channels 2,3 */

Definition at line 94 of file ni_at_a2150.c.

#define APD_BIT   0x800 /* analog power down */

Definition at line 95 of file ni_at_a2150.c.

#define CHANNEL_BITS (   x)    ((x) & 0x7)

Definition at line 86 of file ni_at_a2150.c.

#define CHANNEL_MASK   0x7

Definition at line 87 of file ni_at_a2150.c.

#define CLOCK_DIVISOR_BITS (   x)    (((x) & 0x3) << 5)

Definition at line 89 of file ni_at_a2150.c.

#define CLOCK_MASK   (0xf << 3)

Definition at line 90 of file ni_at_a2150.c.

#define CLOCK_SELECT_BITS (   x)    (((x) & 0x3) << 3)

Definition at line 88 of file ni_at_a2150.c.

#define CONFIG_REG   0x0

Definition at line 85 of file ni_at_a2150.c.

#define DCAL_BIT   0x20 /* offset calibration in progress */

Definition at line 109 of file ni_at_a2150.c.

#define DELAY_TRIGGER_BITS   0x3

Definition at line 99 of file ni_at_a2150.c.

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

Definition at line 172 of file ni_at_a2150.c.

#define DMA_CHAN_BITS (   x)    ((x) & 0x7) /* sets dma channel */

Definition at line 114 of file ni_at_a2150.c.

#define DMA_DEM_EN_BIT   0x1000 /* enables demand mode dma */

Definition at line 120 of file ni_at_a2150.c.

#define DMA_EN_BIT   0x8 /* enables dma */

Definition at line 115 of file ni_at_a2150.c.

#define DMA_INTR_EN_BIT   0x800 /* enable interrupt on dma terminal count */

Definition at line 119 of file ni_at_a2150.c.

#define DMA_TC_BIT   0x80 /* dma terminal count interrupt has occurred */

Definition at line 111 of file ni_at_a2150.c.

#define DMA_TC_CLEAR_REG   0xe /* clear dma terminal count interrupt */

Definition at line 104 of file ni_at_a2150.c.

#define DPD_BIT   0x1000 /* digital power down */

Definition at line 96 of file ni_at_a2150.c.

#define EDAQ_BIT   0x10 /* end of acquisition interrupt */

Definition at line 108 of file ni_at_a2150.c.

#define ENABLE0_BIT   0x80 /* enable (don't internally ground) channels 0 and 1 */

Definition at line 91 of file ni_at_a2150.c.

#define ENABLE1_BIT   0x100 /* enable (don't internally ground) channels 2 and 3 */

Definition at line 92 of file ni_at_a2150.c.

#define FIFO_DATA_REG   0xa /* read data */

Definition at line 103 of file ni_at_a2150.c.

#define FIFO_INTR_EN_BIT   0x100 /* enable fifo interrupts */

Definition at line 117 of file ni_at_a2150.c.

#define FIFO_INTR_FHF_BIT   0x200 /* interrupt fifo half full */

Definition at line 118 of file ni_at_a2150.c.

#define FIFO_RESET_REG   0x8 /* clears fifo + fifo flags */

Definition at line 102 of file ni_at_a2150.c.

#define FIFO_START_REG   0x6 /* software start aquistion trigger */

Definition at line 101 of file ni_at_a2150.c.

#define FNE_BIT   0x1 /* fifo not empty */

Definition at line 106 of file ni_at_a2150.c.

#define HW_COUNT_DISABLE   0x30 /* disable hardware counting of conversions */

Definition at line 123 of file ni_at_a2150.c.

#define HW_TRIG_EN   0x10 /* enable hardware trigger */

Definition at line 100 of file ni_at_a2150.c.

#define I8253_BASE_REG   0x14

Definition at line 121 of file ni_at_a2150.c.

#define I8253_MODE_REG   0x17

Definition at line 122 of file ni_at_a2150.c.

#define ID_BITS (   x)    (((x) >> 8) & 0x3)

Definition at line 112 of file ni_at_a2150.c.

#define INTR_BIT   0x40 /* interrupt has occurred */

Definition at line 110 of file ni_at_a2150.c.

#define IRQ_DMA_CNTRL_REG   0x12 /* write only */

Definition at line 113 of file ni_at_a2150.c.

#define IRQ_LVL_BITS (   x)    (((x) & 0xf) << 4) /* sets irq level */

Definition at line 116 of file ni_at_a2150.c.

#define ONE_THIRD_SECOND   333333333
#define OVFL_BIT   0x8 /* fifo overflow */

Definition at line 107 of file ni_at_a2150.c.

#define POST_TRIGGER_BITS   0x2

Definition at line 98 of file ni_at_a2150.c.

#define STATUS_REG   0x12 /* read only */

Definition at line 105 of file ni_at_a2150.c.

#define thisboard   ((const struct a2150_board *)dev->board_ptr)

Definition at line 160 of file ni_at_a2150.c.

#define TRIGGER_REG   0x2 /* trigger config register */

Definition at line 97 of file ni_at_a2150.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
a2150_c 
a2150_s 

Definition at line 141 of file ni_at_a2150.c.

Function Documentation

MODULE_AUTHOR ( "Comedi http://www.comedi.org"  )
module_comedi_driver ( ni_at_a2150_driver  )
MODULE_DESCRIPTION ( "Comedi low-level driver )
MODULE_LICENSE ( "GPL"  )