This is a demonstration of using the tft display of the Cypress PSoC 6 WiFi-BT Pioneer kit. The demo displays the status of the capsense buttons, slider and user button on the tft display. Makes use of emwin, capsense and PinDetect libraries.
GUI_X_Mbed.cpp
00001 /********************************************************************* 00002 * SEGGER Microcontroller GmbH * 00003 * Solutions for real time microcontroller applications * 00004 ********************************************************************** 00005 * * 00006 * (c) 1996 - 2018 SEGGER Microcontroller GmbH * 00007 * * 00008 * Internet: www.segger.com Support: support@segger.com * 00009 * * 00010 ********************************************************************** 00011 00012 ** emWin V5.48 - Graphical user interface for embedded applications ** 00013 All Intellectual Property rights in the Software belongs to SEGGER. 00014 emWin is protected by international copyright laws. Knowledge of the 00015 source code may not be used to write a similar product. This file may 00016 only be used in accordance with the following terms: 00017 00018 The software has been licensed to Cypress Semiconductor Corporation, 00019 whose registered office is situated at 198 Champion Ct. San Jose, CA 00020 95134 USA solely for the purposes of creating libraries for Cypress 00021 PSoC3 and PSoC5 processor-based devices, sublicensed and distributed 00022 under the terms and conditions of the Cypress End User License 00023 Agreement. 00024 Full source code is available at: www.segger.com 00025 00026 We appreciate your understanding and fairness. 00027 ---------------------------------------------------------------------- 00028 Licensing information 00029 Licensor: SEGGER Microcontroller Systems LLC 00030 Licensed to: Cypress Semiconductor Corp, 198 Champion Ct., San Jose, CA 95134, USA 00031 Licensed SEGGER software: emWin 00032 License number: GUI-00319 00033 License model: Services and License Agreement, signed June 10th, 2009 00034 Licensed platform: Any Cypress platform (Initial targets are: PSoC3, PSoC5) 00035 ---------------------------------------------------------------------- 00036 Support and Update Agreement (SUA) 00037 SUA period: 2009-06-12 - 2022-07-27 00038 Contact to extend SUA: sales@segger.com 00039 ---------------------------------------------------------------------- 00040 File : GUI_X_Mbed.c 00041 Purpose : Config / System dependent externals for GUI 00042 ---------------------------END-OF-HEADER------------------------------ 00043 */ 00044 00045 #include <stdio.h> 00046 #include "mbed.h" 00047 00048 extern "C" { 00049 #include "GUI.h" 00050 } 00051 00052 /********************************************************************* 00053 * 00054 * Global data 00055 */ 00056 00057 Ticker emwin_ticker; 00058 Mutex emwin_mutex; 00059 volatile GUI_TIMER_TIME timeMS = 0; 00060 00061 /********************************************************************* 00062 * 00063 * Public code 00064 * 00065 ********************************************************************** 00066 */ 00067 /********************************************************************* 00068 * 00069 * Timing: 00070 * GUI_X_GetTime() 00071 * GUI_X_Delay(int) 00072 00073 Some timing dependent routines require a GetTime 00074 and delay function. Default time unit (tick), normally is 00075 1 ms. 00076 */ 00077 00078 GUI_TIMER_TIME GUI_X_GetTime(void) 00079 { 00080 return timeMS; 00081 } 00082 00083 void GUI_X_Delay(int ms) 00084 { 00085 wait_ms(ms); 00086 } 00087 00088 /********************************************************************* 00089 * 00090 * GUI_X_ExecIdle() 00091 * 00092 */ 00093 void GUI_X_ExecIdle(void) 00094 { 00095 wait_ms(1); 00096 } 00097 00098 /********************************************************************* 00099 * 00100 * Multitasking: 00101 * 00102 * GUI_X_InitOS() 00103 * GUI_X_GetTaskId() 00104 * GUI_X_Lock() 00105 * GUI_X_Unlock() 00106 * 00107 * Note: 00108 * The following routines are required only if emWin is used in a 00109 * true multi task environment, which means you have more than one 00110 * thread using the emWin API. 00111 * In this case the 00112 * #define GUI_OS 1 00113 * needs to be in GUIConf.h 00114 */ 00115 void GUI_X_InitOS(void) {} 00116 void GUI_X_Unlock(void) { emwin_mutex.unlock(); } 00117 void GUI_X_Lock(void) { emwin_mutex.lock(); } 00118 U32 GUI_X_GetTaskId(void) { return 0; } 00119 00120 /********************************************************************* 00121 * 00122 * Logging: OS dependent 00123 00124 Note: 00125 Logging is used in higher debug levels only. The typical target 00126 build does not use logging and does therefor not require any of 00127 the logging routines below. For a release build without logging 00128 the routines below may be eliminated to save some space. 00129 (If the linker is not function aware and eliminates unreferenced 00130 functions automatically) 00131 00132 */ 00133 00134 void GUI_X_Log (const char *s) { GUI_USE_PARA(s); } 00135 void GUI_X_Warn (const char *s) { GUI_USE_PARA(s); } 00136 void GUI_X_ErrorOut(const char *s) { GUI_USE_PARA(s); } 00137 00138 void ticker_handler(void) 00139 { 00140 timeMS++; 00141 } 00142 00143 /********************************************************************* 00144 * 00145 * GUI_X_Init() 00146 * 00147 * Note: 00148 * This routine is called from GUI_Init() in any case whether there 00149 * is an RTOS or not. You can use it for additional initializations 00150 * needed. 00151 */ 00152 00153 void GUI_X_Init(void) 00154 { 00155 emwin_ticker.attach(&ticker_handler, 0.001); 00156 } 00157 00158 /*************************** End of file ****************************/
Generated on Thu Jul 28 2022 12:57:44 by 1.7.2