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

Go to the source code of this file.

Data Structures

struct  ad5421_state
 

Macros

#define AD5421_REG_DAC_DATA   0x1
 
#define AD5421_REG_CTRL   0x2
 
#define AD5421_REG_OFFSET   0x3
 
#define AD5421_REG_GAIN   0x4
 
#define AD5421_REG_LOAD_DAC   0x5
 
#define AD5421_REG_FAULT   0x5
 
#define AD5421_REG_FORCE_ALARM_CURRENT   0x6
 
#define AD5421_REG_RESET   0x7
 
#define AD5421_REG_START_CONVERSION   0x8
 
#define AD5421_REG_NOOP   0x9
 
#define AD5421_CTRL_WATCHDOG_DISABLE   BIT(12)
 
#define AD5421_CTRL_AUTO_FAULT_READBACK   BIT(11)
 
#define AD5421_CTRL_MIN_CURRENT   BIT(9)
 
#define AD5421_CTRL_ADC_SOURCE_TEMP   BIT(8)
 
#define AD5421_CTRL_ADC_ENABLE   BIT(7)
 
#define AD5421_CTRL_PWR_DOWN_INT_VREF   BIT(6)
 
#define AD5421_FAULT_SPI   BIT(15)
 
#define AD5421_FAULT_PEC   BIT(14)
 
#define AD5421_FAULT_OVER_CURRENT   BIT(13)
 
#define AD5421_FAULT_UNDER_CURRENT   BIT(12)
 
#define AD5421_FAULT_TEMP_OVER_140   BIT(11)
 
#define AD5421_FAULT_TEMP_OVER_100   BIT(10)
 
#define AD5421_FAULT_UNDER_VOLTAGE_6V   BIT(9)
 
#define AD5421_FAULT_UNDER_VOLTAGE_12V   BIT(8)
 
#define AD5421_FAULT_TRIGGER_IRQ
 

Functions

 module_spi_driver (ad5421_driver)
 
 MODULE_AUTHOR ("Lars-Peter Clausen <[email protected]>")
 
 MODULE_DESCRIPTION ("Analog Devices AD5421 DAC")
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_ALIAS ("spi:ad5421")
 

Macro Definition Documentation

#define AD5421_CTRL_ADC_ENABLE   BIT(7)

Definition at line 42 of file ad5421.c.

#define AD5421_CTRL_ADC_SOURCE_TEMP   BIT(8)

Definition at line 41 of file ad5421.c.

#define AD5421_CTRL_AUTO_FAULT_READBACK   BIT(11)

Definition at line 39 of file ad5421.c.

#define AD5421_CTRL_MIN_CURRENT   BIT(9)

Definition at line 40 of file ad5421.c.

#define AD5421_CTRL_PWR_DOWN_INT_VREF   BIT(6)

Definition at line 43 of file ad5421.c.

#define AD5421_CTRL_WATCHDOG_DISABLE   BIT(12)

Definition at line 38 of file ad5421.c.

#define AD5421_FAULT_OVER_CURRENT   BIT(13)

Definition at line 47 of file ad5421.c.

#define AD5421_FAULT_PEC   BIT(14)

Definition at line 46 of file ad5421.c.

#define AD5421_FAULT_SPI   BIT(15)

Definition at line 45 of file ad5421.c.

#define AD5421_FAULT_TEMP_OVER_100   BIT(10)

Definition at line 50 of file ad5421.c.

#define AD5421_FAULT_TEMP_OVER_140   BIT(11)

Definition at line 49 of file ad5421.c.

#define AD5421_FAULT_TRIGGER_IRQ
Value:

Definition at line 55 of file ad5421.c.

#define AD5421_FAULT_UNDER_CURRENT   BIT(12)

Definition at line 48 of file ad5421.c.

#define AD5421_FAULT_UNDER_VOLTAGE_12V   BIT(8)

Definition at line 52 of file ad5421.c.

#define AD5421_FAULT_UNDER_VOLTAGE_6V   BIT(9)

Definition at line 51 of file ad5421.c.

#define AD5421_REG_CTRL   0x2

Definition at line 26 of file ad5421.c.

#define AD5421_REG_DAC_DATA   0x1

Definition at line 25 of file ad5421.c.

#define AD5421_REG_FAULT   0x5

Definition at line 32 of file ad5421.c.

#define AD5421_REG_FORCE_ALARM_CURRENT   0x6

Definition at line 33 of file ad5421.c.

#define AD5421_REG_GAIN   0x4

Definition at line 28 of file ad5421.c.

#define AD5421_REG_LOAD_DAC   0x5

Definition at line 31 of file ad5421.c.

#define AD5421_REG_NOOP   0x9

Definition at line 36 of file ad5421.c.

#define AD5421_REG_OFFSET   0x3

Definition at line 27 of file ad5421.c.

#define AD5421_REG_RESET   0x7

Definition at line 34 of file ad5421.c.

#define AD5421_REG_START_CONVERSION   0x8

Definition at line 35 of file ad5421.c.

Function Documentation

MODULE_ALIAS ( "spi:ad5421"  )
MODULE_AUTHOR ( "Lars-Peter Clausen <[email protected]>"  )
MODULE_DESCRIPTION ( "Analog Devices AD5421 DAC )
MODULE_LICENSE ( "GPL v2 )
module_spi_driver ( ad5421_driver  )