Functions

Filtering and Decoding

Functions

void mTouch_Decode (void)
 Updates the state of each active-mode sensor using the latest acquisition value.
void mTouch_UpdateBaseline (void)
 Updates the baseline for the given sensor with the given value.

Detailed Description

The mTouch Filtering and Decoding module executes the detection algorithms for the framework. Using the latched output from the acquisition module, the service function is called each time a new value is available for each sensor. It will then loop through all of the active sensors and determine if they have changed state.

This is achieved by implementing a baseline average of the sensor's reading. The baseline is only updated while the sensor is in the MTOUCH_RELEASED state. The difference between the baseline and the current reading is compared against the THRESHOLD_PRESS_SENSOR0 (or equivalent) value to determine if a change in state is necessary.

If the system sees that the reading has dipped below the baseline - the opposite direction of a finger press - the baseline will update itself based on the behavior chosen by configuration option MTOUCH_NEGATIVE_CAPACITANCE.


Function Documentation

void mTouch_Decode ( void   )

Updates the state of each active-mode sensor using the latest acquisition value.

This is the mTouch service routine that performs sensor state transitions based on the value of the latest acquisition value as compared to its previous behavior.

3. Now that all sensors have had their initial decoding step completed, if sliders are implemented in this application, perform decoding on them now.

6. Finally, if all active sensors are initialized and the system is not about to change modes, send communications data.

7. Enable active-mode mTouch scanning now that we're finished.

Definition at line 391 of file mTouch.c.

Here is the call graph for this function:

void mTouch_UpdateBaseline ( void   )

Updates the baseline for the given sensor with the given value.

Updates a sensor's baseline (or baseline) in order to track the environmental changes of the system.

Algorithm Implementation Notes

This function has several possible implementations based on the current configuration options of the framework. The important configuration options are:

The average updates the counter variable and compares it with MTOUCH_BASELINE_RATE to see if it should continue or return. If the counter allows it to continue, the average is then updated using one of four possible implementations which is determined by the MTOUCH_BASELINE_WEIGHT option.




Definition at line 1021 of file mTouch.c.

Here is the caller graph for this function: