Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ads7871.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/spi/spi.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/delay.h>

Go to the source code of this file.

Data Structures

struct  ads7871_data
 

Macros

#define REG_LS_BYTE   0 /*A/D Output Data, LS Byte*/
 
#define REG_MS_BYTE   1 /*A/D Output Data, MS Byte*/
 
#define REG_PGA_VALID   2 /*PGA Valid Register*/
 
#define REG_AD_CONTROL   3 /*A/D Control Register*/
 
#define REG_GAIN_MUX   4 /*Gain/Mux Register*/
 
#define REG_IO_STATE   5 /*Digital I/O State Register*/
 
#define REG_IO_CONTROL   6 /*Digital I/O Control Register*/
 
#define REG_OSC_CONTROL   7 /*Rev/Oscillator Control Register*/
 
#define REG_SER_CONTROL   24 /*Serial Interface Control Register*/
 
#define REG_ID   31 /*ID Register*/
 
#define INST_MODE_bm   (1<<7)
 
#define INST_READ_bm   (1<<6)
 
#define INST_16BIT_bm   (1<<5)
 
#define MUX_CNV_bv   7
 
#define MUX_CNV_bm   (1<<MUX_CNV_bv)
 
#define MUX_M3_bm   (1<<3) /*M3 selects single ended*/
 
#define MUX_G_bv   4 /*allows for reg = (gain << MUX_G_bv) | ...*/
 
#define OSC_OSCR_bm   (1<<5)
 
#define OSC_OSCE_bm   (1<<4)
 
#define OSC_REFE_bm   (1<<3)
 
#define OSC_BUFE_bm   (1<<2)
 
#define OSC_R2V_bm   (1<<1)
 
#define OSC_RBG_bm   (1<<0)
 
#define DEVICE_NAME   "ads7871"
 

Functions

 module_spi_driver (ads7871_driver)
 
 MODULE_AUTHOR ("Paul Thomas <[email protected]>")
 
 MODULE_DESCRIPTION ("TI ADS7871 A/D driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define DEVICE_NAME   "ads7871"

Definition at line 72 of file ads7871.c.

#define INST_16BIT_bm   (1<<5)

Definition at line 45 of file ads7871.c.

#define INST_MODE_bm   (1<<7)

Definition at line 43 of file ads7871.c.

#define INST_READ_bm   (1<<6)

Definition at line 44 of file ads7871.c.

#define MUX_CNV_bm   (1<<MUX_CNV_bv)

Definition at line 50 of file ads7871.c.

#define MUX_CNV_bv   7

Definition at line 49 of file ads7871.c.

#define MUX_G_bv   4 /*allows for reg = (gain << MUX_G_bv) | ...*/

Definition at line 52 of file ads7871.c.

#define MUX_M3_bm   (1<<3) /*M3 selects single ended*/

Definition at line 51 of file ads7871.c.

#define OSC_BUFE_bm   (1<<2)

Definition at line 59 of file ads7871.c.

#define OSC_OSCE_bm   (1<<4)

Definition at line 57 of file ads7871.c.

#define OSC_OSCR_bm   (1<<5)

Definition at line 56 of file ads7871.c.

#define OSC_R2V_bm   (1<<1)

Definition at line 60 of file ads7871.c.

#define OSC_RBG_bm   (1<<0)

Definition at line 61 of file ads7871.c.

#define OSC_REFE_bm   (1<<3)

Definition at line 58 of file ads7871.c.

#define REG_AD_CONTROL   3 /*A/D Control Register*/

Definition at line 29 of file ads7871.c.

#define REG_GAIN_MUX   4 /*Gain/Mux Register*/

Definition at line 30 of file ads7871.c.

#define REG_ID   31 /*ID Register*/

Definition at line 35 of file ads7871.c.

#define REG_IO_CONTROL   6 /*Digital I/O Control Register*/

Definition at line 32 of file ads7871.c.

#define REG_IO_STATE   5 /*Digital I/O State Register*/

Definition at line 31 of file ads7871.c.

#define REG_LS_BYTE   0 /*A/D Output Data, LS Byte*/

Definition at line 26 of file ads7871.c.

#define REG_MS_BYTE   1 /*A/D Output Data, MS Byte*/

Definition at line 27 of file ads7871.c.

#define REG_OSC_CONTROL   7 /*Rev/Oscillator Control Register*/

Definition at line 33 of file ads7871.c.

#define REG_PGA_VALID   2 /*PGA Valid Register*/

Definition at line 28 of file ads7871.c.

#define REG_SER_CONTROL   24 /*Serial Interface Control Register*/

Definition at line 34 of file ads7871.c.

Function Documentation

MODULE_AUTHOR ( "Paul Thomas <[email protected]>"  )
MODULE_DESCRIPTION ( "TI ADS7871 A/D driver )
MODULE_LICENSE ( "GPL"  )
module_spi_driver ( ads7871_driver  )