Extend the Vyper touch screen software for better functionality.
Please find official releases in the Releases section.
The following sections are from the original Creality Community Edition 6.1 readme, not all is pertinent to the Vyper but is useful to read to understand how to modify the firmware and help in progressing the display features. Points to note are:
We are open for contributions. Please open an issue in the issue tracker first before you start work on a pull request.
The reason for this is that the DWIN project is not friendly for source control and any files cannot be merged (all binary). So, using our Discord server, we synchronize who is working on the files to prevent conflicts.
Internationalization support in DGUS DWIN is very cumbersome. The background images of each page has the text hardcoded. To translate and have it first-class, you would need to duplicate all the bmps, give it a separate ID, and maintain that mapping in firmware as well or make every label an icon, which is a lot of work. The development team has no capacity to maintain localizations.
If you like to translate the user interface to your own language, you must fork this repository and maintain your own version of the touch screen firmware.
The complete workflow would look like this:
Good luck, and if you maintain your own translated firmware, please let us know!
You need the [DGUS v8.0.x software] (included in tool folder) for editing the touch screen.
You can open the .dgus project file in the src\DWIN
folder:
To build a firmware archive for distribution, use the build.cmd
script. It will do a sanity check and then zip the files to the build
folder.
For development you can run the build script as follows:
.\build -Deploy Q:
Where Q: is the path of your flash drive with the SD card.
You need to have Powershell Core installed (pwsh).
You can find the source files where the screen bitmaps are generated from in the src\images_src
folder.
To update the BMP of a screen put the generated BMP file you made with your image editor in the src\DWIN\DWIN_SOURCE
folder.
It will be picked up automatically by the build process of DWIN when saving or generating the project. However, the ICL file is what actually gets flashed. This is essentially a dictionary of concatenated compressed JFIF files.
Next, re-generate the 23_Screen.icl
ICL file are follows:
Things worthy of note:
DWIN_SOURCE
is used as a source for generating the ICL.DWIN_SOURCE
folder, once in the DWIN_SET
folder.As you can note, you update it in both DWIN_SET
and DWIN_SOURCE
. The first is what goes to the touch screen, the latter is what the DWIN editor uses (apparently).
For icon ICL generation the process is the same, except that you pick the icons from a subdirectory of DWIN_SOURCE
.
DWIN uses a specific set-up of the flash space as described in the manual - as shown below.
Essentially what it boils down to:
So with the above in mind one must take care to make sure files do not overlap. When you flash everything to the touch screen you must ensure you've deleted the old (renumbered) ICL files from your SD card, otherwise weird things will happen. Background may go missing, etc.
During build a script will run to make sure no sectors have been overallocated. You can also run this script manually.
In the currently - cleaned up - source code of the touch screen handling in Marlin, the events of the touch screen are handled as described below. This may change in the future. This picture says it all:
For buttons:
src/lcd/extui/dgus_creality/creality_touch/DGUSDisplayDef.h
src/lcd/extui/dgus_creality/creality_touch/DGUSDisplayDef.cpp
in the ListOfVP
the Virtual Pointer are connected to a callback handlerDGUSCrealityDisplay_HandleReturnKeyEvent
src/lcd/extui/dgus_creality/creality_touch/PageHandlers.cpp
buttonValue
For dynamic updatable values:
idle
loopsrc/lcd/extui/dgus_creality/creality_touch/DGUSDisplayDef.h
src/lcd/extui/dgus_creality/creality_touch/DGUSDisplayDef.cpp
:
ListOfVP
, with:
nullptr
)VPList
for the current page as referenced in VPMap
. This is to optimize that we don't update VPs that are not displayed anyway.ListOfVP
If you like to see how the touch screen code is handled in the Creality firmware and the original Community Firmware release 3 and lower, please check the cf3-legacy branch. This branch is no longer maintained and only exists for historical purposes.
The touch screen configuration file "T5LCFG_272480.CFG" has its specification describer in T5L_DGUSII Application Development Guide20200902.pdf chapter 4. You can use an editor like HxD to explore and edit it (with caution!). The DWIN editor also has a way to edit this file. Many parameters can also be set at runtime.
Font's are currently configured like below:
In the same folder where you have the DWIN tool unpacked a 0_DWIN_ASC.HZK
file is placed. You need to copy that to the DWIN_SET folder, and can flash it directly.
The kerning of the current font is not ideal (especially using numbers that are small, like "1"), so perhaps we should look for a replacement.
Vendor documentation is mirrored to the doc/vendor folder.
In addition, this is a nice resource.
Icons from Font Awesome, Remix Icon and Anycubic Press Media.
Font from Google Fonts and customized with FontForge -> B612 Mono-CR6