diff options
| author | jpe230 <pablin.123.ra@gmail.com> | 2022-12-12 14:51:14 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-13 07:51:14 +1100 |
| commit | 102f22f7e99d87989cd95e10370863c3f96ba7e2 (patch) | |
| tree | 1b7b27838e01f547714b19932c98e58362354bb8 /docs/quantum_painter_lvgl.md | |
| parent | 2d19e59d784582cd2e3768ff4e7f7e0c4618eb2f (diff) | |
[Core] Quantum Painter - LVGL Integration (#18499)
Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'docs/quantum_painter_lvgl.md')
| -rw-r--r-- | docs/quantum_painter_lvgl.md | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/docs/quantum_painter_lvgl.md b/docs/quantum_painter_lvgl.md new file mode 100644 index 0000000000..3edb37fbce --- /dev/null +++ b/docs/quantum_painter_lvgl.md | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | # Quantum Painter LVGL Integration :id=lvgl | ||
| 2 | |||
| 3 | LVGL (Light and Versatile Graphics Library) is an open-source graphics library providing everything you need to create an embedded GUI for your board with easy-to-use graphical elements. | ||
| 4 | |||
| 5 | LVGL integrates with [Quantum Painter's](quantum_painter.md) API and drivers to render to the display, the hardware supported by Quantum Painter is also supported by LVGL. | ||
| 6 | |||
| 7 | ?> Keep in mind that enabling the LVGL integration has a big impact in firmware size, it is recommeded to use a supported MCU with >256 kB of flash space. | ||
| 8 | |||
| 9 | To learn more about LVGL and how to use it please take a look at their [official documentation](https://docs.lvgl.io/8.2/intro/) | ||
| 10 | |||
| 11 | ## Enabling LVGL :id=lvgl-enabling | ||
| 12 | To enable LVGL to be built into your firmware, add the following to `rules.mk`: | ||
| 13 | |||
| 14 | ```make | ||
| 15 | QUANTUM_PAINTER_ENABLE = yes | ||
| 16 | QUANTUM_PAINTER_DRIVERS = ...... | ||
| 17 | QUANTUM_PAINTER_LVGL_INTEGRATION = yes | ||
| 18 | ``` | ||
| 19 | To configure the Quantum Painter Display Drivers please read the [Quantum Painter Display Drivers](quantum_painter.md#quantum-painter-drivers) section. | ||
| 20 | |||
| 21 | ## Quantum Painter LVGL API :id=lvgl-api | ||
| 22 | |||
| 23 | ### Quantum Painter LVGL Attach :id=lvgl-api-init | ||
| 24 | |||
| 25 | ```c | ||
| 26 | bool qp_lvgl_attach(painter_device_t device); | ||
| 27 | ``` | ||
| 28 | |||
| 29 | The `qp_lvgl_attach` function is used to set up LVGL with the supplied display, and requires an already configured display. | ||
| 30 | |||
| 31 | ```c | ||
| 32 | static painter_device_t display; | ||
| 33 | void keyboard_post_init_kb(void) { | ||
| 34 | display = qp_make_.......; // Create the display | ||
| 35 | qp_init(display, QP_ROTATION_0); // Initialise the display | ||
| 36 | |||
| 37 | if (qp_lvgl_attach(display)) { // Attach LVGL to the display | ||
| 38 | ...Your code to draw // Run LVGL specific code to draw | ||
| 39 | } | ||
| 40 | } | ||
| 41 | ``` | ||
| 42 | To init. the display please read the [Display Initialisation](quantum_painter.md#quantum-painter-api-init) section. | ||
| 43 | |||
| 44 | !> Attaching LVGL to a display means LVGL subsequently "owns" the display. Using standard Quantum Painter drawing operations with the display after LVGL attachment will likely result in display artifacts. | ||
| 45 | ### Quantum Painter LVGL Detach :id=lvgl-api-init | ||
| 46 | |||
| 47 | ```c | ||
| 48 | void qp_lvgl_detach() | ||
| 49 | ``` | ||
| 50 | |||
| 51 | The `qp_lvgl_detach` function stops the internal LVGL ticks and releases resources related to it. | ||
| 52 | |||
| 53 | ## Enabling/Disabling LVGL features :id=lvgl-configuring | ||
| 54 | |||
| 55 | You can overwrite LVGL specific features in your `lv_conf.h` file. | ||
