• Main Page
  • Modules
  • Files
  • File List
  • Globals

mTouchCVD.h

Go to the documentation of this file.
00001 /*************************************************************************
00002  *  © 2011 Microchip Technology Inc.                                       
00003  *  
00004  *  Project Name:    mTouch CVD Framework v1.1
00005  *  FileName:        mTouchCVD.h
00006  *  Dependencies:    mTouchCVD_Config.h
00007  *                   includes/mTouchCVD_HardwareProfile_*******.h
00008  *                      (Based on current PIC® configuration)
00009  *                   includes/mTouchCVD_macroLibrary_PIC****.h
00010  *                      (Based on current PIC® processor core)
00011  *                   See documentation for more information about which
00012  *                   files are required for compiling.
00013  *
00014  *  Processor:       See documentation for supported PIC® microcontrollers 
00015  *  Compiler:        HI-TECH Ver. 9.81 or later
00016  *  IDE:             MPLAB® IDE v8.50 (or later) or MPLAB® X                        
00017  *  Hardware:         
00018  *  Company:         
00019  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00020  *  Description:     mTouch CVD Framework Include File
00021  *                   - No application code should be implemented in this
00022  *                     or any other mTouch framework file. This will allow
00023  *                     for better customer support and easier upgrades to
00024  *                     later firmware versions. Use the main.c and user-
00025  *                     generated files to implement your application.
00026  *                   - See the documentation located in the docs/ folder
00027  *                     for a more information about how the framework is
00028  *                     implemented.
00029  *************************************************************************/
00030 /**************************************************************************
00031  * MICROCHIP SOFTWARE NOTICE AND DISCLAIMER: You may use this software, and 
00032  * any derivatives created by any person or entity by or on your behalf, 
00033  * exclusively with Microchip's products in accordance with applicable
00034  * software license terms and conditions, a copy of which is provided for
00035  * your referencein accompanying documentation. Microchip and its licensors 
00036  * retain all ownership and intellectual property rights in the 
00037  * accompanying software and in all derivatives hereto. 
00038  * 
00039  * This software and any accompanying information is for suggestion only. 
00040  * It does not modify Microchip's standard warranty for its products. You 
00041  * agree that you are solely responsible for testing the software and 
00042  * determining its suitability. Microchip has no obligation to modify, 
00043  * test, certify, or support the software. 
00044  * 
00045  * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 
00046  * EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED 
00047  * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 
00048  * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE, ITS INTERACTION WITH 
00049  * MICROCHIP'S PRODUCTS, COMBINATION WITH ANY OTHER PRODUCTS, OR USE IN ANY 
00050  * APPLICATION. 
00051  * 
00052  * IN NO EVENT, WILL MICROCHIP BE LIABLE, WHETHER IN CONTRACT, WARRANTY, 
00053  * TORT (INCLUDING NEGLIGENCE OR BREACH OF STATUTORY DUTY), STRICT 
00054  * LIABILITY, INDEMNITY, CONTRIBUTION, OR OTHERWISE, FOR ANY INDIRECT, 
00055  * SPECIAL, PUNITIVE, EXEMPLARY, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, 
00056  * FOR COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, 
00057  * HOWSOEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY 
00058  * OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWABLE BY LAW, 
00059  * MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS 
00060  * SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID 
00061  * DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 
00062  * 
00063  * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF 
00064  * THESE TERMS. 
00065  *************************************************************************/
00071 #ifndef __MTOUCHCVD_H
00072 #define __MTOUCHCVD_H
00073 
00075 // INCLUDES 
00077 #include <htc.h>
00078 #include "includes/mTouchCVD_Config.h"
00079  
00081 // GLOBAL VARIABLES
00083 extern       unsigned char  mTouchCVD_dataReady;                        
00084 extern       unsigned char  ButtonState         [CVD_NUMBER_SENSORS];   
00085 extern       unsigned int   Average             [CVD_NUMBER_SENSORS];   
00086 extern       unsigned int   CVDSensorData       [CVD_NUMBER_SENSORS];   
00087 extern       unsigned int   sensor_data         [CVD_NUMBER_SENSORS];   
00088 
00090 // ENUMERATIONS
00092 
00094 extern  enum    CVD_ButtonState 
00095                 {
00096                     CVD_INITIALIZING,   
00097                     CVD_RELEASED,       
00098                     CVD_PRESSED         
00099                 };    
00100 
00102 // GLOBAL PROTOTYPES
00104 void    CVD_Decode              (void);
00105 void    mTouchCVD_Init          (void);
00106 void    CVD_Filter_UpdateAverage(unsigned int, unsigned char);
00107 void    CVD_Filter_Init         (void);
00108 
00109 // Communication Functions
00110 #if defined(CVD_DEBUG) && (CVD_DEBUG == 1)
00111     void    mTouchCVD_Comm_Init     (void);
00112     void    send_Data               (void);
00113 #endif
00114 
00116 // MACROS
00118 
00119 #define     CVD_GetButtonState(i)           ButtonState[i]                          ///< Abstraction macro for the current button state
00120 #define     mTouchCVD_Service()             mTouchCVD_dataReady = 0; CVD_Decode()   ///< Abstraction macro for servicing new mTouch data
00121 #define     mTouchCVD_isDataReady()         mTouchCVD_dataReady                     ///< Abstraction macro for checking if new data is ready for processing
00122 #define     CVD_SetButtonState(state, i)    ButtonState[i] = state                  ///< Abstraction macro for changing button state
00123 #define     CVD_GetAverage(i)               Average[i]                              ///< Abstraction macro for array access
00124 #define     CVDGetSensor(i)                 CVDSensorData[i]                        ///< Abstraction macro for array access                     
00125 
00126 
00128 //                                                                  //
00129 //                   PREPROCESSOR FRAMEWORK CODE                    //
00130 //                                                                  //
00131 //  This code assigns the correct hardware include file for your    //
00132 //  processor, defines a few important macros for the system, and   //
00133 //  checks to make sure that the configuration file is set with     //
00134 //  all valid options.                                              //
00135 //                                                                  //
00136 //====================================================================
00138 
00139 // Include the hardware profile header file that corresponds to the currently selected PIC microcontroller.
00140 #if     defined(_16F1827) || defined(_16LF1827) || defined(_16F1826) || defined(_16LF1826) || defined(_16F1823) || defined(_16LF1823) || defined(_12F1822) || defined(_12LF1822) || defined(_16F1824) || defined(_16LF1824) || defined(_16F1825) || defined(_16LF1825) || defined(_16F1828) || defined(_16LF1828) || defined(_16F1829) || defined(_16LF1829)
00141     #include "includes/mTouchCVD_HardwareProfile_16F182x.h"
00142     #define _16F182x
00143 #elif   defined(_16F1933) || defined(_16LF1933) || defined(_16F1934) || defined(_16LF1934) || defined(_16F1936) || defined(_16LF1936) || defined(_16F1937) || defined(_16LF1937) || defined(_16F1938) || defined(_16LF1938) || defined(_16F1939) || defined(_16LF1939)
00144     #include "includes/mTouchCVD_HardwareProfile_16F193x.h"
00145     #define _16F193x
00146 #elif   defined(_16F1946) || defined(_16LF1946) || defined(_16F1947) || defined(_16LF1947) 
00147     #include "includes/mTouchCVD_HardwareProfile_16F194x.h"
00148     #define _16F194x
00149 #elif   defined(_16F1526) || defined(_16LF1526) || defined(_16F1527) || defined(_16LF1527) 
00150     #include "includes/mTouchCVD_HardwareProfile_16F152x.h"
00151     #define _16F152x
00152 #elif   defined(_16F1516) || defined(_16LF1516) || defined(_16F1517) || defined(_16LF1517) || defined(_16F1518) || defined(_16LF1518) || defined(_16F1519) || defined(_16LF1519)
00153     #include "includes/mTouchCVD_HardwareProfile_16F151x.h" 
00154     #define _16F151x
00155 #elif   defined(_12F615) || defined(_12HV615) || defined(_12F617)
00156     #include "includes/mTouchCVD_HardwareProfile_12F61x.h" 
00157     #define _12F61x
00158 #else
00159     #error The currently chosen processor is not yet supported by the mTouch CVD Framework.
00160 #endif 
00161 
00162 // Include the macro library header file that corresponds to the currently selected PIC microcontroller's core.
00163 #if defined(_PIC14E)
00164     // Enhanced Mid-range
00165     #include "includes/mTouchCVD_macroLibrary_PIC16F1.h"
00166 #elif defined(_PIC14)
00167     // Normal Mid-range
00168     #include "includes/mTouchCVD_macroLibrary_PIC16F.h"
00169 #else
00170     #error The currently chosen processor core does not have a matching macroLibrary file associated with it.
00171 #endif
00172 
00173 // Include the framework library's generic header file to perform checks and definitions common to all microcontrollers.
00174 #include "includes/mTouchCVD_processConfiguration.h"
00176 
00177 #endif
00178 
00179 

mTouch CVD Framework v1.1 documentation by  Click here to visit our website at www.microchip.com