Go to the documentation of this file. 1 #ifndef SPI_ADIS16220_H_
2 #define SPI_ADIS16220_H_
4 #define ADIS16220_STARTUP_DELAY 220
6 #define ADIS16220_READ_REG(a) a
7 #define ADIS16220_WRITE_REG(a) ((a) | 0x80)
10 #define ADIS16220_FLASH_CNT 0x00
12 #define ADIS16220_ACCL_NULL 0x02
14 #define ADIS16220_AIN1_NULL 0x04
16 #define ADIS16220_AIN2_NULL 0x06
18 #define ADIS16220_CAPT_SUPPLY 0x0A
20 #define ADIS16220_CAPT_TEMP 0x0C
22 #define ADIS16220_CAPT_PEAKA 0x0E
24 #define ADIS16220_CAPT_PEAK1 0x10
26 #define ADIS16220_CAPT_PEAK2 0x12
28 #define ADIS16220_CAPT_BUFA 0x14
30 #define ADIS16220_CAPT_BUF1 0x16
32 #define ADIS16220_CAPT_BUF2 0x18
34 #define ADIS16220_CAPT_PNTR 0x1A
36 #define ADIS16220_CAPT_CTRL 0x1C
38 #define ADIS16220_CAPT_PRD 0x1E
40 #define ADIS16220_ALM_MAGA 0x20
42 #define ADIS16220_ALM_MAG1 0x22
44 #define ADIS16220_ALM_MAG2 0x24
46 #define ADIS16220_ALM_MAGS 0x26
48 #define ADIS16220_ALM_CTRL 0x28
50 #define ADIS16220_GPIO_CTRL 0x32
52 #define ADIS16220_MSC_CTRL 0x34
54 #define ADIS16220_DIO_CTRL 0x36
56 #define ADIS16220_AVG_CNT 0x38
58 #define ADIS16220_DIAG_STAT 0x3C
60 #define ADIS16220_GLOB_CMD 0x3E
62 #define ADIS16220_ST_DELTA 0x40
64 #define ADIS16220_LOT_ID1 0x52
66 #define ADIS16220_LOT_ID2 0x54
68 #define ADIS16220_PROD_ID 0x56
70 #define ADIS16220_SERIAL_NUM 0x58
72 #define ADIS16220_CAPTURE_SIZE 2048
75 #define ADIS16220_MSC_CTRL_SELF_TEST_EN (1 << 8)
76 #define ADIS16220_MSC_CTRL_POWER_SUP_COM_AIN1 (1 << 1)
77 #define ADIS16220_MSC_CTRL_POWER_SUP_COM_AIN2 (1 << 0)
80 #define ADIS16220_MSC_CTRL_DIO2_BUSY_IND (3<<4)
81 #define ADIS16220_MSC_CTRL_DIO1_BUSY_IND (3<<2)
82 #define ADIS16220_MSC_CTRL_DIO2_ACT_HIGH (1<<1)
83 #define ADIS16220_MSC_CTRL_DIO1_ACT_HIGH (1<<0)
87 #define ADIS16220_DIAG_STAT_ALM_MAG2 (1<<14)
89 #define ADIS16220_DIAG_STAT_ALM_MAG1 (1<<13)
91 #define ADIS16220_DIAG_STAT_ALM_MAGA (1<<12)
93 #define ADIS16220_DIAG_STAT_ALM_MAGS (1<<11)
95 #define ADIS16220_DIAG_STAT_PEAK_AIN2 (1<<10)
97 #define ADIS16220_DIAG_STAT_PEAK_AIN1 (1<<9)
99 #define ADIS16220_DIAG_STAT_PEAK_ACCEL (1<<8)
101 #define ADIS16220_DIAG_STAT_DATA_RDY (1<<7)
102 #define ADIS16220_DIAG_STAT_FLASH_CHK (1<<6)
103 #define ADIS16220_DIAG_STAT_SELF_TEST (1<<5)
105 #define ADIS16220_DIAG_STAT_VIOLATION (1<<4)
107 #define ADIS16220_DIAG_STAT_SPI_FAIL (1<<3)
109 #define ADIS16220_DIAG_STAT_FLASH_UPT (1<<2)
111 #define ADIS16220_DIAG_STAT_POWER_HIGH (1<<1)
113 #define ADIS16220_DIAG_STAT_POWER_LOW (1<<0)
116 #define ADIS16220_GLOB_CMD_SW_RESET (1<<7)
117 #define ADIS16220_GLOB_CMD_SELF_TEST (1<<2)
118 #define ADIS16220_GLOB_CMD_PWR_DOWN (1<<1)
120 #define ADIS16220_MAX_TX 2048
121 #define ADIS16220_MAX_RX 2048
123 #define ADIS16220_SPI_BURST (u32)(1000 * 1000)
124 #define ADIS16220_SPI_FAST (u32)(2000 * 1000)