Functions

mTouchCVD.c File Reference

This module provides a group of functions performing the post acquisition filtering and decoding for all the sensors. More...

#include "includes/mTouchCVD.h"
Include dependency graph for mTouchCVD.c:

Go to the source code of this file.

Functions

void CVD_Filter_Init (void)
 Initializes the filtering variables.
void CVD_Decode (void)
 Updates the state of the sensor using the current CVDSensorData value.
void CVD_Filter_UpdateAverage (unsigned int reading, unsigned char index)
 Updates the average for the given sensor.
Required Initialization Call

This function must be called at power up in order to correctly configure the mTouch framework.

void mTouchCVD_Init (void)
 Initializes the mTouch CVD firmware.

Variables

Global Sensor Variables

These variables store information about the current state of the sensors. They should only ever be updated by the mTouch framework, but may be read globally so that special actions can be taken based on the sensors' status.

unsigned char ButtonState [CVD_NUMBER_SENSORS]
 Tracks the current state of each sensor.
unsigned int Average [CVD_NUMBER_SENSORS]
 Tracks environmental changes in the system.
Local Variables

These variables are used internally by the filtering and decoding framework modules. They should never be accessed outside of the mTouchCVD.c file.

unsigned int AverageCount [CVD_NUMBER_SENSORS]
 Counter variable for updating averages.
unsigned char PressTimer [CVD_NUMBER_SENSORS]
 Counter variable for button timeout implementation.
unsigned char DebounceCount [CVD_NUMBER_SENSORS]
 Counter variable for state transition debouncing.
unsigned int initCounter
 Counter variable for initialization.
Constant Threshold Arrays

These arrays are stored in program memory at compile time, so they do not require RAM. The downside to this implementation is that their values cannot be updated at runtime. If this is something your application requires, further editing will be needed.

const unsigned int pressThreshold [] = PRESS_THRESHOLD_INIT
 Constant array containing the press thresholds.
const unsigned int releaseThreshold [] = RELEASE_THRESHOLD_INIT
 Constant array containing the release thresholds.

Detailed Description

This module provides a group of functions performing the post acquisition filtering and decoding for all the sensors.

Definition in file mTouchCVD.c.


Function Documentation

void CVD_Filter_Init ( void   )

Initializes the filtering variables.

The CVD filtering module's initialization routine initializes the filtering variables.

Algorithm Implementation Notes

1. Loop through all sensors and initialize array variables




Definition at line 190 of file mTouchCVD.c.

Here is the caller graph for this function: