prova
Dependencies: X_NUCLEO_53L0A1 mbed
Fork of 53L0A1_HandGestureRecognition by
Middlewares/ST/Gestures/GesturesDetect/Inc/tof_gestures.h@9:6205ef056c8a, 2018-02-22 (annotated)
- Committer:
- mapellil
- Date:
- Thu Feb 22 15:50:29 2018 +0000
- Revision:
- 9:6205ef056c8a
- Parent:
- 7:d79cbeda2982
AStDay
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mapellil | 7:d79cbeda2982 | 1 | /******************************************************************************* |
mapellil | 7:d79cbeda2982 | 2 | Copyright © 2015, STMicroelectronics International N.V. |
mapellil | 7:d79cbeda2982 | 3 | All rights reserved. |
mapellil | 7:d79cbeda2982 | 4 | |
mapellil | 7:d79cbeda2982 | 5 | Use and Redistribution are permitted only in accordance with licensing terms |
mapellil | 7:d79cbeda2982 | 6 | available at www.st.com under software reference X-CUBE-6180XA1, and provided |
mapellil | 7:d79cbeda2982 | 7 | that the following conditions are met: |
mapellil | 7:d79cbeda2982 | 8 | * Redistributions of source code must retain the above copyright |
mapellil | 7:d79cbeda2982 | 9 | notice, this list of conditions and the following disclaimer. |
mapellil | 7:d79cbeda2982 | 10 | * Redistributions in binary form must reproduce the above copyright |
mapellil | 7:d79cbeda2982 | 11 | notice, this list of conditions and the following disclaimer in the |
mapellil | 7:d79cbeda2982 | 12 | documentation and/or other materials provided with the distribution. |
mapellil | 7:d79cbeda2982 | 13 | * Neither the name of STMicroelectronics nor the |
mapellil | 7:d79cbeda2982 | 14 | names of its contributors may be used to endorse or promote products |
mapellil | 7:d79cbeda2982 | 15 | derived from this software without specific prior written permission. |
mapellil | 7:d79cbeda2982 | 16 | |
mapellil | 7:d79cbeda2982 | 17 | THIS SOFTWARE IS PROTECTED BY STMICROELECTRONICS PATENTS AND COPYRIGHTS. |
mapellil | 7:d79cbeda2982 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
mapellil | 7:d79cbeda2982 | 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
mapellil | 7:d79cbeda2982 | 20 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND |
mapellil | 7:d79cbeda2982 | 21 | NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED. |
mapellil | 7:d79cbeda2982 | 22 | IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY |
mapellil | 7:d79cbeda2982 | 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
mapellil | 7:d79cbeda2982 | 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
mapellil | 7:d79cbeda2982 | 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
mapellil | 7:d79cbeda2982 | 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
mapellil | 7:d79cbeda2982 | 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
mapellil | 7:d79cbeda2982 | 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mapellil | 7:d79cbeda2982 | 29 | ********************************************************************************/ |
mapellil | 7:d79cbeda2982 | 30 | |
mapellil | 7:d79cbeda2982 | 31 | /* |
mapellil | 7:d79cbeda2982 | 32 | * @file tof_gestures.h |
mapellil | 7:d79cbeda2982 | 33 | * $Date: 2015-11-10 11:21:53 +0100 (Tue, 10 Nov 2015) $ |
mapellil | 7:d79cbeda2982 | 34 | * $Revision: 2612 $ |
mapellil | 7:d79cbeda2982 | 35 | */ |
mapellil | 7:d79cbeda2982 | 36 | |
mapellil | 7:d79cbeda2982 | 37 | #ifndef TOF_GESTURES_H_ |
mapellil | 7:d79cbeda2982 | 38 | #define TOF_GESTURES_H_ |
mapellil | 7:d79cbeda2982 | 39 | |
mapellil | 7:d79cbeda2982 | 40 | #include <stdlib.h> |
mapellil | 7:d79cbeda2982 | 41 | #include "tof_gestures_platform.h" |
mapellil | 7:d79cbeda2982 | 42 | |
mapellil | 7:d79cbeda2982 | 43 | #ifdef __cplusplus |
mapellil | 7:d79cbeda2982 | 44 | extern "C" { |
mapellil | 7:d79cbeda2982 | 45 | #endif |
mapellil | 7:d79cbeda2982 | 46 | |
mapellil | 7:d79cbeda2982 | 47 | /** @defgroup tof_gestures |
mapellil | 7:d79cbeda2982 | 48 | * @brief ToF Gesture functions detecting gestures |
mapellil | 7:d79cbeda2982 | 49 | */ |
mapellil | 7:d79cbeda2982 | 50 | |
mapellil | 7:d79cbeda2982 | 51 | /** @defgroup tof |
mapellil | 7:d79cbeda2982 | 52 | * @brief ToF functions (performing operations on typical ToF data such as range, signalRate |
mapellil | 7:d79cbeda2982 | 53 | */ |
mapellil | 7:d79cbeda2982 | 54 | |
mapellil | 7:d79cbeda2982 | 55 | /** @defgroup misc |
mapellil | 7:d79cbeda2982 | 56 | * @brief Misc functions |
mapellil | 7:d79cbeda2982 | 57 | */ |
mapellil | 7:d79cbeda2982 | 58 | |
mapellil | 7:d79cbeda2982 | 59 | |
mapellil | 7:d79cbeda2982 | 60 | /** Gesture codes |
mapellil | 7:d79cbeda2982 | 61 | */ |
mapellil | 7:d79cbeda2982 | 62 | enum Gestures_Code_t{ |
mapellil | 7:d79cbeda2982 | 63 | GESTURES_NULL = 0, /*!< No gesture detected */ |
mapellil | 7:d79cbeda2982 | 64 | GESTURES_SINGLE_TAP = 1, /*!< Single tap detected : __TAP__*/ |
mapellil | 7:d79cbeda2982 | 65 | GESTURES_SINGLE_SWIPE = 2, /*!< Single swipe detected : __SWIPE__*/ |
mapellil | 7:d79cbeda2982 | 66 | GESTURES_DOUBLE_TAP = 3, /*!< Double tap detected : __TAPS__*/ |
mapellil | 7:d79cbeda2982 | 67 | GESTURES_DOUBLE_SWIPE = 4, /*!< Double swipe detected : __SWIPES__*/ |
mapellil | 7:d79cbeda2982 | 68 | GESTURES_HAND_ENTERING = 5, /*!< Hand is entering in device field of view */ |
mapellil | 7:d79cbeda2982 | 69 | GESTURES_HAND_LEAVING = 6, /*!< Hand is leaving from device field of view */ |
mapellil | 7:d79cbeda2982 | 70 | GESTURES_LEVEL_CONTROLLED = 7, /*!< Hand is controlling a level from the measured distance : __LC__ */ |
mapellil | 7:d79cbeda2982 | 71 | GESTURES_SWIPE_LEFT_RIGHT = 8, /*!< Directional swipe from left to right : __DIRSWIPE__ */ |
mapellil | 7:d79cbeda2982 | 72 | GESTURES_SWIPE_RIGHT_LEFT = 9, /*!< Directional swipe from right to left : __DIRSWIPE__ */ |
mapellil | 7:d79cbeda2982 | 73 | |
mapellil | 7:d79cbeda2982 | 74 | GESTURES_SINGLE_TAP_LEFT = 10, /*!< Single tap detected on left device : __TAP__*/ |
mapellil | 7:d79cbeda2982 | 75 | GESTURES_SINGLE_TAP_RIGHT = 11, /*!< Single tap detected on right device : __TAP__*/ |
mapellil | 7:d79cbeda2982 | 76 | GESTURES_SINGLE_SWIPE_LEFT = 12, /*!< Single swipe detected on left device : __SWIPE__*/ |
mapellil | 7:d79cbeda2982 | 77 | GESTURES_SINGLE_SWIPE_RIGHT = 13, /*!< Single swipe detected on right device : __SWIPE__*/ |
mapellil | 7:d79cbeda2982 | 78 | GESTURES_DOUBLE_TAP_LEFT = 14, /*!< Double tap detected on left device : __TAPS__*/ |
mapellil | 7:d79cbeda2982 | 79 | GESTURES_DOUBLE_TAP_RIGHT = 15, /*!< Double tap detected on right device : __TAPS__*/ |
mapellil | 7:d79cbeda2982 | 80 | GESTURES_DOUBLE_SWIPE_LEFT = 16, /*!< Double swipe detected on left device : __SWIPES__*/ |
mapellil | 7:d79cbeda2982 | 81 | GESTURES_DOUBLE_SWIPE_RIGHT = 17, /*!< Double swipe detected on right device : __SWIPES__*/ |
mapellil | 7:d79cbeda2982 | 82 | GESTURES_HAND_ENTERING_LEFT = 18, /*!< Hand is entering in left device field of view */ |
mapellil | 7:d79cbeda2982 | 83 | GESTURES_HAND_ENTERING_RIGHT = 19, /*!< Hand is entering in right device field of view */ |
mapellil | 7:d79cbeda2982 | 84 | GESTURES_HAND_LEAVING_LEFT = 20, /*!< Hand is leaving from left device field of view */ |
mapellil | 7:d79cbeda2982 | 85 | GESTURES_HAND_LEAVING_RIGHT = 21, /*!< Hand is leaving from right device field of view */ |
mapellil | 7:d79cbeda2982 | 86 | GESTURES_LEVEL_CONTROLLED_LEFT = 22, /*!< Hand is controlling a level from the left device : __LC__ */ |
mapellil | 7:d79cbeda2982 | 87 | GESTURES_LEVEL_CONTROLLED_RIGHT = 23, /*!< Hand is controlling a level from the right device : __LC__ */ |
mapellil | 7:d79cbeda2982 | 88 | |
mapellil | 7:d79cbeda2982 | 89 | GESTURES_STARTED = -1, /*!< A gesture start is detected but full gesture detection is not completed (yet) */ |
mapellil | 7:d79cbeda2982 | 90 | GESTURES_DISCARDED = -2, /*!< Gesture is discarded */ |
mapellil | 7:d79cbeda2982 | 91 | GESTURES_DISCARDED_TOO_SLOW = -3, /*!< Gesture is discarded because it is too slow */ |
mapellil | 7:d79cbeda2982 | 92 | GESTURES_DISCARDED_TOO_FAST = -4, /*!< Gesture is discarded because it is too fast */ |
mapellil | 7:d79cbeda2982 | 93 | }; |
mapellil | 7:d79cbeda2982 | 94 | |
mapellil | 7:d79cbeda2982 | 95 | /** ToF Devices |
mapellil | 7:d79cbeda2982 | 96 | */ |
mapellil | 7:d79cbeda2982 | 97 | typedef enum { |
mapellil | 7:d79cbeda2982 | 98 | TOF_DEVICE_VL6180X = 0, /*!< VL6180X Device */ |
mapellil | 7:d79cbeda2982 | 99 | TOF_DEVICE_VL53L0X = 1, /*!< VL53L0X device */ |
mapellil | 7:d79cbeda2982 | 100 | }Tof_Device_t; |
mapellil | 7:d79cbeda2982 | 101 | |
mapellil | 7:d79cbeda2982 | 102 | #ifndef MIN |
mapellil | 7:d79cbeda2982 | 103 | # define MIN(a,b) (((a)<(b))?(a):(b)) |
mapellil | 7:d79cbeda2982 | 104 | #endif |
mapellil | 7:d79cbeda2982 | 105 | #ifndef MAX |
mapellil | 7:d79cbeda2982 | 106 | # define MAX(a,b) (((a)>(b))?(a):(b)) |
mapellil | 7:d79cbeda2982 | 107 | #endif |
mapellil | 7:d79cbeda2982 | 108 | #ifdef __cplusplus |
mapellil | 7:d79cbeda2982 | 109 | } |
mapellil | 7:d79cbeda2982 | 110 | #endif |
mapellil | 7:d79cbeda2982 | 111 | #endif /* TOF_GESTURES_H_ */ |
mapellil | 7:d79cbeda2982 | 112 |