GUIDEMO_Intro.c 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*********************************************************************
  2. * SEGGER Microcontroller GmbH & Co. KG *
  3. * Solutions for real time microcontroller applications *
  4. **********************************************************************
  5. * *
  6. * (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
  7. * *
  8. * Internet: www.segger.com Support: support@segger.com *
  9. * *
  10. **********************************************************************
  11. ** emWin V5.32 - Graphical user interface for embedded applications **
  12. All Intellectual Property rights in the Software belongs to SEGGER.
  13. emWin is protected by international copyright laws. Knowledge of the
  14. source code may not be used to write a similar product. This file may
  15. only be used in accordance with the following terms:
  16. The software has been licensed to STMicroelectronics International
  17. N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
  18. les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
  19. purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
  20. troller products commercialized by Licensee only, sublicensed and dis_
  21. tributed under the terms and conditions of the End User License Agree_
  22. ment supplied by STMicroelectronics International N.V.
  23. Full source code is available at: www.segger.com
  24. We appreciate your understanding and fairness.
  25. ----------------------------------------------------------------------
  26. Licensing information
  27. Licensor: SEGGER Software GmbH
  28. Licensed to: STMicroelectronics International NV
  29. Licensed SEGGER software: emWin
  30. License number: GUI-00429
  31. License model: Buyout SRC [Buyout Source Code License, signed November 29th 2012]
  32. Licensed product: -
  33. Licensed platform: STMs ARM Cortex-M based 32 BIT CPUs
  34. Licensed number of seats: -
  35. ----------------------------------------------------------------------
  36. File : GUIDEMO_Intro.c
  37. Purpose : Introduction for emWin generic demo
  38. (This is also a good file to demo and explain basic
  39. emWin features by setting breakpoints)
  40. ----------------------------------------------------------------------
  41. */
  42. #include <string.h>
  43. #include "GUIDEMO.h"
  44. /*********************************************************************
  45. *
  46. * Defines
  47. */
  48. #define SCREEN_DIV 6 // 2^6 = 64
  49. #define FACTOR_EMWIN 4
  50. #define FACTOR_DESC 11
  51. #define FACTOR_ANY_COMP 22
  52. #define FACTOR_VERSION 31
  53. #define FACTOR_LOGO 38
  54. #define FACTOR_WWW 56
  55. #define DIST_ANY_COMP 18
  56. /*********************************************************************
  57. *
  58. * GUIDEMO_Intro
  59. *
  60. **********************************************************************
  61. */
  62. void GUIDEMO_Intro(void) {
  63. char acVersion[30] = "Version of STemWin: ";
  64. int xCenter, xSize, ySize;
  65. xSize = LCD_GetXSize();
  66. ySize = LCD_GetYSize();
  67. xCenter = xSize / 2;
  68. GUIDEMO_DrawBk();
  69. GUI_SetTextMode(GUI_TM_TRANS);
  70. //
  71. // emWin
  72. //
  73. GUI_SetColor(GUI_WHITE);
  74. GUI_SetFont(&GUI_FontRounded22);
  75. GUI_DispStringHCenterAt("STemWin", xCenter, (FACTOR_EMWIN * ySize) >> SCREEN_DIV);
  76. //
  77. // emWin description
  78. //
  79. GUI_SetFont(&GUI_FontSouvenir18);
  80. GUI_DispStringHCenterAt("Universal graphic software\nfor embedded applications", xCenter, (FACTOR_DESC * ySize) >> SCREEN_DIV);
  81. //
  82. // Any text
  83. //
  84. GUI_SetColor(0x2288ff);
  85. GUI_DispStringHCenterAt("For STM32 MCU Products - Cortex M3 - Cortex M4", xCenter, (FACTOR_ANY_COMP * ySize) >> SCREEN_DIV);
  86. //
  87. // Compiled
  88. //
  89. GUI_SetFont(&GUI_Font10S_ASCII);
  90. GUI_DispStringHCenterAt("Compiled " __DATE__ " "__TIME__, xCenter, ((FACTOR_ANY_COMP * ySize) >> SCREEN_DIV) + DIST_ANY_COMP);
  91. //
  92. // Version
  93. //
  94. GUI_SetColor(GUI_WHITE);
  95. GUI_SetFont(&GUI_FontSouvenir18);
  96. strcat(acVersion, GUI_GetVersionString());
  97. GUI_DispStringHCenterAt(acVersion, xCenter, (FACTOR_VERSION * ySize) >> SCREEN_DIV);
  98. //
  99. // Logo
  100. //
  101. GUI_DrawBitmap(&bmSTLogo, (xSize - bmSTLogo.XSize) >> 1, (FACTOR_LOGO * ySize) >> SCREEN_DIV);
  102. //
  103. // www.segger.com
  104. //
  105. GUI_SetColor(GUI_WHITE);
  106. GUI_SetFont(&GUI_FontRounded22);
  107. GUI_DispStringHCenterAt("www.st.com/stm32", xCenter, (FACTOR_WWW * ySize) >> SCREEN_DIV);
  108. GUIDEMO_Delay(5000);
  109. }
  110. /*************************** End of file ****************************/