blob: 813698d18ec8ecd395bbf258cae701dbd9f8e985 [file] [log] [blame]
Barry Song671ece12010-05-07 15:38:59 +01001#ifndef SPI_ADIS16209_H_
2#define SPI_ADIS16209_H_
3
4#define ADIS16209_STARTUP_DELAY 220 /* ms */
5
Barry Song671ece12010-05-07 15:38:59 +01006/* Flash memory write count */
7#define ADIS16209_FLASH_CNT 0x00
8/* Output, power supply */
9#define ADIS16209_SUPPLY_OUT 0x02
10/* Output, x-axis accelerometer */
11#define ADIS16209_XACCL_OUT 0x04
12/* Output, y-axis accelerometer */
13#define ADIS16209_YACCL_OUT 0x06
14/* Output, auxiliary ADC input */
15#define ADIS16209_AUX_ADC 0x08
16/* Output, temperature */
17#define ADIS16209_TEMP_OUT 0x0A
18/* Output, x-axis inclination */
19#define ADIS16209_XINCL_OUT 0x0C
20/* Output, y-axis inclination */
21#define ADIS16209_YINCL_OUT 0x0E
22/* Output, +/-180 vertical rotational position */
23#define ADIS16209_ROT_OUT 0x10
24/* Calibration, x-axis acceleration offset null */
25#define ADIS16209_XACCL_NULL 0x12
26/* Calibration, y-axis acceleration offset null */
27#define ADIS16209_YACCL_NULL 0x14
28/* Calibration, x-axis inclination offset null */
29#define ADIS16209_XINCL_NULL 0x16
30/* Calibration, y-axis inclination offset null */
31#define ADIS16209_YINCL_NULL 0x18
32/* Calibration, vertical rotation offset null */
33#define ADIS16209_ROT_NULL 0x1A
34/* Alarm 1 amplitude threshold */
35#define ADIS16209_ALM_MAG1 0x20
36/* Alarm 2 amplitude threshold */
37#define ADIS16209_ALM_MAG2 0x22
38/* Alarm 1, sample period */
39#define ADIS16209_ALM_SMPL1 0x24
40/* Alarm 2, sample period */
41#define ADIS16209_ALM_SMPL2 0x26
42/* Alarm control */
43#define ADIS16209_ALM_CTRL 0x28
44/* Auxiliary DAC data */
45#define ADIS16209_AUX_DAC 0x30
46/* General-purpose digital input/output control */
47#define ADIS16209_GPIO_CTRL 0x32
48/* Miscellaneous control */
49#define ADIS16209_MSC_CTRL 0x34
50/* Internal sample period (rate) control */
51#define ADIS16209_SMPL_PRD 0x36
52/* Operation, filter configuration */
53#define ADIS16209_AVG_CNT 0x38
54/* Operation, sleep mode control */
55#define ADIS16209_SLP_CNT 0x3A
56/* Diagnostics, system status register */
57#define ADIS16209_DIAG_STAT 0x3C
58/* Operation, system command register */
59#define ADIS16209_GLOB_CMD 0x3E
60
Barry Song671ece12010-05-07 15:38:59 +010061/* MSC_CTRL */
62/* Self-test at power-on: 1 = disabled, 0 = enabled */
Haneen Mohammed0c767062015-03-22 21:23:23 +030063#define ADIS16209_MSC_CTRL_PWRUP_SELF_TEST BIT(10)
Barry Song671ece12010-05-07 15:38:59 +010064/* Self-test enable */
Haneen Mohammed0c767062015-03-22 21:23:23 +030065#define ADIS16209_MSC_CTRL_SELF_TEST_EN BIT(8)
Barry Song671ece12010-05-07 15:38:59 +010066/* Data-ready enable: 1 = enabled, 0 = disabled */
Haneen Mohammed0c767062015-03-22 21:23:23 +030067#define ADIS16209_MSC_CTRL_DATA_RDY_EN BIT(2)
Barry Song671ece12010-05-07 15:38:59 +010068/* Data-ready polarity: 1 = active high, 0 = active low */
Haneen Mohammed0c767062015-03-22 21:23:23 +030069#define ADIS16209_MSC_CTRL_ACTIVE_HIGH BIT(1)
Barry Song671ece12010-05-07 15:38:59 +010070/* Data-ready line selection: 1 = DIO2, 0 = DIO1 */
Haneen Mohammed0c767062015-03-22 21:23:23 +030071#define ADIS16209_MSC_CTRL_DATA_RDY_DIO2 BIT(0)
Barry Song671ece12010-05-07 15:38:59 +010072
73/* DIAG_STAT */
74/* Alarm 2 status: 1 = alarm active, 0 = alarm inactive */
Haneen Mohammed0c767062015-03-22 21:23:23 +030075#define ADIS16209_DIAG_STAT_ALARM2 BIT(9)
Barry Song671ece12010-05-07 15:38:59 +010076/* Alarm 1 status: 1 = alarm active, 0 = alarm inactive */
Haneen Mohammed0c767062015-03-22 21:23:23 +030077#define ADIS16209_DIAG_STAT_ALARM1 BIT(8)
Barry Song671ece12010-05-07 15:38:59 +010078/* Self-test diagnostic error flag: 1 = error condition, 0 = normal operation */
Lars-Peter Clausen511fb292012-11-13 13:28:00 +000079#define ADIS16209_DIAG_STAT_SELFTEST_FAIL_BIT 5
Barry Song671ece12010-05-07 15:38:59 +010080/* SPI communications failure */
Lars-Peter Clausen511fb292012-11-13 13:28:00 +000081#define ADIS16209_DIAG_STAT_SPI_FAIL_BIT 3
Barry Song671ece12010-05-07 15:38:59 +010082/* Flash update failure */
Lars-Peter Clausen511fb292012-11-13 13:28:00 +000083#define ADIS16209_DIAG_STAT_FLASH_UPT_BIT 2
Barry Song671ece12010-05-07 15:38:59 +010084/* Power supply above 3.625 V */
Lars-Peter Clausen511fb292012-11-13 13:28:00 +000085#define ADIS16209_DIAG_STAT_POWER_HIGH_BIT 1
Barry Song671ece12010-05-07 15:38:59 +010086/* Power supply below 3.15 V */
Lars-Peter Clausen511fb292012-11-13 13:28:00 +000087#define ADIS16209_DIAG_STAT_POWER_LOW_BIT 0
Barry Song671ece12010-05-07 15:38:59 +010088
89/* GLOB_CMD */
Haneen Mohammed0c767062015-03-22 21:23:23 +030090#define ADIS16209_GLOB_CMD_SW_RESET BIT(7)
91#define ADIS16209_GLOB_CMD_CLEAR_STAT BIT(4)
92#define ADIS16209_GLOB_CMD_FACTORY_CAL BIT(1)
Barry Song671ece12010-05-07 15:38:59 +010093
Haneen Mohammed0c767062015-03-22 21:23:23 +030094#define ADIS16209_ERROR_ACTIVE BIT(14)
Barry Song671ece12010-05-07 15:38:59 +010095
Jonathan Cameron69584bd2010-07-11 16:39:15 +010096#define ADIS16209_SCAN_SUPPLY 0
97#define ADIS16209_SCAN_ACC_X 1
98#define ADIS16209_SCAN_ACC_Y 2
99#define ADIS16209_SCAN_AUX_ADC 3
100#define ADIS16209_SCAN_TEMP 4
101#define ADIS16209_SCAN_INCLI_X 5
102#define ADIS16209_SCAN_INCLI_Y 6
103#define ADIS16209_SCAN_ROT 7
Barry Song671ece12010-05-07 15:38:59 +0100104
Barry Song671ece12010-05-07 15:38:59 +0100105#endif /* SPI_ADIS16209_H_ */