SLAA877 December   2018 MSP430FR2633

 

  1.   Capacitive Touch Gesture Software and Tuning
    1.     Trademarks
    2. 1 Introduction
    3. 2 Gestures
      1. 2.1 Theory of Operation
      2. 2.2 Sensor Gesture Processing
      3. 2.3 Gesture Software Overview
        1. 2.3.1 Slider Gesture
        2. 2.3.2 Wheel Gesture
        3. 2.3.3 Button Gesture
        4. 2.3.4 Sensor Handlers
        5. 2.3.5 How to Add Gestures to the CapTIvate Framework
    4. 3 Tuning
      1. 3.1 CapTIvate Design Center
        1. 3.1.1 Enabling Gesture Sensor Output
        2. 3.1.2 CDC Plot Channel Assignments
      2. 3.2 Tuning Process
        1. 3.2.1 Tap
        2. 3.2.2 Double Tap
        3. 3.2.3 Swipe
        4. 3.2.4 Slide
    5. 4 Example Demonstration Software Installation
      1. 4.1 Project Directories
      2. 4.2 Import the Project Into CCS

How to Add Gestures to the CapTIvate Framework

The TIDM-02004 example demo software is only one example of how gestures can be implemented. You are encouraged to modify these examples as needed for your application.

When considering incorporating gesture software into your project, remember that each function is written to support specific gestures on the button, slider, and wheel sensors. Some gestures may be common across all three sensors, while others are specific to the slider and wheel sensor. You need to modify the gesture software and sensor parameters to achieve the specific gesture behavior for your application.

For example, the sensor timing parameters are based on a default 20-ms sensor sample rate. A different sensor sampling rate requires modifying all of the sensors timing parameters from their default settings. For example, if the sampling rate increases from 20 ms to 10 ms, all timing parameters must double to maintain the same timing and responsiveness.

Likewise, should the slider or wheel resolution change from their defaults, the motion limits and step sizes need to be changed accordingly. The slider motion parameters are based on 1000-pt resolution and wheel motion parameters are based on 100-pt resolution.

During the capacitive touch sensor design process, the CapTIvate Design Center (CDC) is used to create the initial sensor configuration and baseline source code project. Incorporating the gesture algorithm into the generated source code project is simple, requiring only a callback function (a sensor handler) and a call to register the sensor handler in the MCU startup code.

The callback or sensor handler is called after a sensor has been measured and the fundamental touch processing has been completed. This is typically where any additional processing, such as communication, toggling an LED, turning on or off a motor control or, in this example, the sensor's gesture algorithms are performed. This does not happen automatically. The application must first register a callback for each sensor. The following example shows the wheel sensor callback registration from the example code. This occurs in the Demo_Init() function in the file media_player.c.

MAP_CAPT_registerCallback(&wheelSensor, &wheelSensorHandler);

For more information about the callbacks, refer to the Software Library chapter of the CapTIvate Technology Guide.

In summary, all that is needed to incorporate gesturing into a CapTIvate project is create a sensor specific gesture algorithm as the sensor's handler and register it as the sensor's callback function.