EDF - OnePIC MCU  v1.1.0
source/32bit/OnePIC_32bit_mtouch.c
Go to the documentation of this file.
00001 
00009 #include "OnePIC_mtouch.h"
00010 #include "Compiler.h"
00011 #include "mTouchCapAPI.h"
00012 #include "OnePIC_lcd.h"
00013 #include "mTouchCapLED.h"
00014 #include "OnePIC_timer.h"
00015 #include "OnePIC_int.h"
00016 #include "mTouchCapApp_DirectKeys.h"
00017 
00018 
00022 void EDF_mTouchInit(void)
00023 {
00024 
00025     DDPCONbits.JTAGEN = 0; // Disable JTAG
00026 
00027     // Initalize global interrupt enable
00028     INTEnableSystemMultiVectoredInt();
00029 
00030     // Configure the device for maximum performance
00031     // Given the options, this function will change the flash wait states, RAM
00032     // wait state and enable prefetch cache but will not change the PBDIV.
00033     // The PBDIV value is already set via the pragma FPBDIV option.
00034     SYSTEMConfig(SYS_FREQ, SYS_CFG_WAIT_STATES | SYS_CFG_PCACHE);
00035 
00036     // Setup data structures for using Direct Keys
00037     mTouchCapApp_DirectKeys_Create();
00038 
00039     mTouchCapAPI_Init();
00040 
00041     // Start button measurements
00042     Set_ScanTimer_IE_Bit_State(ENABLE);  //Enable interrupt
00043     Set_ScanTimer_ON_Bit_State(ENABLE);  //Run timer
00044 }