Llibrary for the WiGo MPL3115A2, I2C Precision Altimeter sensor. This is a temp fork

Dependents:   sensor AerCloud_MutliTech_Socket_Modem_Example Freescale_Multi-Sensor_Shield 2lemetry_Sensor_Example ... more

Fork of MPL3115A2 by clemente di caprio

Revision:
3:a2f1752add9a
Parent:
2:a2fcfb7ff611
Child:
4:fdf14a259af8
diff -r a2fcfb7ff611 -r a2f1752add9a MPL3115A2.h
--- a/MPL3115A2.h	Wed May 29 05:57:15 2013 +0000
+++ b/MPL3115A2.h	Wed May 29 11:56:52 2013 +0000
@@ -3,15 +3,15 @@
 
 #include "mbed.h"
 
-/* Oversampling */
-#define OVERSAMPLE_RATIO_1      0
-#define OVERSAMPLE_RATIO_2      1
-#define OVERSAMPLE_RATIO_4      2
-#define OVERSAMPLE_RATIO_8      3
-#define OVERSAMPLE_RATIO_16     4
-#define OVERSAMPLE_RATIO_32     5
-#define OVERSAMPLE_RATIO_64     6
-#define OVERSAMPLE_RATIO_128    7
+// Oversampling value and minimum time between sample
+#define OVERSAMPLE_RATIO_1      0       // 6 ms
+#define OVERSAMPLE_RATIO_2      1       // 10 ms
+#define OVERSAMPLE_RATIO_4      2       // 18 ms
+#define OVERSAMPLE_RATIO_8      3       // 34 ms
+#define OVERSAMPLE_RATIO_16     4       // 66 ms
+#define OVERSAMPLE_RATIO_32     5       // 130 ms
+#define OVERSAMPLE_RATIO_64     6       // 258 ms
+#define OVERSAMPLE_RATIO_128    7       // 512 ms
 
 /* Mode */
 #define ALTIMETER_MODE      1
@@ -143,6 +143,14 @@
     * @return none
     */
     void DataReady( void(*fptr)(void), unsigned char OS);
+
+    /**
+    * Configure the sensor to streaming data using Interrupt
+    *
+    * @param user functin callback, oversampling values. See MPL3115A2.h
+    * @return none
+    */
+    void AltitudeTrigger( void(*fptr)(void), unsigned short level);
     
     /**
     * Soft Reset
@@ -158,6 +166,7 @@
     unsigned char MPL3115A2_mode;
     unsigned char MPL3115A2_oversampling;
     void DataReady_IRQ( void);
+    void AltitudeTrg_IRQ( void);
     
     /** Set the device in active mode
     */