|
#define | TS_POLL_DELAY 1 /* ms delay before the first sample */ |
|
#define | TS_POLL_PERIOD 5 /* ms delay between samples */ |
|
#define | SAMPLE_BITS (8 /*cmd*/ + 16 /*sample*/ + 2 /* before, after */) |
|
#define | CS_CHANGE(xfer) ((xfer).cs_change = 0) |
|
#define | ADS_START (1 << 7) |
|
#define | ADS_A2A1A0_d_y (1 << 4) /* differential */ |
|
#define | ADS_A2A1A0_d_z1 (3 << 4) /* differential */ |
|
#define | ADS_A2A1A0_d_z2 (4 << 4) /* differential */ |
|
#define | ADS_A2A1A0_d_x (5 << 4) /* differential */ |
|
#define | ADS_A2A1A0_temp0 (0 << 4) /* non-differential */ |
|
#define | ADS_A2A1A0_vbatt (2 << 4) /* non-differential */ |
|
#define | ADS_A2A1A0_vaux (6 << 4) /* non-differential */ |
|
#define | ADS_A2A1A0_temp1 (7 << 4) /* non-differential */ |
|
#define | ADS_8_BIT (1 << 3) |
|
#define | ADS_12_BIT (0 << 3) |
|
#define | ADS_SER (1 << 2) /* non-differential */ |
|
#define | ADS_DFR (0 << 2) /* differential */ |
|
#define | ADS_PD10_PDOWN (0 << 0) /* low power mode + penirq */ |
|
#define | ADS_PD10_ADC_ON (1 << 0) /* ADC on */ |
|
#define | ADS_PD10_REF_ON (2 << 0) /* vREF on + penirq */ |
|
#define | ADS_PD10_ALL_ON (3 << 0) /* ADC + vREF on */ |
|
#define | MAX_12BIT ((1<<12)-1) |
|
#define | READ_12BIT_DFR(x, adc, vref) |
|
#define | READ_Y(vref) (READ_12BIT_DFR(y, 1, vref)) |
|
#define | READ_Z1(vref) (READ_12BIT_DFR(z1, 1, vref)) |
|
#define | READ_Z2(vref) (READ_12BIT_DFR(z2, 1, vref)) |
|
#define | READ_X(vref) (READ_12BIT_DFR(x, 1, vref)) |
|
#define | PWRDOWN (READ_12BIT_DFR(y, 0, 0)) /* LAST */ |
|
#define | READ_12BIT_SER(x) |
|
#define | REF_ON (READ_12BIT_DFR(x, 1, 1)) |
|
#define | REF_OFF (READ_12BIT_DFR(y, 0, 0)) |
|