Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ad7152.c File Reference
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

Go to the source code of this file.

Data Structures

struct  ad7152_chip_info
 

Macros

#define AD7152_REG_STATUS   0
 
#define AD7152_REG_CH1_DATA_HIGH   1
 
#define AD7152_REG_CH2_DATA_HIGH   3
 
#define AD7152_REG_CH1_OFFS_HIGH   5
 
#define AD7152_REG_CH2_OFFS_HIGH   7
 
#define AD7152_REG_CH1_GAIN_HIGH   9
 
#define AD7152_REG_CH1_SETUP   11
 
#define AD7152_REG_CH2_GAIN_HIGH   12
 
#define AD7152_REG_CH2_SETUP   14
 
#define AD7152_REG_CFG   15
 
#define AD7152_REG_RESEVERD   16
 
#define AD7152_REG_CAPDAC_POS   17
 
#define AD7152_REG_CAPDAC_NEG   18
 
#define AD7152_REG_CFG2   26
 
#define AD7152_STATUS_RDY1   (1 << 0)
 
#define AD7152_STATUS_RDY2   (1 << 1)
 
#define AD7152_STATUS_C1C2   (1 << 2)
 
#define AD7152_STATUS_PWDN   (1 << 7)
 
#define AD7152_SETUP_CAPDIFF   (1 << 5)
 
#define AD7152_SETUP_RANGE_2pF   (0 << 6)
 
#define AD7152_SETUP_RANGE_0_5pF   (1 << 6)
 
#define AD7152_SETUP_RANGE_1pF   (2 << 6)
 
#define AD7152_SETUP_RANGE_4pF   (3 << 6)
 
#define AD7152_SETUP_RANGE(x)   ((x) << 6)
 
#define AD7152_CONF_CH2EN   (1 << 3)
 
#define AD7152_CONF_CH1EN   (1 << 4)
 
#define AD7152_CONF_MODE_IDLE   (0 << 0)
 
#define AD7152_CONF_MODE_CONT_CONV   (1 << 0)
 
#define AD7152_CONF_MODE_SINGLE_CONV   (2 << 0)
 
#define AD7152_CONF_MODE_OFFS_CAL   (5 << 0)
 
#define AD7152_CONF_MODE_GAIN_CAL   (6 << 0)
 
#define AD7152_CAPDAC_DACEN   (1 << 7)
 
#define AD7152_CAPDAC_DACP(x)   ((x) & 0x1F)
 
#define AD7152_CFG2_OSR(x)   (((x) & 0x3) << 4)
 

Enumerations

enum  { AD7152_DATA, AD7152_OFFS, AD7152_GAIN, AD7152_SETUP }
 

Functions

 MODULE_DEVICE_TABLE (i2c, ad7152_id)
 
 module_i2c_driver (ad7152_driver)
 
 MODULE_AUTHOR ("Barry Song <[email protected]>")
 
 MODULE_DESCRIPTION ("Analog Devices AD7152/3 capacitive sensor driver")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define AD7152_CAPDAC_DACEN   (1 << 7)

Definition at line 67 of file ad7152.c.

#define AD7152_CAPDAC_DACP (   x)    ((x) & 0x1F)

Definition at line 68 of file ad7152.c.

#define AD7152_CFG2_OSR (   x)    (((x) & 0x3) << 4)

Definition at line 71 of file ad7152.c.

#define AD7152_CONF_CH1EN   (1 << 4)

Definition at line 59 of file ad7152.c.

#define AD7152_CONF_CH2EN   (1 << 3)

Definition at line 58 of file ad7152.c.

#define AD7152_CONF_MODE_CONT_CONV   (1 << 0)

Definition at line 61 of file ad7152.c.

#define AD7152_CONF_MODE_GAIN_CAL   (6 << 0)

Definition at line 64 of file ad7152.c.

#define AD7152_CONF_MODE_IDLE   (0 << 0)

Definition at line 60 of file ad7152.c.

#define AD7152_CONF_MODE_OFFS_CAL   (5 << 0)

Definition at line 63 of file ad7152.c.

#define AD7152_CONF_MODE_SINGLE_CONV   (2 << 0)

Definition at line 62 of file ad7152.c.

#define AD7152_REG_CAPDAC_NEG   18

Definition at line 40 of file ad7152.c.

#define AD7152_REG_CAPDAC_POS   17

Definition at line 39 of file ad7152.c.

#define AD7152_REG_CFG   15

Definition at line 37 of file ad7152.c.

#define AD7152_REG_CFG2   26

Definition at line 41 of file ad7152.c.

#define AD7152_REG_CH1_DATA_HIGH   1

Definition at line 29 of file ad7152.c.

#define AD7152_REG_CH1_GAIN_HIGH   9

Definition at line 33 of file ad7152.c.

#define AD7152_REG_CH1_OFFS_HIGH   5

Definition at line 31 of file ad7152.c.

#define AD7152_REG_CH1_SETUP   11

Definition at line 34 of file ad7152.c.

#define AD7152_REG_CH2_DATA_HIGH   3

Definition at line 30 of file ad7152.c.

#define AD7152_REG_CH2_GAIN_HIGH   12

Definition at line 35 of file ad7152.c.

#define AD7152_REG_CH2_OFFS_HIGH   7

Definition at line 32 of file ad7152.c.

#define AD7152_REG_CH2_SETUP   14

Definition at line 36 of file ad7152.c.

#define AD7152_REG_RESEVERD   16

Definition at line 38 of file ad7152.c.

#define AD7152_REG_STATUS   0

Definition at line 28 of file ad7152.c.

#define AD7152_SETUP_CAPDIFF   (1 << 5)

Definition at line 50 of file ad7152.c.

#define AD7152_SETUP_RANGE (   x)    ((x) << 6)

Definition at line 55 of file ad7152.c.

#define AD7152_SETUP_RANGE_0_5pF   (1 << 6)

Definition at line 52 of file ad7152.c.

#define AD7152_SETUP_RANGE_1pF   (2 << 6)

Definition at line 53 of file ad7152.c.

#define AD7152_SETUP_RANGE_2pF   (0 << 6)

Definition at line 51 of file ad7152.c.

#define AD7152_SETUP_RANGE_4pF   (3 << 6)

Definition at line 54 of file ad7152.c.

#define AD7152_STATUS_C1C2   (1 << 2)

Definition at line 46 of file ad7152.c.

#define AD7152_STATUS_PWDN   (1 << 7)

Definition at line 47 of file ad7152.c.

#define AD7152_STATUS_RDY1   (1 << 0)

Definition at line 44 of file ad7152.c.

#define AD7152_STATUS_RDY2   (1 << 1)

Definition at line 45 of file ad7152.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
AD7152_DATA 
AD7152_OFFS 
AD7152_GAIN 
AD7152_SETUP 

Definition at line 73 of file ad7152.c.

Function Documentation

MODULE_AUTHOR ( "Barry Song <[email protected]>"  )
MODULE_DESCRIPTION ( "Analog Devices AD7152/3 capacitive sensor driver )
MODULE_DEVICE_TABLE ( i2c  ,
ad7152_id   
)
module_i2c_driver ( ad7152_driver  )
MODULE_LICENSE ( "GPL v2 )