summaryrefslogtreecommitdiffstats
path: root/libsensors/software/simple_apps/common/gestureMenu.h
blob: 8f804e15e003553a0e5f383633e7785e785ef902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
 $License:
    Copyright (C) 2011 InvenSense Corporation, All Rights Reserved.
 $
 */
/***************************************************************************** *
 * $Id: gestureMenu.h 5705 2011-06-28 19:32:29Z nroyer $ 
 ******************************************************************************/
/**
 * @defgroup 
 * @brief  
 *
 * @{
 *      @file     gestureMenu.h
 *      @brief    
 *
 *
 */

#ifndef __GESTUREMENU_H__
#define __GESTUREMENU_H__

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************/
    typedef struct sGestureMenuParams {
        /* Tap Params */
        int xTapThreshold;
        int yTapThreshold;
        int zTapThreshold;
        int tapTime;
        int nextTapTime;
        int maxTaps;
        float shakeRejectValue;

        /* Shake Params */
        int xShakeThresh;
        int yShakeThresh;
        int zShakeThresh;
        int xSnapThresh;
        int ySnapThresh;
        int zSnapThresh;
        int shakeTime;
        int nextShakeTime;
        int shakeFunction;
        int maxShakes;

        /* Yaw rotate params */
        int yawRotateTime;
        int yawRotateThreshold;

        /* Orientation */
        float orientationThreshold;
        int sensorsIndex;
        unsigned long available_sensors;
    } tGestureMenuParams;

    void     PrintGestureMenu(tGestureMenuParams const * const params) ;
    inv_error_t GestureMenuProcessChar(tGestureMenuParams * const params,char ch);
    void     PrintGesture(gesture_t* gesture);
    void     PrintOrientation(unsigned short orientation);
    void     GestureMenuSetDefaults(tGestureMenuParams * const params);
    void GestureMenuSetAvailableSensors(tGestureMenuParams * const params,
                                        unsigned long available_sensors);
    inv_error_t GestureMenuSetMpl(tGestureMenuParams const * const params);

/******************************************************************************/

#ifdef __cplusplus
}
#endif

#endif // __GESTUREMENU_H__