⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 seggerdemo.c

📁 An Demo of uCGUI from SEGGER
💻 C
字号:
/*********************************************************************
*               SEGGER MICROCONTROLLER SYSTEME GmbH                  *
*       Solutions for real time microcontroller applications         *
**********************************************************************
*                                                                    *
*       (c) 1995 - 2008  SEGGER Microcontroller GmbH & Co. KG        *
*                                                                    *
*       www.segger.com     Support: support@segger.com               *
*                                                                    *
**********************************************************************
*                                                                    *
*       embOS * Real time operating system for microcontrollers      *
*                                                                    *
*                                                                    *
*       Please note:                                                 *
*                                                                    *
*       Knowledge of this file may under no circumstances            *
*       be used to write a similar product or a real-time            *
*       operating system for in-house use.                           *
*                                                                    *
*       Thank you for your fairness !                                *
*                                                                    *
**********************************************************************
*                                                                    *
*       embOS version: 3.60c                                         *
*                                                                    *
**********************************************************************

----------------------------------------------------------------------
File    : SeggerDemo.c
          for STM32F10

Purpose : emWin and embOS demo application
--------  END-OF-HEADER  ---------------------------------------------
*/

#include "BSP.h"
#include "GUI.h"
#include "WM.h"
#include "RTOS.h"
#include "GUIDemo.h"
#include <string.h>

extern GUI_CONST_STORAGE GUI_BITMAP bmSeggerLogo300;
extern GUI_CONST_STORAGE GUI_BITMAP bmemUSB;
extern GUI_CONST_STORAGE GUI_BITMAP bmemWin;
extern GUI_CONST_STORAGE GUI_BITMAP bmembOSFeatures;

extern GUI_CONST_STORAGE GUI_BITMAP bmImageSeggerProducts;
extern GUI_CONST_STORAGE GUI_BITMAP bmImageSeggerProductsCombined;
extern GUI_CONST_STORAGE GUI_BITMAP bmImageemFile;
extern GUI_CONST_STORAGE GUI_BITMAP bmImageJLink;

