Starting library to get the SI1143 Gesture Sensor to work. Currently only works in forced conversion mode.

Dependents:   Gesture_Sensor Gesture_Arm_Robot mbed_gesture Gesture_Sensor_Sample ... more

Revision:
5:3fadc61598bc
Parent:
4:af8f820733e0
Child:
6:50b60d59d568
diff -r af8f820733e0 -r 3fadc61598bc SI1143.h
--- a/SI1143.h	Thu Oct 17 23:23:33 2013 +0000
+++ b/SI1143.h	Mon Oct 21 20:12:56 2013 +0000
@@ -178,28 +178,58 @@
         SI1143(PinName sda, PinName scl);
         
         /**
-         * Takes a sample from the device and returns a raw output.
-         *
-         * @param   point Used to get a specific value from the device.
-         *          A value of 1 will output proximity of led1, a value of 2 will output proximity of led2,
-         *          a value of 3 will output proximity of led3, a value of 4 will output ambient light,
-         *          a value of 5 will output infrared light, and any other value will output 0.
-         * @return  In forced conversion output mode, will display a raw output minus any baseline,
-         *          where as the greater the value, the closer the object is to the device
-         *          (applies to proximity leds).
+         * Restarts the device.
          */
-        int sample(int point);
+        void restart(void);
         
         /**
          * Creates a baseline for sampling measurements.
          * Should be done early in your code and after a reset.
          */
-        void bias(void);
+        void bias(int ready, int repeat);
+        
+        /**
+         * Takes a number of samples from the proximity of led1 and returns a raw output.
+         *
+         * @param   repeat Tells how many samples to get from the device. Each sample takes 4 ms.
+         * @return  In forced conversion output mode, will display a raw output of the average sample
+         *          minus any baseline, where as the greater the value, the closer the object is to the device.
+         */
+        int get_ps1(int repeat);
+        
+        /**
+         * Takes a number of samples from the proximity of led2 and returns a raw output.
+         *
+         * @param   repeat Tells how many samples to get from the device. Each sample takes 4 ms.
+         * @return  In forced conversion output mode, will display a raw output of the average sample
+         *          minus any baseline, where as the greater the value, the closer the object is to the device.
+         */
+        int get_ps2(int repeat);
         
         /**
-         * Restarts the device.
+         * Takes a number of samples from the proximity of led3 and returns a raw output.
+         *
+         * @param   repeat Tells how many samples to get from the device. Each sample takes 4 ms.
+         * @return  In forced conversion output mode, will display a raw output of the average sample
+         *          minus any baseline, where as the greater the value, the closer the object is to the device.
          */
-        void restart(void);
+        int get_ps3(int repeat);
+        
+        /**
+         * Takes a number of samples for ambient light on device and returns a raw output.
+         *
+         * @param   repeat Tells how many samples to get from the device. Each sample takes 4 ms.
+         * @return  In forced conversion output mode, will display a raw output of the average sample.
+         */
+        int get_vis(int repeat);
+        
+        /**
+         * Takes a number of samples for infrared light on device and returns a raw output.
+         *
+         * @param   repeat Tells how many samples to get from the device. Each sample takes 4 ms.
+         * @return  In forced conversion output mode, will display a raw output of the average sample.
+         */
+        int get_ir(int repeat);
         
     private: