Mercurial > public > ostc4
annotate Discovery/Inc/gfx_engine.h @ 1053:36fa1c44e597 Icon_Integration
Added upload command for icon:
It is now possible to upload a custom icon which is shown during startup and while writing settings (instead of the HW string). The icons are limited to 256 colors and 800x480 pixels. The icon may not be larger than 200kByte because of storage avability. For upload the same CRC functions as for the common firmware updates are in use,
| author | Ideenmodellierer |
|---|---|
| date | Wed, 31 Dec 2025 17:49:05 +0100 |
| parents | 65d35e66efb9 |
| children |
| rev | line source |
|---|---|
| 38 | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 /// -*- coding: UTF-8 -*- | |
| 3 /// | |
| 4 /// \file Discovery/Inc/gfx_engine.h | |
| 5 /// \brief DATA INPUT POSITION structure definition | |
| 6 /// \author heinrichs weikamp gmbh | |
| 7 /// \date 07-April-2014 | |
| 8 /// | |
| 9 /// $Id$ | |
| 10 /////////////////////////////////////////////////////////////////////////////// | |
| 11 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
| 12 /// | |
| 13 /// This program is free software: you can redistribute it and/or modify | |
| 14 /// it under the terms of the GNU General Public License as published by | |
| 15 /// the Free Software Foundation, either version 3 of the License, or | |
| 16 /// (at your option) any later version. | |
| 17 /// | |
| 18 /// This program is distributed in the hope that it will be useful, | |
| 19 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 20 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 21 /// GNU General Public License for more details. | |
| 22 /// | |
| 23 /// You should have received a copy of the GNU General Public License | |
| 24 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 25 ////////////////////////////////////////////////////////////////////////////// | |
| 26 | |
| 27 /* Define to prevent recursive inclusion -------------------------------------*/ | |
| 28 #ifndef GFX_ENGINE_H | |
| 29 #define GFX_ENGINE_H | |
| 30 | |
| 31 /* Includes ------------------------------------------------------------------*/ | |
| 32 #include "stm32f4xx_hal.h" | |
| 33 #include "gfx.h" | |
| 34 | |
| 35 /* Exported types ------------------------------------------------------------*/ | |
| 36 | |
| 37 /** | |
| 38 * @brief DATA INPUT POSITION structure definition | |
| 39 */ | |
| 40 | |
| 41 typedef struct | |
| 42 { | |
| 43 uint32_t FBStartAdress; /*!< Configures the color frame buffer address */ | |
| 44 uint16_t ImageWidth; /*!< Configures the color frame buffer line length. | |
| 45 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x1FFF. */ | |
| 46 uint16_t ImageHeight; /*!< Specifies the number of line in frame buffer. | |
| 47 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */ | |
| 48 uint8_t LayerIndex; | |
| 49 } GFX_DrawCfgScreen; | |
| 50 | |
| 51 | |
| 52 typedef struct | |
| 53 { | |
| 54 uint16_t WindowX0; /*!< Configures the Window vertical Start Position. | |
| 55 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */ | |
| 56 uint16_t WindowX1; /*!< Configures the Window vertical Stop Position. | |
| 57 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */ | |
| 58 uint16_t WindowY0; /*!< Configures the Window Horizontal Start Position. | |
| 59 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */ | |
| 60 uint16_t WindowY1; /*!< Configures the Window Horizontal Stop Position. | |
| 61 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ | |
| 62 | |
| 63 uint16_t WindowTab; /*!< Configures the Window Horizontal Absolute Tab Position. | |
| 64 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ | |
| 65 | |
| 66 uint16_t WindowNumberOfTextLines; /*!< Configures the Number of Text Lines. | |
| 67 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ | |
| 68 | |
| 69 uint16_t WindowLineSpacing; /*!< Configures the Number of Text Lines. | |
| 70 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ | |
| 71 GFX_DrawCfgScreen *Image; | |
| 72 } GFX_DrawCfgWindow; | |
| 73 | |
| 74 typedef struct | |
| 75 { | |
| 76 int left; | |
| 77 int right; | |
| 78 int top; | |
| 79 int bottom; | |
| 80 } SWindowGimpStyle; | |
| 81 | |
| 1053 | 82 typedef struct { |
| 83 uint32_t length; | |
| 84 uint8_t type, dummy5, dummy6, dummy7; | |
| 85 uint32_t checksum; | |
| 86 } SIconHeader; | |
| 87 | |
| 38 | 88 /* Exported variables --------------------------------------------------------*/ |
| 89 | |
| 90 /** | |
| 91 * \001 center | |
| 92 * \002 right | |
| 93 * \003 doubleSize | |
| 94 * \004 NOP | |
| 95 * \005 checkbox checked | |
| 96 * \006 checkbox unchecked | |
| 97 * \007 invert \a | |
| 98 * \010 use color \b | |
| 99 * \011 tab \t | |
| 100 * \012 line feed \n | |
| 101 * \014 top align \f | |
| 102 * \015 carriage return \r | |
| 103 * \016 O:o O.o style | |
| 104 * \017 back to O font | |
| 105 * \020 color 0 | |
| 106 * ... | |
| 107 * \027 color 8 | |
| 108 * \026 color 11 | |
| 109 * \033 UNUSED \c ESC | |
| 110 * \034 monospaced space large size mode | |
| 111 * \035 standard space size mode | |
| 112 * \040 space == begin of text | |
| 113 * ... | |
| 114 * \x7F = \177 del = space with size of next char | |
| 115 * \x7F\x7F = \177\177 del del = space with size of next byte | |
| 116 * \x80 begin of TXT_Substring with Language support | |
| 117 */ | |
| 118 | |
| 119 /* Exported functions --------------------------------------------------------*/ | |
| 120 | |
| 121 void GFX_init(uint32_t * pDestinationOut); | |
| 870 | 122 void GFX_init1_no_DMA(uint32_t * pDestinationOut, uint8_t blockFrames); |
| 38 | 123 |
| 124 void GFX_helper_font_memory_list(const tFont *Font); | |
| 125 | |
| 126 void GFX_start_VSYNC_IRQ(void); | |
| 127 void GFX_change_LTDC(void); | |
| 128 | |
| 129 void GFX_SetFrameTop(uint32_t pDestination); | |
| 130 void GFX_SetFrameBottom(uint32_t pDestination, uint32_t x0, uint32_t y0, uint32_t width, uint32_t height); | |
| 131 void GFX_SetFramesTopBottom(uint32_t pTop, uint32_t pBottom, uint32_t heightBottom); | |
| 132 | |
| 133 void GFX_SetWindowLayer0(uint32_t pDestination, int16_t XleftGimpStyle, int16_t XrightGimpStyle, int16_t YtopGimpStyle, int16_t YbottomGimpStyle); | |
| 134 void change_CLUT_entry(uint8_t entryToChange, uint8_t entryUsedForChange); | |
| 135 | |
| 136 uint16_t GFX_return_offset(const tFont *Font, char *pText, uint8_t position); | |
| 137 | |
| 138 void GFX_VGA_transform(uint32_t pSource, uint32_t pDestination); | |
| 139 | |
| 140 HAL_StatusTypeDef GFX_SetBackgroundColor(uint32_t LayerIdx, uint8_t red, uint8_t green, uint8_t blue); | |
| 141 | |
| 142 void GFX_LTDC_LayerTESTInit(uint16_t LayerIndex, uint32_t FB_Address); | |
| 143 | |
| 144 void GFX_fill_buffer(uint32_t pDestination, uint8_t alpha, uint8_t color); | |
| 145 | |
| 146 void GFX_clear_window_immediately(GFX_DrawCfgWindow* hgfx); | |
| 147 | |
| 148 //void GFX_draw_circle_with_MEMORY(uint8_t use_memory, GFX_DrawCfgScreen *hgfx, point_t center, uint8_t radius, int8_t color); | |
| 1007 | 149 void GFX_draw_pixel(GFX_DrawCfgScreen *hgfx, int16_t x, int16_t y, uint8_t color); |
| 38 | 150 void GFX_draw_circle(GFX_DrawCfgScreen *hgfx, point_t center, uint8_t radius, int8_t color); |
| 151 void GFX_draw_colorline(GFX_DrawCfgScreen *hgfx, point_t start, point_t stop, uint8_t color); | |
| 152 void GFX_draw_thick_line(uint8_t thickness, GFX_DrawCfgScreen *hgfx, point_t start, point_t stop, uint8_t color); | |
| 153 void GFX_draw_line(GFX_DrawCfgScreen *hgfx, point_t start, point_t stop, uint8_t color); | |
| 154 void GFX_draw_box2(GFX_DrawCfgScreen *hgfx, point_t start, point_t stop, uint8_t color, uint8_t roundCorners); | |
| 155 void GFX_draw_box(GFX_DrawCfgScreen *hgfx, point_t LeftLow, point_t WidthHeight, uint8_t Style, uint8_t color); | |
| 156 void GFX_draw_header(GFX_DrawCfgScreen *hgfx, uint8_t colorId); | |
| 157 void GFX_clean_line(GFX_DrawCfgWindow* hgfx, uint32_t line_number); | |
| 158 void GFX_clean_area(GFX_DrawCfgScreen *tMscreen, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, uint16_t YBottomGimpStyle); | |
| 159 | |
| 160 uint32_t GFX_write_string(const tFont *Font, GFX_DrawCfgWindow* hgfx, const char *pText, uint32_t line_number); | |
| 161 uint32_t GFX_write_string_color(const tFont *Font, GFX_DrawCfgWindow* hgfx, const char *pText, uint32_t line_number, uint8_t color); | |
| 162 uint32_t GFX_write_label(const tFont *Font, GFX_DrawCfgWindow* hgfx, const char *pText, uint8_t color); | |
| 163 void Gfx_write_label_var(GFX_DrawCfgScreen *screenInput, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const uint8_t color, const char *text); | |
| 164 void GFX_LTDC_Init(void); | |
| 165 void GFX_VGA_LTDC_Init(void); | |
| 166 void GFX_LTDC_LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address); | |
| 167 void GFX_VGA_LTDC_LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address); | |
| 168 void GFX_LTDC_LayerMenuBackgroundInit(uint32_t FB_Address); | |
| 169 //void GFX_ResetLayer(uint32_t LayerIdx); | |
| 170 | |
| 171 //void GFX_fill_full_image_ARGB8888_alternating_lines(GFX_DrawCfgWindow* hgfx, uint32_t color1, uint32_t color2); | |
| 172 //void GFX_fill_window_ARGB8888(GFX_DrawCfgWindow* hgfx, uint32_t color); | |
| 173 | |
| 174 //void GFX_copy_full_image_ARGB8888_to_RGB888(GFX_DrawCfgWindow* hgfx, uint32_t FBdestination); | |
| 175 | |
| 176 void GFX_graph_print(GFX_DrawCfgScreen *hgfx, const SWindowGimpStyle *window, int16_t drawVeilUntil, uint8_t Xdivide, uint16_t dataMin, uint16_t dataMax, uint16_t *data, uint16_t datalength, uint8_t color, uint8_t *colour_data); | |
| 177 void GFX_draw_Grid(GFX_DrawCfgScreen *hgfx, SWindowGimpStyle window, int vlines, float vdeltaline, int hlines, float hdeltalines, uint8_t color); | |
| 178 | |
| 179 uint32_t getFrame(uint8_t callerId); | |
| 180 uint32_t getFrameByNumber(uint8_t ZeroToMaxFrames); | |
| 181 uint8_t releaseFrame(uint8_t callerId, uint32_t frameStartAddress); | |
| 182 void GFX_forceReleaseFramesWithId(uint8_t callerId); | |
| 183 void releaseAllFramesExcept(uint8_t callerId, uint32_t frameStartAddress); | |
|
625
028d8f3a9410
Switch Sector / Scroll detection to vector implementation:
Ideenmodellierer
parents:
567
diff
changeset
|
184 uint8_t housekeepingFrame(void); |
| 38 | 185 uint16_t blockedFramesCount(void); |
| 186 uint8_t getFrameCount(uint8_t frameId); | |
| 187 | |
| 188 void write_content_simple(GFX_DrawCfgScreen *tMscreen, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint8_t color); | |
| 189 void gfx_write_topline_simple(GFX_DrawCfgScreen *tMscreen, const char *text, uint8_t color); | |
| 190 void gfx_write_page_number(GFX_DrawCfgScreen *tMscreen, uint8_t page, uint8_t total, uint8_t color); | |
| 191 | |
| 192 void GFX_draw_image_monochrome(GFX_DrawCfgScreen *hgfx, SWindowGimpStyle window, const tImage *image, uint8_t color); | |
| 314 | 193 void GFX_build_logo_frame(void); |
| 194 void GFX_build_hw_background_frame(void); | |
| 195 | |
| 38 | 196 void GFX_logoAutoOff(void); |
| 197 uint8_t GFX_logoStatus(void); | |
| 198 void GFX_hwBackgroundOn(void); | |
| 199 void GFX_hwBackgroundOff(void); | |
| 200 | |
| 201 uint8_t gfx_number_to_string(uint8_t max_digits, _Bool fill, char *pText, uint32_t number); | |
| 202 | |
| 203 uint8_t GFX_is_colorschemeDiveStandard(void); | |
| 204 void GFX_use_colorscheme(uint8_t colorscheme); | |
| 205 | |
| 206 void GFX_screenshot(void); | |
| 207 | |
| 567 | 208 tFont* GFX_Check_Extra_Font(uint8_t character, tFont *Font); |
| 209 uint32_t GFX_Character_Width(uint8_t character, tFont *Font); | |
| 870 | 210 void Gfx_colorsscheme_mod(char *text, uint8_t alternativeColor); |
| 38 | 211 #endif // GFX_ENGINE_H |
