WebRadioApp  0.1
ewconfig.h File Reference

This file contains general configuration settings for the target system, like memory ranges and display parameter and configuration settings for the Embedded Wizard Graphics Engine and Runtime Environment. More...

#include "ewdef.h"
Include dependency graph for ewconfig.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EWCONFIG_H
 
Macros Application

Following macros configure the application.

PLATFORM_STRING - This macro contains the name of the development platform.

SDRAM_BASE_ADDR, SDRAM_SIZE_BYTES - These macros define the start address and the size of the SDRAM that can be used for framebuffer and heap manager.

EW_USE_TERMINAL_INPUT - Flag to switch on/off the support of keyboard events received from a connected serial terminal.

EW_CPU_LOAD_MEASURING - Flag to switch on/off the measuring of the CPU load caused by the GUI application and all graphics operations. The CPU load can be read by using the function EwBspClockGetCpuLoad().

RTC_MINIMUM_TIME, RTC_DEFAULT_TIME - Macros to define the initialization value of the realtime clock. The value RTC_DEFAULT_TIME is used as start value for the RTC in case that it is not already initialized with a value higher than RTC_MINIMUM_TIME.

#define PLATFORM_STRING   "STM32H747-Discovery"
 
#define SDRAM_BASE_ADDR   0xD0000000
 
#define SDRAM_SIZE_BYTES   0x2000000
 
#define TCPBUF_SIZE_FIXED   0x400000
 
#define TLS_SIZE_FIXED   0x100000
 
#define EW_USE_TERMINAL_INPUT   0
 
#define EW_CPU_LOAD_MEASURING   1
 
#define RTC_MINIMUM_TIME   978307200
 
#define RTC_DEFAULT_TIME   1605193200
 
Macros Display

Following macros configure the display integration, the framebuffer access and the usage of the graphics accelerator. For details about different framebuffer concepts please have a look to https://doc.embedded-wizard.de/framebuffer-concepts

EW_USE_SCRATCHPAD_BUFFER - Flag to switch on/off the usage of a small scratch-pad buffer used for the graphics composition instead of a framebuffer. As a result the screen of the display is updated in partial mode. This mode is used to reduce the memory footprint to a minimum, but it may cause some tearing or flickering effects. This mode is useful in combination with displays containing its own graphics memory (GRAM). Please note, that this option is not supported for each display integration.

EW_USE_DOUBLE_BUFFER - Flag to switch on/off the usage of an additional framebuffer, so that the screen is operated in double-buffering mode. If double-buffering is activated, the exchange between front-buffer and back-buffer has to be done at V-sync. This has to be implemented in the function EwBspDsipalyCommitBuffer(). In case of a single buffered configuration, the graphics composition is done directly into the framebuffer. This makes only sense, if you are using an LCD with its own pixelbuffer (e.g. some MIPI-DSI displays). Otherwise, the composition of the framebuffer content has to be synchronized with the LCD update in order to avoid flickering.

EW_USE_OFFSCREEN_BUFFER - Flag to switch on/off the usage of an additional off-screen buffer. This is an internal buffer, allocated by the Graphics Engine and used to prepare the graphical content (composition buffer). The usage of an separate off-screen buffer might be advantageous on systems where the read access from the physical framebuffer is very slow. In this case, the off-screen buffer is used for composition (read and write access) and the final graphics is then copied into the framebuffer (write access). Please note, that this option is not supported for each display integration.

FRAME_BUFFER_WIDTH and FRAME_BUFFER_HEIGHT - This macros define the physical size of the framebuffer in pixel. Typically this size corresponds to the attribute ScreenSize defined within the profile of the GUI application.

FRAME_BUFFER_ADDR, FRAME_BUFFER_SIZE - These macros define the start address and the size (in bytes) of the framebuffer.

DOUBLE_BUFFER_ADDR, DOUBLE_BUFFER_SIZE - These macros define the start address and the size (in bytes) of the optional double-buffer.

EW_USE_GRAPHICS_ACCELERATOR - Flag to switch on/off the usage of the graphics accelerator within the target (if available). Please note: Changing this macro requires the complete source code of the Graphics Engine to be recompiled with the new setting. As such it works only for customers who have licensed the 'Professional' edition.

#define EW_USE_DOUBLE_BUFFER   1
 
#define EW_USE_OFFSCREEN_BUFFER   1
 
#define FRAME_BUFFER_WIDTH   800
 
#define FRAME_BUFFER_HEIGHT   480
 
#define FRAME_BUFFER_ADDR   SDRAM_BASE_ADDR
 
