void ResetLCD() { // DisplayEnable(); DisplayResetDisable(); DelayMs(100); DisplayResetEnable(); DelayMs(100); DisplayResetDisable(); DelayMs(100); }
/* ********************************************************************************************************* * ApplicationInitialize * * Description : This function is called by SYS_Initialize() function and run after power up. Global * interrupts are not enabled here (i.e. CP0 Status register). Interrupts will be enabled * by RTOS when the highest priority task is run for the first time. * Arguments : ********************************************************************************************************* */ void ApplicationInitialize ( void ) { portBASE_TYPE errStatus; /*initialize app_data object to initial values for this application*/ appData.deviceHandle = USB_DEVICE_HANDLE_INVALID; appData.isConfigured = false; /* Initialize the keycode array */ appData.key = USB_HID_KEYBOARD_KEYPAD_KEYBOARD_A; appData.keyCodeArray.keyCode[0] = USB_HID_KEYBOARD_KEYPAD_RESERVED_NO_EVENT_INDICATED; appData.keyCodeArray.keyCode[1] = USB_HID_KEYBOARD_KEYPAD_RESERVED_NO_EVENT_INDICATED; appData.keyCodeArray.keyCode[2] = USB_HID_KEYBOARD_KEYPAD_RESERVED_NO_EVENT_INDICATED; appData.keyCodeArray.keyCode[3] = USB_HID_KEYBOARD_KEYPAD_RESERVED_NO_EVENT_INDICATED; appData.keyCodeArray.keyCode[4] = USB_HID_KEYBOARD_KEYPAD_RESERVED_NO_EVENT_INDICATED; appData.keyCodeArray.keyCode[5] = USB_HID_KEYBOARD_KEYPAD_RESERVED_NO_EVENT_INDICATED; /* Initialize the modifier keys */ appData.keyboardModifierKeys.modifierkeys = 0; /* Initialise the led state */ appData.keyboardOutputReport.data = 0; /* Intialize the switch state */ appData.isSwitchPressed = false; appData.ignoreSwitchPress = false; /* Initialize the HID instance index. */ appData.hidInstance = 0; /* Initialize tracking variables */ appData.isReportReceived = false; appData.isReportSentComplete = true; /* Initialize the application state*/ appData.state = APP_STATE_INIT; /*write proper hardware pins to setup gfx*/ DisplayResetEnable(); DisplayResetConfig(); DisplayCmdDataConfig(); DisplayConfig(); DisplayBacklightOff(); DisplayBacklightConfig(); /*create applicaiton specific tasks*/ errStatus = xTaskCreate((pdTASK_CODE) ApplicationLEDblinkTask, (const signed char*)"LED Blink Task", APPLICATION_LEDBLINKTASK_STKSIZE, NULL, APPLICATION_LEDBLINKTASK_PRIO, NULL); errStatus = xTaskCreate((pdTASK_CODE) ApplicationUSBDeviceTask, (const signed char*)"USB Device Task", APPLICATION_USBDEVICETASK_STKSIZE, NULL, APPLICATION_USBDEVICETASK_PRIO, NULL); errStatus = xTaskCreate((pdTASK_CODE) ApplicationDisplayTask, (const signed char*)"Display Task", APPLICATION_DISPLAYTASK_STKSIZE, NULL, APPLICATION_DISPLAYTASK_PRIO, NULL); /*setup up interrupt controller to use multi-vectored mode, this is not the internal CP0 register, this sets the SFR register*/ PLIB_INT_MultiVectorSelect(INT_ID_0); /* Set priority for USB interrupt source */ PLIB_INT_VectorPrioritySet(INT_ID_0,INT_VECTOR_USB,INT_PRIORITY_LEVEL4); }