Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FastAnalogIn FastIO USBDevice mbed FastPWM SimpleDMA
Fork of Pinscape_Controller by
Diff: MMA8451Q/MMA8451Q.h
- Revision:
- 3:3514575d4f86
- Parent:
- 1:d913e0afb2ac
- Child:
- 5:a70c0bce770d
diff -r c174f9ee414a -r 3514575d4f86 MMA8451Q/MMA8451Q.h
--- a/MMA8451Q/MMA8451Q.h Tue Jul 22 04:33:47 2014 +0000
+++ b/MMA8451Q/MMA8451Q.h Wed Jul 23 17:53:28 2014 +0000
@@ -98,6 +98,13 @@
* Read an X,Y pair
*/
void getAccXY(float &x, float &y);
+
+ /**
+ * Read X,Y,Z. This is the most efficient way to fetch
+ * all of the axes at once, since it fetches all three
+ * in a single I2C transaction.
+ */
+ void getAccXYZ(float &x, float &y, float &z);
/**
* Get Z axis acceleration
@@ -112,6 +119,13 @@
* @param res array where acceleration data will be stored
*/
void getAccAllAxis(float * res);
+
+ /**
+ * Set interrupt mode. 'pin' is 1 for INT1_ACCEL (PTA14) and 2 for INT2_ACCEL (PTA15).
+ * The caller is responsible for setting up an interrupt handler on the corresponding
+ * PTAxx pin.
+ */
+ void setInterruptMode(int pin);
private:
I2C m_i2c;
