summaryrefslogtreecommitdiff
path: root/src/drivers/ao_mma655x.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-12-20 22:04:53 -0800
committerKeith Packard <keithp@keithp.com>2013-12-20 22:04:53 -0800
commit2a912dcde191e2f750845c464611641a5abdc28a (patch)
treecfca4531be3f87fc9a797964b14e583ba902f69c /src/drivers/ao_mma655x.h
parentb89fb51a963635e2effe3a31f803bfc29c2c46b7 (diff)
altos: Execute self-test on MMA655X part
This doesn't check for fine calibration, just makes sure the part is within the broad tolerances specified by the manufacturer. The subtle fix here was actually getting reset working -- there was a typo in the bitpattern definition which caused the reset to fail, making it hard to self-test the part, as self-test is only valid before the part is running. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers/ao_mma655x.h')
-rw-r--r--src/drivers/ao_mma655x.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/drivers/ao_mma655x.h b/src/drivers/ao_mma655x.h
index 2d951e07..e57e3377 100644
--- a/src/drivers/ao_mma655x.h
+++ b/src/drivers/ao_mma655x.h
@@ -78,6 +78,14 @@
#define AO_MMA655X_COUNT 0x15
#define AO_MMA655X_OFFCORR 0x16
+/*
+ * Range of valid self-test difference from
+ * normal measurement
+ */
+
+#define AO_ST_MIN 300
+#define AO_ST_MAX 800
+
extern uint16_t ao_mma655x_current;
void