Defines | Enumerations | Functions | Variables

mTouchCVD.h File Reference

Main framework header file used by all mTouchCVD files. More...

#include <htc.h>
#include "includes/mTouchCVD_Config.h"
#include "includes/mTouchCVD_processConfiguration.h"
Include dependency graph for mTouchCVD.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define CVD_SetButtonState(state, i)   ButtonState[i] = state
 Abstraction macro for changing button state.
#define CVD_GetAverage(i)   Average[i]
 Abstraction macro for array access.
#define CVDGetSensor(i)   CVDSensorData[i]
 Abstraction macro for array access.
Determining Sensor Status

These hooks are used to determine the current state of the framework's sensors. For more information, see the individual function/variable description.

Example code is provided in the detailed description for CVD_GetButtonState().

#define CVD_GetButtonState(i)
 Returns the state of the requested sensor.
Required Main Loop Service Call

These two hooks are required so that the framework can update the sensor's status.

Example code is provided in the detailed descriptions for both hooks.

#define mTouchCVD_Service()
 Services a new set of results from the acquisition module.
#define mTouchCVD_isDataReady()
 Returns a non-zero value when a new set of readings is ready for processing.

Enumerations

enum  CVD_ButtonState { CVD_INITIALIZING, CVD_RELEASED, CVD_PRESSED }
 

GLOBAL: ButtonState valid values.

More...

Functions

void CVD_Decode (void)
 Updates the state of the sensor using the current CVDSensorData value.
void mTouchCVD_Init (void)
 Initializes the mTouch CVD firmware.
void CVD_Filter_UpdateAverage (unsigned int, unsigned char)
 Updates the average for the given sensor.
void CVD_Filter_Init (void)
 Initializes the filtering variables.

Variables

unsigned char mTouchCVD_dataReady
 GLOBAL: Flag to determine if new data is ready for processing.
unsigned char ButtonState [CVD_NUMBER_SENSORS]
 GLOBAL: Tracks the current state of the sensor.
unsigned int Average [CVD_NUMBER_SENSORS]
 GLOBAL: Tracks environmental changes in the system.
unsigned int CVDSensorData [CVD_NUMBER_SENSORS]
 GLOBAL: Latch register storing the latest acquisition data.
unsigned int sensor_data [CVD_NUMBER_SENSORS]
 GLOBAL: Internal mTouch acquisition variable - do not modify.

Detailed Description

Main framework header file used by all mTouchCVD files.

Also, performs setup and error checking operations at compile time.

Definition in file mTouchCVD.h.


Define Documentation

#define CVD_GetAverage (   i )    Average[i]

Abstraction macro for array access.

Definition at line 123 of file mTouchCVD.h.

#define CVD_SetButtonState (   state,
 
)    ButtonState[i] = state

Abstraction macro for changing button state.

Definition at line 122 of file mTouchCVD.h.

#define CVDGetSensor (   i )    CVDSensorData[i]

Abstraction macro for array access.

Definition at line 124 of file mTouchCVD.h.


Enumeration Type Documentation

GLOBAL: ButtonState valid values.

Enumerator:
CVD_INITIALIZING 

Sensor is still initializing.

CVD_RELEASED 

Sensor is currently released.

CVD_PRESSED 

Sensor is currently pressed.

Definition at line 94 of file mTouchCVD.h.


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:


Variable Documentation

GLOBAL: Flag to determine if new data is ready for processing.

Flag to register new sensor values.

Example usage:

 while(1)
 {
   if (mTouchCVD_isDataReady())   // Is new information ready?
   {
      mTouchCVD_Service();        // Decode the newly captured data and transmit new data updates.
   }
 }

Definition at line 80 of file mTouchCVD_Acquistion.c.