/*********************************************************************
*
*       main()
*/
void MainTask(void);
void MainTask(void) {
  GUI_RECT Rect4 = {100, 55, 320, 240};
  GUI_RECT Rect8 = {100, 55, 320, 240};
  GUI_RECT Rect9 = {100, 55, 320, 240};

  BSP_GUI_Init();
#if GUI_SUPPORT_MEMDEV
  WM_SetCreateFlags(WM_CF_MEMDEV);
#endif
  while(1) {
    GUI_CURSOR_Hide();
    //
    // Presentation Page 1: SEGGER logo
    //
    GUI_Clear();
    GUI_SetColor(GUI_WHITE);
    GUI_FillRect(0, 0, 320, 240);
    GUI_DrawBitmap(&bmSeggerLogo300,10,45);
    GUI_Delay(5000);
    //
    // Presentation Page 2: SEGGER Products
    //
    GUI_Clear();
    GUI_FillRect(0, 0, 320, 240);
    GUI_DrawBitmap(&bmImageSeggerProducts,0,30);
    GUI_Delay(5000);
    //
    // Presentation Page 3: SEGGER Products Combined
    //
    GUI_Clear();
    GUI_FillRect(0, 0, 320, 240);
    GUI_DrawBitmap(&bmImageSeggerProductsCombined, 0, 4);
    GUI_Delay(5000);
    //
    // Presentation Page 4: embOSFeatures
    //
    GUI_Clear();
    GUI_FillRect(0, 0, 320, 240);
    GUI_SetBkColor(GUI_WHITE);
    GUI_SetColor(GUI_BLACK);

    GUI_DrawBitmap(&bmembOSFeatures, 22, 35);

    GUI_SetFont(&GUI_Font20B_ASCII);
    GUI_GotoXY(5, 5);
    GUI_DispString("embOS");
    GUI_GotoXY(100, 35);
    GUI_DispString("Features");

    GUI_SetFont(&GUI_Font13B_ASCII);
    GUI_GotoXY(5, 22);
    GUI_DispString("Real Time OS");
    GUI_GotoXY(100, 55);
    GUI_DispStringInRect("- Zero interrupt latency\n"
                         "- Fast context switch\n"
                         "- Independent of number of tasks\n"
                         "- Small footprint\n"
                         "   ROM size  3KB (Kernel only,\n"
                         "                      ARM7/IAR compiler)\n"
                         "   RAM size  Kernel: app. 51bytes\n"
                         "                      Task: 32bytes +\n"
                         "                                 Stack per task"
                         , &Rect4, GUI_TA_LEFT);

    GUI_SetFont(&GUI_Font16B_ASCII);
    GUI_SetColor(GUI_RED);
    GUI_GotoXY(15, 210);

    GUI_DispString("One of the smallest and most efficient kernels!");
    GUI_Delay(5000);
    //
    // Presentation Page 8: emWin
    //
    GUI_Clear();
    GUI_SetColor(GUI_WHITE);
    GUI_FillRect(0, 0, 320, 240);
    GUI_SetBkColor(GUI_WHITE);
    GUI_SetColor(GUI_BLACK);

    GUI_DrawBitmap(&bmemWin, 30, 35);

    GUI_SetFont(&GUI_Font20B_ASCII);
    GUI_GotoXY(5, 5);
    GUI_DispString("emWin");
    GUI_GotoXY(100, 35);
    GUI_DispString("Features");

    GUI_SetFont(&GUI_Font13B_ASCII);
    GUI_GotoXY(5, 22);
    GUI_DispString("Graphics Software and GUI");
    GUI_GotoXY(100, 55);
    GUI_DispStringInRect("- Any CPU, any LCD, any LCD controller\n"
                         "- ANSI \"C\" no C++ required\n"
                         "- Multiple layer / multi display support\n"
                         "- Small footprint\n"
                         "- Touch screen support\n"
                         "- Alpha blending\n"
                         "- Support for transparent windows\n"
                         "- JPEG support\n"
                         "- Font converter available\n"
                         "- VNC Server available\n"
                         "- and much more..."
                         , &Rect8, GUI_TA_LEFT);
    GUI_Delay(5000);
    //
    // Presentation Page 9: emUSB
    //
    GUI_Clear();
    GUI_SetColor(GUI_WHITE);
    GUI_FillRect(0, 0, 320, 240);
    GUI_SetBkColor(GUI_WHITE);
    GUI_SetColor(GUI_BLACK);

    GUI_DrawBitmap(&bmemUSB, 5, 35);

    GUI_SetFont(&GUI_Font20B_ASCII);
    GUI_GotoXY(5, 5);
    GUI_DispString("emUSB");
    GUI_GotoXY(100, 35);
    GUI_DispString("Features");

    GUI_SetFont(&GUI_Font13B_ASCII);
    GUI_GotoXY(5, 22);
    GUI_DispString("USB Device Stack");
    GUI_GotoXY(100, 55);
    GUI_DispStringInRect("- Supports USB 1.1/2.0 devices\n"
                         "- ISO/ANSI C source code\n"
                         "- Full/High speed support\n"
                         "- Bulk communication component with\n"
                         "   Windows kernelmode driver available\n"
                         "- MSD Component available\n"
                         "- MSD-CDROM support\n"
                         "- MSD supports any type of storage\n"
                         "   incl. NAND\n"
                         "- CDC component available\n"
                         "- HID component available\n"
                         "- Target drivers for most popular USB\n"
                         "   devices\n"
                         "- No royalties"
                         , &Rect9, GUI_TA_LEFT);
    GUI_Delay(5000);
#ifdef __ICCARM__
  #if (__VER__ < 500)
    #define __EXLUDE_EMFILE_SLIDE__  // IAR V4 produces bigger code than V5
  #endif                             // For code to fit one slide is excluded
#endif
#ifndef __EXLUDE_EMFILE_SLIDE__
    //
    // Presentation Page 10: emFile
    //
    GUI_Clear();
    GUI_SetColor(GUI_WHITE);
    GUI_FillRect(0, 0, 320, 240);
    GUI_DrawBitmap(&bmImageemFile,0,0);
    GUI_Delay(5000);
#endif
    //
    // Presentation Page 11: J-Link
    //
    GUI_Clear();
    GUI_SetColor(GUI_WHITE);
    GUI_FillRect(0, 0, 320, 240);
    GUI_DrawBitmap(&bmImageJLink, 7, 0);
    GUI_Delay(5000);
    //
    // Start GUIDemo
    //
    GUIDEMO_main();
  }
}

/****** End of File *************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -