久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 5565|回復: 2
打印 上一主題 下一主題
收起左側

SimpleGUI一套針對單色顯示屏的開源GUI接口源程序+說明文檔

[復制鏈接]
跳轉到指定樓層
樓主



有詳細說明文檔。詳見附件。



單片機源程序如下:
  1. /*************************************************************************/
  2. /** Copyright.                                                                                                                        **/
  3. /** FileName: DemoProc.c                                                                                                **/
  4. /** Author: Polarix                                                                                                                **/
  5. /** Description: User operation interface.                                                                **/
  6. /*************************************************************************/
  7. //=======================================================================//
  8. //= Include files.                                                                                                            =//
  9. //=======================================================================//
  10. #include "DemoProc.h"

  11. #ifdef _SIMPLE_GUI_VIRTUAL_ENVIRONMENT_SIMULATOR_
  12. #include "SDKInterface.h"
  13. #include "SGUI_FlashData.h"
  14. #else
  15. #include "OLED.h"
  16. #include "DemoActions.h"
  17. #endif

  18. //=======================================================================//
  19. //= Static variable declaration.                                                                            =//
  20. //=======================================================================//
  21. SGUI_SCR_DEV                                g_stDeviceInterface;
  22. HMI_SCREEN_OBJECT*                        g_arrpstScreenObjs[] =
  23.                                                         {
  24.                                                                 &g_stHMIDemo_ScrollingText,
  25.                                                                 &g_stHMIDemo_List,
  26.                                                                 &g_stHMIDemo_TextNotice,
  27.                                                                 &g_stHMIDemo_RTCNotice,
  28.                                                                 &g_stHMIDemo_VariableBox,
  29.                                                                 &g_stHMI_DemoRealtimeGraph,
  30.                                                         };
  31. HMI_ENGINE_OBJECT                        g_stDemoEngine;

  32. //=======================================================================//
  33. //= Static function declare.                                                                            =//
  34. //=======================================================================//
  35. static void                                        KeyPressEventProc(void);
  36. static void                                        RTCEventProc(void);
  37. static void                                        SysTickTimerEventProc(void);

  38. //=======================================================================//
  39. //= Function define.                                                                                            =//
  40. //=======================================================================//

  41. /*****************************************************************************/
  42. /** Function Name:        SimpleGUI_DemoProcess                                                                   **/
  43. /** Purpose:                Simple GUI HMI engine and interface demo process.       **/
  44. /** Parameters:                None.                                                                                                        **/
  45. /** Return:                        HMI_ENGINE_RESULT.                                                                                **/
  46. /** Notice:                        This function demonstrates how to use the interface and **/
  47. /**                 HMI engine of Simple GUI.                               **/
  48. /*****************************************************************************/
  49. HMI_ENGINE_RESULT InitializeEngine(void)
  50. {
  51.         /*----------------------------------*/
  52.         /* Variable Declaration                                */
  53.         /*----------------------------------*/
  54.         HMI_ENGINE_RESULT           eProcessResult;
  55.         int                                                        iIndex;

  56.         /*----------------------------------*/
  57.         /* Initialize                                                */
  58.         /*----------------------------------*/
  59.         eProcessResult =                        HMI_RET_NORMAL;

  60.         /*----------------------------------*/
  61.         /* Process                                                        */
  62.         /*----------------------------------*/
  63.         /* Clear structure. */
  64.         SGUI_SystemIF_MemorySet(&g_stDeviceInterface, 0x00, sizeof(SGUI_SCR_DEV));
  65.         SGUI_SystemIF_MemorySet(&g_stDemoEngine, 0x00, sizeof(HMI_ENGINE_OBJECT));
  66. #ifdef _SIMPLE_GUI_VIRTUAL_ENVIRONMENT_SIMULATOR_
  67.         /* Initialize display size. */
  68.         g_stDeviceInterface.stSize.Width = 128;
  69.         g_stDeviceInterface.stSize.Height = 64;
  70.         /* Initialize interface object. */
  71.         g_stDeviceInterface.fnSetPixel = SGUI_SDK_SetPixel;
  72.         g_stDeviceInterface.fnGetPixel = SGUI_SDK_GetPixel;
  73.         g_stDeviceInterface.fnClearScreen = SGUI_SDK_ClearDisplay;
  74.         g_stDeviceInterface.fnRefreshScreen = SGUI_SDK_RefreshDisplay;
  75. #else
  76.         /* Initialize display size. */
  77.         g_stDeviceInterface.stSize.Width = 128;
  78.         g_stDeviceInterface.stSize.Height = 64;
  79.         /* Initialize interface object. */
  80.         g_stDeviceInterface.stActions.fnSetPixel = OLED_SetPixel;
  81.         g_stDeviceInterface.stActions.fnGetPixel = OLED_GetPixel;
  82.         g_stDeviceInterface.stActions.fnClearScreen = OLED_ClearDisplay;
  83.         g_stDeviceInterface.stActions.fnRefreshScreen = OLED_RefreshScreen;
  84. #endif

  85.         do
  86.         {
  87.                 /* Prepare HMI engine object. */
  88.                 g_stDemoEngine.ScreenCount = sizeof(g_arrpstScreenObjs)/sizeof(*g_arrpstScreenObjs);
  89.                 g_stDemoEngine.ScreenObjPtr = g_arrpstScreenObjs;
  90.                 g_stDemoEngine.Interface = &g_stDeviceInterface;

  91.                 /* Initialize all screen object. */
  92.                 if(NULL != g_stDemoEngine.ScreenObjPtr)
  93.                 {
  94.                         for(iIndex=0; iIndex<g_stDemoEngine.ScreenCount; iIndex++)
  95.                         {
  96.                                 if( (NULL != g_stDemoEngine.ScreenObjPtr[iIndex])
  97.                                         && (NULL != g_stDemoEngine.ScreenObjPtr[iIndex]->pstActions)
  98.                                         && (g_stDemoEngine.ScreenObjPtr[iIndex]->pstActions->Initialize)
  99.                                         )
  100.                                 {
  101.                                         g_stDemoEngine.ScreenObjPtr[iIndex]->pstActions->Initialize(&g_stDeviceInterface);
  102.                                         g_stDemoEngine.ScreenObjPtr[iIndex]->pstPrevious = NULL;
  103.                                 }
  104.                         }
  105.                 }
  106.                 else
  107.                 {

  108.                 }
  109.                 /* Active engine object. */
  110.                 eProcessResult = HMI_ActiveEngine(&g_stDemoEngine, HMI_SCREEN_ID_DEMO_SCROLLING_TEXT);
  111.                 if(HMI_PROCESS_FAILED(eProcessResult))
  112.                 {
  113.                         /* Active engine failed. */
  114.                         break;
  115.                 }
  116.                 /* Start engine process. */
  117.                 eProcessResult = HMI_StartEngine(NULL);
  118.                 if(HMI_PROCESS_FAILED(eProcessResult))
  119.                 {
  120.                         /* Start engine failed. */
  121.                         break;
  122.                 }
  123.         }while(0);


  124.         return eProcessResult;
  125. }

  126. int DemoMainProcess(void)
  127. {
  128.         /*----------------------------------*/
  129.         /* Initialize                                                */
  130.         /*----------------------------------*/
  131.     // Initialize Engine.
  132.     InitializeEngine();

  133.     /*----------------------------------*/
  134.         /* Process                                                        */
  135.         /*----------------------------------*/
  136.     while(1)
  137.     {
  138.         // Check and process heart-beat timer event.
  139.         if(true == SGUI_SDK_GetEventSyncFlag(ENV_FLAG_IDX_SDK_TIM_EVENT))
  140.         {
  141.                 SysTickTimerEventProc();
  142.             SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_TIM_EVENT, false);
  143.         }
  144.         // Check and process key press event.
  145.         if(true == SGUI_SDK_GetEventSyncFlag(ENV_FLAG_IDX_SDK_KEY_EVENT))
  146.         {
  147.             KeyPressEventProc();
  148.             SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_KEY_EVENT, false);
  149.         }
  150.         // Check and process RTC event.
  151.         if(true == SGUI_SDK_GetEventSyncFlag(ENV_FLAG_IDX_SDK_RTC_EVENT))
  152.         {
  153.             RTCEventProc();
  154.             SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_RTC_EVENT, false);
  155.         }
  156.     }

  157.         return 0;
  158. }

  159. void KeyPressEventProc(void)
  160. {
  161.         /*----------------------------------*/
  162.         /* Variable Declaration                                */
  163.         /*----------------------------------*/
  164.         KEY_PRESS_EVENT                stEvent;

  165.         /*----------------------------------*/
  166.         /* Initialize                                                */
  167.         /*----------------------------------*/
  168.         HMI_EVENT_INIT(stEvent);

  169.         /*----------------------------------*/
  170.         /* Process                                                        */
  171.         /*----------------------------------*/
  172.         stEvent.Head.iType = EVENT_TYPE_ACTION;
  173.         stEvent.Head.iID = EVENT_ID_KEY_PRESS;
  174.         stEvent.Data.uiKeyValue = SGUI_SDK_GetKeyEventData();
  175.         // Post key press event.
  176.         HMI_ProcessEvent((HMI_EVENT_BASE*)(&stEvent));
  177. }

  178. void SysTickTimerEventProc(void)
  179. {
  180.     /*----------------------------------*/
  181.     /* Variable Declaration                                */
  182.     /*----------------------------------*/
  183.     DATA_EVENT                                stEvent;

  184.     /*----------------------------------*/
  185.     /* Initialize                                                */
  186.     /*----------------------------------*/
  187.     HMI_EVENT_INIT(stEvent);

  188.     /*----------------------------------*/
  189.     /* Process                                                        */
  190.     /*----------------------------------*/
  191.     stEvent.Head.iType =        EVENT_TYPE_DATA;
  192.     stEvent.Head.iID =                EVENT_ID_TIMER;
  193. ……………………

  194. …………限于本文篇幅 余下代碼請從51黑下載附件…………
復制代碼

所有資料51hei提供下載:
simplegui.7z (2.42 MB, 下載次數: 112)

評分

參與人數 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎勵!

查看全部評分

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏3 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:388210 發表于 2020-4-20 15:35 | 只看該作者
不放到gitee上嗎?
回復

使用道具 舉報

板凳
ID:68189 發表于 2024-2-22 14:12 | 只看該作者
玩不轉它的VirtualSDK.有編譯好的虛擬窗口嗎,或者它的編譯環境文件。下載不了
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 韩日三级 | 一区二区精品 | 午夜精品一区二区三区三上悠亚 | 国产成人一区在线 | 久久国产精品一区二区三区 | 在线免费激情视频 | 一区二区高清 | a在线免费观看 | 成人一区二 | 日日淫 | 国产乱码精品一区二区三区忘忧草 | 日日干夜夜操 | www视频在线观看 | 日韩欧美一区二区三区四区 | 懂色av一区二区三区在线播放 | 91色综合 | 精品久久久久久久人人人人传媒 | 久久精品亚洲一区 | 国产婷婷色一区二区三区 | 欧美日韩视频在线播放 | 午夜国产| 99热都是精品 | 精品国产aⅴ | 国产婷婷精品av在线 | 日本久久网站 | 国产中文字幕网 | 久久精品国产一区二区电影 | 成人黄色电影在线播放 | 精品区| 日本一区二区高清视频 | 免费观看国产视频在线 | 91精品亚洲 | 五月天综合影院 | 一区二区成人 | 一区二区三区 在线 | 91福利网| 自拍 亚洲 欧美 老师 丝袜 | 女女爱爱视频 | 天堂国产| 国产精品亚洲精品日韩已方 | 一区精品在线观看 |