#define FRAME_BUFFER_SIZE   0x100000
 
#define DOUBLE_BUFFER_ADDR   (SDRAM_BASE_ADDR + SDRAM_SIZE_BYTES - FRAME_BUFFER_SIZE)
 
#define DOUBLE_BUFFER_SIZE   FRAME_BUFFER_SIZE
 
#define EW_USE_GRAPHICS_ACCELERATOR   1
 
Macros Memory

Following macros configure the memory area used for the Embedded Wizard heap manager. Optionally, an additional extra memory pool can be defined.

EW_MEMORY_POOL_SECTION - This macro has to be defined if the memory pool shall be declared as an array. Optionally a linker section name can be assigned to this macro to define where this array shall be located by the linker. Alternatively, a fixed memory address can be defined by setting the macro EW_MEMORY_POOL_ADDR.

EW_MEMORY_POOL_ADDR - This macro defines the start address of the memory pool to a fixed address. Take care that the memory area is not used by the linker. Do not use this define in combination with EW_MEMORY_POOL_SECTION.

EW_MEMORY_POOL_SIZE - This macro defines the size of the memory pool in bytes used for the Embedded Wizard heap manager.

EW_EXTRA_POOL_SECTION, EW_EXTRA_POOL_ADDR and EW_EXTRA_POOL_SIZE - These macros are used to define a second (additional) memory pool.

#define EW_MEMORY_POOL_ADDR   (FRAME_BUFFER_ADDR + FRAME_BUFFER_SIZE + TCPBUF_SIZE_FIXED + TLS_SIZE_FIXED)
 
#define EW_MEMORY_POOL_SIZE
 
#define EW_EXTRA_POOL_ADDR   0
 
#define EW_EXTRA_POOL_SIZE   0
 
Macros Cache&Buffers

Following macros configure the size of diverse caches and buffers. Generally, the larger a cache or buffer, the better the performance of the application. On the other hand, large caches and buffers will occupy more RAM. Configure the macros prudently according to the available RAM and expected performance.

EW_MAX_STRING_CACHE_SIZE - This macro specifies the threshold value for the capacity of the string cache. The string cache stores frequently used string constants preventing them from being reloaded repeatedly. Embedded Wizard tracks the amount of memory occupied by all string constants and as soon as this size exceeds the value specified in the macro, discards oldest unused strings from the cache automatically. The value for this macro is expressed in bytes as an integer number lying between 0 and 0x800000.

EW_MAX_SURFACE_CACHE_SIZE - This macro specifies the threshold value for the capacity of the surface cache. This cache stores often used bitmap resources and off-screen image buffers preventing them from being reloaded or recreated repeatedly. Embedded Wizard tracks the amount of memory occupied by all cached surfaces and as soon as this size exceeds the value specified in the macro, discards oldest unused surfaces from the cache automatically. The value for this macro is expressed in bytes as an integer number lying between 0 and 0x20000000.

EW_MAX_GLYPH_SURFACE_WIDTH, EW_MAX_GLYPH_SURFACE_HEIGHT - These macros specify the dimension of the glyph cache surface. This surface stores all glyphs used during text drawing operations. The larger the surface the more glyphs can be reused without needing to decompress or rasterize them again. The values for the macros are expressed in pixel as integer numbers lying between 64 and the maximum surface size supported on the graphics hardware. You should ensure, that the glyph surface is at least as large as the biggest glyph you want to display at the runtime. The following quotation can be used to calculate the approximated RAM usage resulting from the configuration of the macros: ( EW_MAX_GLYPH_SURFACE_WIDTH * EW_MAX_GLYPH_SURFACE_HEIGHT ) * 1 Byte.

EW_MAX_ISSUE_TASKS - This macro specifies the capacity of instruction buffers used to store drawing operations. Larger buffers improve the optimization and elimination of superfluous drawing operations. In turn, small buffers cause the drawing process to be often interrupted to flush the prepared operations. The value for this macro is expressed in 'tasks' as an integer number lying between 1 and 8192. You should ensure that the issue buffer is at least as large as the most complex drawing operation performed in your application. The following quotation can be used to calculate the approximated RAM usage resulting from the configuration of the macro: (( EW_MAX_ISSUE_TASKS * 64 ) + 512 ) * 1 Byte.

#define EW_MAX_STRING_CACHE_SIZE   0x4000
 
#define EW_MAX_SURFACE_CACHE_SIZE   0x800000
 
#define EW_MAX_GLYPH_SURFACE_WIDTH   256
 
