Required include! The main framework header file used by all framework files. More...
#include <p18cxxx.h>
#include "mTouch_config.h"
#include "mTouch_processConfiguration.h"
#include "mTouch_modes.h"
#include "mComm.h"
Go to the source code of this file.
Data Structures | |
struct | mTouch_SensorVariables |
Contains all variables used in active mode which can/will be reinitialized after each mode switch. More... | |
union | mTouch_StateVariables |
Contains sensor and state variables. More... | |
union | mTouch_AcquisitionData |
Structure used to implement both a 12-bit and a 20-bit variable inside a single 32-bit array. More... | |
struct | mTouch_State |
Collection of single-bit flags used by the mTouch Framework. More... | |
Defines | |
#define | MTOUCH_CURRENTSCAN_VALUE mTouch_currentScan |
#define | mTouch_GetButtonState(i) |
Get the current state of the given active-mode sensor. | |
#define | mTouch_GetAverage(i) |
Get the current average value of the given active-mode sensor. | |
#define | mTouch_GetSensor(i) |
Get the current reading value of the given active-mode sensor. | |
#define | mTouch_EnableScanning() |
Enables mTouch scanning. | |
#define | mTouch_DisableScanning() |
Disables mTouch scanning. | |
#define | mTouch_Service() |
Performs mTouch decoding, communications output, and mode switching. | |
#define | mTouch_isDataReady() |
Sometimes function call, sometimes bit-check. Required mTouch API call. | |
#define | mTouch_checkInterrupt() |
Implements the ISR flag checks to see if the mTouch timer caused the interrupt. | |
Enumerations | |
enum | mTouch_enum_ButtonState { MTOUCH_INITIALIZING, MTOUCH_RELEASED, MTOUCH_PRESSED } |
Functions | |
void | mTouch_Init (void) |
Main initialization routine for all mTouch framework modules including the built-in communication module, if enabled. | |
void | mTouch_Decode (void) |
Updates the state of each active-mode sensor using the latest acquisition value. | |
void | mTouch_ChangeMode (void) |
void | mTouch_Scan (void) |
Implements the framework's active-mode acquisition routine. Sometimes implemented as an ISR, sometimes as a normal function. | |
Variables | |
mTouch_State | mTouch_state |
Tracks the state of the mTouch algorithm. | |
mTouch_StateVariables | mTouch_stateVars |
Stores all state-temporary variables to be reinitialized each mode change. | |
uint16_t | mTouch_sensorData [MTOUCH_NUMBER_SENSORS] |
Latch register storing the latest mTouch acquisition results. | |
mTouch_AcquisitionData | mTouch_acqData [MTOUCH_NUMBER_SENSORS] |
Internal mTouch acquisition variable structure. | |
uint16_t | mTouch_average [MTOUCH_NUMBER_SENSORS] |
Array to track the unpressed value of each sensor. | |
const uint16_t | mTouch_pressThreshold [MTOUCH_NUMBER_SENSORS] |
Constant array containing the press threshold for each sensor. | |
const uint16_t | mTouch_releaseThreshold [MTOUCH_NUMBER_SENSORS] |
Constant array containing the release threshold for each sensor. | |
uint8_t | mTouch_currentScan |
Required include! The main framework header file used by all framework files.
Definition in file mTouch.h.
#define mTouch_checkInterrupt | ( | ) |
#define MTOUCH_CURRENTSCAN_VALUE mTouch_currentScan |
#define mTouch_DisableScanning | ( | ) |
#define mTouch_GetAverage | ( | i ) |
#define mTouch_GetButtonState | ( | i ) |
Get the current state of the given active-mode sensor.
i | index of the sensor Example usage:
if (mTouch_GetButtonState(0) < MTOUCH_PRESSED) { LED0 = LED_OFF; } else { LED0 = LED_ON; } |
#define mTouch_GetSensor | ( | i ) |
#define mTouch_isDataReady | ( | ) |
Sometimes function call, sometimes bit-check. Required mTouch API call.
The mTouch_isDataReady() macro will return '1' when:
This macro call is sometimes implemented as a bit-check on a variable. If mTouch is not being called from the ISR, this macro is implemented as a function call to the scan routine.
#define mTouch_Service | ( | ) |
void mTouch_ChangeMode | ( | void | ) |
void mTouch_Init | ( | void | ) |
Main initialization routine for all mTouch framework modules including the built-in communication module, if enabled.
1. Loop through all enabled, active sensors and initialize their variables.
2. Loop through all enabled sliders and initialize the slider's output value.
3. Initialize mode variables and flags
4. Initialize non-array system variables
5. Initialize the DACOUT pin when it is used as a guard ring.
6. Initialize the ADC module for mTouch operation.
7. Initialization complete - enable active-mode mTouch scanning.
Definition at line 258 of file mTouch.c.
mTouch_AcquisitionData mTouch_acqData[MTOUCH_NUMBER_SENSORS] |
Internal mTouch acquisition variable structure.
Definition at line 72 of file mTouch_acquistion.c.
uint16_t mTouch_average[MTOUCH_NUMBER_SENSORS] |
uint8_t mTouch_currentScan |
Definition at line 83 of file mTouch_acquistion.c.
const uint16_t mTouch_pressThreshold[MTOUCH_NUMBER_SENSORS] |
const uint16_t mTouch_releaseThreshold[MTOUCH_NUMBER_SENSORS] |
uint16_t mTouch_sensorData[MTOUCH_NUMBER_SENSORS] |
Latch register storing the latest mTouch acquisition results.
Definition at line 74 of file mTouch_acquistion.c.