SLAA877 December 2018 MSP430FR2633
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.