#define EW_MAX_GLYPH_SURFACE_HEIGHT   256
 
#define EW_MAX_ISSUE_TASKS   8192
 
Macros Surface Cache

Following macros configure the behavior of the surface cache and treatment of bitmap resources when these are generated with in the 'compressed' mode. Depending on the configuration, the application will require more or less RAM, which affects accordingly the resulting performance.

EW_LAZY_LOAD_BITMAPS - This macro controls the loading behavior of compressed bitmap resources. If this macro is defined with the value 0, the resources are loaded immediately and completely into RAM as soon as the application accesses them. Thereupon the bitmaps remain in the surface cache (see above). If this macro is defined with the value 1, the loading of bitmaps is delayed until the application is about to display one frame of the bitmap. In such case this and only this frame is loaded into RAM.

EW_LAZY_LOAD_BITMAPS_IF_ANIMATED_ONLY - This macro, if defined with the value 1, does limit the effect of the above described macro EW_LAZY_LOAD_BITMAPS to resources containing animated bitmaps only. All other bitmaps (single or multi frame but not animated) are loaded immediately regardless of the actual value for the EW_LAZY_LOAD_BITMAPS macro. If this macro is 0, EW_LAZY_LOAD_BITMAPS affects all kinds of bitmap resources.

EW_DISCARD_BITMAPS - This macro controls the lifetime of bitmaps stored in the surface cache (see above). If this macro is configured with the value 1, the system is allowed to discard bitmap resources even if these are still in use. As soon as the surface cache has exceeded the threshold value specified in the macro EW_MAX_SURFACE_CACHE_SIZE and there is no other unused surfaces ready to discard from the cache, the system discards the lazy loaded bitmap resources. Due to this 'swapping' the application can work with significantly less RAM. If this macro is 0, the discarding affects only such surfaces which are really not in use anymore.

EW_DISCARD_BITMAPS_IF_ANIMATED_ONLY - This macro, if defined with the value 1, limits the effect of the above described macro EW_DISCARD_BITMAPS to surfaces containing animated bitmap resources only. All other bitmaps (single or multi frame but not animated) are treated as if the macro EW_DISCARD_BITMAPS were 0. If EW_DISCARD_BITMAPS_IF_ANIMATED_ONLY is 0, EW_DISCARD_BITMAPS affects all kinds of bitmap in similar manner.

EW_DISCARD_BITMAPS_IF_NOT_USED_IN_CURRENT_UPDATE - This macro, if defined with the value 1, limits the effect of the above described macro EW_DISCARD_BITMAPS to surfaces, which have not been used in actual screen update. This prevents the system from reloading one the same bitmap resource multiple times during the running screen update. If this macro is 0, EW_DISCARD_BITMAPS affects all bitmap resources in similar manner.

EW_DISCARD_BITMAPS_IF_NOT_USED_IN_RECENT_UPDATES - This macro, if defined with the value 1, limits the effect of the above described macro EW_DISCARD_BITMAPS to surfaces, which have not been used in actual and the immediately preceding screen updates. This prevents the system from reloading one the same bitmap resource multiple times during running animations. If this macro is 0, the macro EW_DISCARD_BITMAPS affects all bitmap resources in similar manner.

EW_CACHE_OFFSCREEN_SURFACES - This macro controls how to manage surfaces used to buffer off-screen contents (e.g. used by a buffered GUI component). If this macro is defined with the value 1, the off-screen surfaces are retained in the surface cache (see above). Accordingly, frequently used off-screen surfaces can be reused faster without needing to create them again. Defining the macro with the value 0 disables this function causing the off-screen surfaces to be released immediately if not needed anymore.

#define EW_LAZY_LOAD_BITMAPS   1
 
#define EW_LAZY_LOAD_BITMAPS_IF_ANIMATED_ONLY   1
 
#define EW_DISCARD_BITMAPS   1
 
#define EW_DISCARD_BITMAPS_IF_ANIMATED_ONLY   1
 
#define EW_DISCARD_BITMAPS_IF_NOT_USED_IN_CURRENT_UPDATE   0
 
#define EW_DISCARD_BITMAPS_IF_NOT_USED_IN_RECENT_UPDATES   0
 
#define EW_CACHE_OFFSCREEN_SURFACES   1
 

Detailed Description

This file contains general configuration settings for the target system, like memory ranges and display parameter and configuration settings for the Embedded Wizard Graphics Engine and Runtime Environment.

Author
Kevin Bello (k.bel.nosp@m.lo@t.nosp@m.um.de)
Version
0.1
Date
2021-04-16