Example of single tap and double tap detection for LSM6DSL in X-NUCLEO-IKS01A2

Dependencies:   X_NUCLEO_IKS01A2 mbed

Fork of SingleDoubleTap_IKS01A2 by ST Expansion SW Team

Single and Double Tap Demo Application based on sensor expansion board X-NUCLEO-IKS01A2

Main function is to show how to detect the single and double tap events using the sensor expansion board and send a notification using UART to a connected PC or Desktop and display it on terminal applications like TeraTerm.
After connection has been established:
- the user can try to tap the board and then view the notification using an hyper terminal. When the single tap is detected, the LED is switched on for a while.
- the user can press the user button to pass from the single tap detection to the double tap detection feature. The user can try to double tap the board and then view the notification using an hyper terminal. When the double tap is detected, the LED is switched on twice for a while.
- the user can press again the user button to disable the single and double tap detection feature.
- the user can press the user button to enable again the single tap detection feature and so on.

Revision:
7:4f512b172555
Parent:
6:2380444e4c75
--- a/X_NUCLEO_IKS01A2/Components/LSM6DSLSensor/LSM6DSLSensor.h	Wed Nov 23 16:46:14 2016 +0000
+++ b/X_NUCLEO_IKS01A2/Components/LSM6DSLSensor/LSM6DSLSensor.h	Thu Nov 24 16:45:55 2016 +0000
@@ -99,6 +99,12 @@
 
 /* Typedefs ------------------------------------------------------------------*/
 
+typedef enum
+{
+  LSM6DSL_INT1_PIN,
+  LSM6DSL_INT2_PIN
+} LSM6DSL_Interrupt_Pin_t;
+
 typedef struct
 {
   unsigned int FreeFallStatus : 1;
@@ -142,6 +148,7 @@
     int Disable_X(void);
     int Disable_G(void);
     int Enable_Free_Fall_Detection(void);
+    int Enable_Free_Fall_Detection(LSM6DSL_Interrupt_Pin_t pin);
     int Disable_Free_Fall_Detection(void);
     int Set_Free_Fall_Threshold(uint8_t thr);
     int Enable_Pedometer(void);
@@ -150,19 +157,24 @@
     int Reset_Step_Counter(void);
     int Set_Pedometer_Threshold(uint8_t thr);
     int Enable_Tilt_Detection(void);
+    int Enable_Tilt_Detection(LSM6DSL_Interrupt_Pin_t pin);
     int Disable_Tilt_Detection(void);
     int Enable_Wake_Up_Detection(void);
+    int Enable_Wake_Up_Detection(LSM6DSL_Interrupt_Pin_t pin);
     int Disable_Wake_Up_Detection(void);
     int Set_Wake_Up_Threshold(uint8_t thr);
     int Enable_Single_Tap_Detection(void);
+    int Enable_Single_Tap_Detection(LSM6DSL_Interrupt_Pin_t pin);
     int Disable_Single_Tap_Detection(void);
     int Enable_Double_Tap_Detection(void);
+    int Enable_Double_Tap_Detection(LSM6DSL_Interrupt_Pin_t pin);
     int Disable_Double_Tap_Detection(void);
     int Set_Tap_Threshold(uint8_t thr);
     int Set_Tap_Shock_Time(uint8_t time);
     int Set_Tap_Quiet_Time(uint8_t time);
     int Set_Tap_Duration_Time(uint8_t time);
     int Enable_6D_Orientation(void);
+    int Enable_6D_Orientation(LSM6DSL_Interrupt_Pin_t pin);
     int Disable_6D_Orientation(void);
     int Get_6D_Orientation_XL(uint8_t *xl);
     int Get_6D_Orientation_XH(uint8_t *xh);