linux/drivers/staging/iio/accel/adis16201.h
<<
>>
Prefs
   1#ifndef SPI_ADIS16201_H_
   2#define SPI_ADIS16201_H_
   3
   4#define ADIS16201_STARTUP_DELAY 220 /* ms */
   5
   6/* Flash memory write count */
   7#define ADIS16201_FLASH_CNT      0x00
   8
   9/* Output, power supply */
  10#define ADIS16201_SUPPLY_OUT     0x02
  11
  12/* Output, x-axis accelerometer */
  13#define ADIS16201_XACCL_OUT      0x04
  14
  15/* Output, y-axis accelerometer */
  16#define ADIS16201_YACCL_OUT      0x06
  17
  18/* Output, auxiliary ADC input */
  19#define ADIS16201_AUX_ADC        0x08
  20
  21/* Output, temperature */
  22#define ADIS16201_TEMP_OUT       0x0A
  23
  24/* Output, x-axis inclination */
  25#define ADIS16201_XINCL_OUT      0x0C
  26
  27/* Output, y-axis inclination */
  28#define ADIS16201_YINCL_OUT      0x0E
  29
  30/* Calibration, x-axis acceleration offset */
  31#define ADIS16201_XACCL_OFFS     0x10
  32
  33/* Calibration, y-axis acceleration offset */
  34#define ADIS16201_YACCL_OFFS     0x12
  35
  36/* x-axis acceleration scale factor */
  37#define ADIS16201_XACCL_SCALE    0x14
  38
  39/* y-axis acceleration scale factor */
  40#define ADIS16201_YACCL_SCALE    0x16
  41
  42/* Calibration, x-axis inclination offset */
  43#define ADIS16201_XINCL_OFFS     0x18
  44
  45/* Calibration, y-axis inclination offset */
  46#define ADIS16201_YINCL_OFFS     0x1A
  47
  48/* x-axis inclination scale factor */
  49#define ADIS16201_XINCL_SCALE    0x1C
  50
  51/* y-axis inclination scale factor */
  52#define ADIS16201_YINCL_SCALE    0x1E
  53
  54/* Alarm 1 amplitude threshold */
  55#define ADIS16201_ALM_MAG1       0x20
  56
  57/* Alarm 2 amplitude threshold */
  58#define ADIS16201_ALM_MAG2       0x22
  59
  60/* Alarm 1, sample period */
  61#define ADIS16201_ALM_SMPL1      0x24
  62
  63/* Alarm 2, sample period */
  64#define ADIS16201_ALM_SMPL2      0x26
  65
  66/* Alarm control */
  67#define ADIS16201_ALM_CTRL       0x28
  68
  69/* Auxiliary DAC data */
  70#define ADIS16201_AUX_DAC        0x30
  71
  72/* General-purpose digital input/output control */
  73#define ADIS16201_GPIO_CTRL      0x32
  74
  75/* Miscellaneous control */
  76#define ADIS16201_MSC_CTRL       0x34
  77
  78/* Internal sample period (rate) control */
  79#define ADIS16201_SMPL_PRD       0x36
  80
  81/* Operation, filter configuration */
  82#define ADIS16201_AVG_CNT        0x38
  83
  84/* Operation, sleep mode control */
  85#define ADIS16201_SLP_CNT        0x3A
  86
  87/* Diagnostics, system status register */
  88#define ADIS16201_DIAG_STAT      0x3C
  89
  90/* Operation, system command register */
  91#define ADIS16201_GLOB_CMD       0x3E
  92
  93/* MSC_CTRL */
  94
  95/* Self-test enable */
  96#define ADIS16201_MSC_CTRL_SELF_TEST_EN         BIT(8)
  97
  98/* Data-ready enable: 1 = enabled, 0 = disabled */
  99#define ADIS16201_MSC_CTRL_DATA_RDY_EN          BIT(2)
 100
 101/* Data-ready polarity: 1 = active high, 0 = active low */
 102#define ADIS16201_MSC_CTRL_ACTIVE_HIGH          BIT(1)
 103
 104/* Data-ready line selection: 1 = DIO1, 0 = DIO0 */
 105#define ADIS16201_MSC_CTRL_DATA_RDY_DIO1        BIT(0)
 106
 107/* DIAG_STAT */
 108
 109/* Alarm 2 status: 1 = alarm active, 0 = alarm inactive */
 110#define ADIS16201_DIAG_STAT_ALARM2        BIT(9)
 111
 112/* Alarm 1 status: 1 = alarm active, 0 = alarm inactive */
 113#define ADIS16201_DIAG_STAT_ALARM1        BIT(8)
 114
 115/* SPI communications failure */
 116#define ADIS16201_DIAG_STAT_SPI_FAIL_BIT   3
 117
 118/* Flash update failure */
 119#define ADIS16201_DIAG_STAT_FLASH_UPT_BIT  2
 120
 121/* Power supply above 3.625 V */
 122#define ADIS16201_DIAG_STAT_POWER_HIGH_BIT 1
 123
 124/* Power supply below 3.15 V */
 125#define ADIS16201_DIAG_STAT_POWER_LOW_BIT  0
 126
 127/* GLOB_CMD */
 128
 129#define ADIS16201_GLOB_CMD_SW_RESET     BIT(7)
 130#define ADIS16201_GLOB_CMD_FACTORY_CAL  BIT(1)
 131
 132#define ADIS16201_ERROR_ACTIVE          BIT(14)
 133
 134enum adis16201_scan {
 135        ADIS16201_SCAN_ACC_X,
 136        ADIS16201_SCAN_ACC_Y,
 137        ADIS16201_SCAN_INCLI_X,
 138        ADIS16201_SCAN_INCLI_Y,
 139        ADIS16201_SCAN_SUPPLY,
 140        ADIS16201_SCAN_AUX_ADC,
 141        ADIS16201_SCAN_TEMP,
 142};
 143
 144#endif /* SPI_ADIS16201_H_ */
 145