1 #ifndef SPI_ADIS16209_H_
2 #define SPI_ADIS16209_H_
4 #define ADIS16209_STARTUP_DELAY 220 /* ms */
6 /* Flash memory write count */
7 #define ADIS16209_FLASH_CNT 0x00
9 /* Output, power supply */
10 #define ADIS16209_SUPPLY_OUT 0x02
12 /* Output, x-axis accelerometer */
13 #define ADIS16209_XACCL_OUT 0x04
15 /* Output, y-axis accelerometer */
16 #define ADIS16209_YACCL_OUT 0x06
18 /* Output, auxiliary ADC input */
19 #define ADIS16209_AUX_ADC 0x08
21 /* Output, temperature */
22 #define ADIS16209_TEMP_OUT 0x0A
24 /* Output, x-axis inclination */
25 #define ADIS16209_XINCL_OUT 0x0C
27 /* Output, y-axis inclination */
28 #define ADIS16209_YINCL_OUT 0x0E
30 /* Output, +/-180 vertical rotational position */
31 #define ADIS16209_ROT_OUT 0x10
33 /* Calibration, x-axis acceleration offset null */
34 #define ADIS16209_XACCL_NULL 0x12
36 /* Calibration, y-axis acceleration offset null */
37 #define ADIS16209_YACCL_NULL 0x14
39 /* Calibration, x-axis inclination offset null */
40 #define ADIS16209_XINCL_NULL 0x16
42 /* Calibration, y-axis inclination offset null */
43 #define ADIS16209_YINCL_NULL 0x18
45 /* Calibration, vertical rotation offset null */
46 #define ADIS16209_ROT_NULL 0x1A
48 /* Alarm 1 amplitude threshold */
49 #define ADIS16209_ALM_MAG1 0x20
51 /* Alarm 2 amplitude threshold */
52 #define ADIS16209_ALM_MAG2 0x22
54 /* Alarm 1, sample period */
55 #define ADIS16209_ALM_SMPL1 0x24
57 /* Alarm 2, sample period */
58 #define ADIS16209_ALM_SMPL2 0x26
61 #define ADIS16209_ALM_CTRL 0x28
63 /* Auxiliary DAC data */
64 #define ADIS16209_AUX_DAC 0x30
66 /* General-purpose digital input/output control */
67 #define ADIS16209_GPIO_CTRL 0x32
69 /* Miscellaneous control */
70 #define ADIS16209_MSC_CTRL 0x34
72 /* Internal sample period (rate) control */
73 #define ADIS16209_SMPL_PRD 0x36
75 /* Operation, filter configuration */
76 #define ADIS16209_AVG_CNT 0x38
78 /* Operation, sleep mode control */
79 #define ADIS16209_SLP_CNT 0x3A
81 /* Diagnostics, system status register */
82 #define ADIS16209_DIAG_STAT 0x3C
84 /* Operation, system command register */
85 #define ADIS16209_GLOB_CMD 0x3E
89 /* Self-test at power-on: 1 = disabled, 0 = enabled */
90 #define ADIS16209_MSC_CTRL_PWRUP_SELF_TEST BIT(10)
92 /* Self-test enable */
93 #define ADIS16209_MSC_CTRL_SELF_TEST_EN BIT(8)
95 /* Data-ready enable: 1 = enabled, 0 = disabled */
96 #define ADIS16209_MSC_CTRL_DATA_RDY_EN BIT(2)
98 /* Data-ready polarity: 1 = active high, 0 = active low */
99 #define ADIS16209_MSC_CTRL_ACTIVE_HIGH BIT(1)
101 /* Data-ready line selection: 1 = DIO2, 0 = DIO1 */
102 #define ADIS16209_MSC_CTRL_DATA_RDY_DIO2 BIT(0)
106 /* Alarm 2 status: 1 = alarm active, 0 = alarm inactive */
107 #define ADIS16209_DIAG_STAT_ALARM2 BIT(9)
109 /* Alarm 1 status: 1 = alarm active, 0 = alarm inactive */
110 #define ADIS16209_DIAG_STAT_ALARM1 BIT(8)
112 /* Self-test diagnostic error flag: 1 = error condition, 0 = normal operation */
113 #define ADIS16209_DIAG_STAT_SELFTEST_FAIL_BIT 5
115 /* SPI communications failure */
116 #define ADIS16209_DIAG_STAT_SPI_FAIL_BIT 3
118 /* Flash update failure */
119 #define ADIS16209_DIAG_STAT_FLASH_UPT_BIT 2
121 /* Power supply above 3.625 V */
122 #define ADIS16209_DIAG_STAT_POWER_HIGH_BIT 1
124 /* Power supply below 3.15 V */
125 #define ADIS16209_DIAG_STAT_POWER_LOW_BIT 0
129 #define ADIS16209_GLOB_CMD_SW_RESET BIT(7)
130 #define ADIS16209_GLOB_CMD_CLEAR_STAT BIT(4)
131 #define ADIS16209_GLOB_CMD_FACTORY_CAL BIT(1)
133 #define ADIS16209_ERROR_ACTIVE BIT(14)
135 #define ADIS16209_SCAN_SUPPLY 0
136 #define ADIS16209_SCAN_ACC_X 1
137 #define ADIS16209_SCAN_ACC_Y 2
138 #define ADIS16209_SCAN_AUX_ADC 3
139 #define ADIS16209_SCAN_TEMP 4
140 #define ADIS16209_SCAN_INCLI_X 5
141 #define ADIS16209_SCAN_INCLI_Y 6
142 #define ADIS16209_SCAN_ROT 7
144 #endif /* SPI_ADIS16209_H_ */