Skip to content

Develop into main #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f90fe30
Minor fix: add != NULL
rzeldent Sep 4, 2024
1fe2870
Fixed typo in log
rzeldent Sep 14, 2024
08d0ce2
Merge pull request #201 from rzeldent:200-enhancement-for-pwmd-rgb-led
rzeldent Sep 14, 2024
596e2ea
Pinned LVGL version to 9.2.0 (exact)
rzeldent Oct 28, 2024
48487b1
Changed the order of enabling interrupts (#196)
rzeldent Oct 30, 2024
070458a
Remove sw_rotate (#210)
rzeldent Oct 30, 2024
8755372
Lvgl9.2.2 (#211)
rzeldent Nov 1, 2024
9d56cbf
Update boards to develop
rzeldent Nov 1, 2024
d056037
Merge branch 'develop' of https://github.com/rzeldent/esp32-smartdisp…
rzeldent Nov 1, 2024
a6cd21c
Added check for rst_gpio_num == GPIO_NUM_NC (#215)
rzeldent Nov 7, 2024
61c81e7
Boards to develop
rzeldent Nov 8, 2024
1814cae
Updated boards
rzeldent Dec 26, 2024
c00072a
Merge branch 'main' into develop
rzeldent Dec 26, 2024
07ea21c
JC3248W535N
rzeldent Dec 27, 2024
49f7208
Removed _IO_NUM and GPIO_NUM
rzeldent Dec 27, 2024
b2e2fc2
Dependabot github-actions
rzeldent Dec 29, 2024
9709ca0
Updated md
Jan 18, 2025
139ec25
Added TOC
Jan 18, 2025
251a92a
Updated TOC
rzeldent Jan 18, 2025
5ac1653
md
rzeldent Jan 18, 2025
f024a7d
Merge branch 'main' into develop
rzeldent Jan 25, 2025
37a40fc
Boards updated
rzeldent Jan 25, 2025
a305459
Update boards
rzeldent Feb 8, 2025
8e9148f
Added s3-touch-lcd-4p3
rzeldent Jun 9, 2025
6db6ebf
esp32-s3-touch-lcd-4p3
rzeldent Jun 9, 2025
293b15e
esp32-s3-touch-lcd-4p3
rzeldent Jun 9, 2025
9287943
Removed GPIO in naming
rzeldent Jun 10, 2025
e83703e
Updated platformio
rzeldent Jun 10, 2025
0be1d4d
removed semicolumn
rzeldent Jun 10, 2025
8ddd0c6
Removed quotes LV_CONF_PATH
rzeldent Jun 10, 2025
450a221
Added quotes
rzeldent Jun 10, 2025
3e51240
version 2.1.1
rzeldent Jun 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,39 @@
[![Platform IO CI](https://github.com/rzeldent/esp32-smartdisplay/actions/workflows/main.yml/badge.svg)](https://github.com/rzeldent/esp32-smartdisplay/actions/workflows/main.yml)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/rzeldent/library/esp32_smartdisplay.svg)](https://registry.platformio.org/libraries/rzeldent/esp32_smartdisplay)

## Table of Contents

- [LVGL drivers for Chinese Sunton Smart display boards, aka CYD (Cheap Yellow Display)](#lvgl-drivers-for-chinese-sunton-smart-display-boards-aka-cyd-cheap-yellow-display)
- [Table of Contents](#table-of-contents)
- [Supported boards](#supported-boards)
- [Why this library](#why-this-library)
- [Dependencies](#dependencies)
- [How to use](#how-to-use)
- [Step 1: Download (or open) PlatformIO](#step-1-download-or-open-platformio)
- [Step 2: Boards definitions](#step-2-boards-definitions)
- [Step 3: Create a new project](#step-3-create-a-new-project)
- [Step 4: Add this library to your project](#step-4-add-this-library-to-your-project)
- [Step 5: Create a settings file for LVGL](#step-5-create-a-settings-file-for-lvgl)
- [Step 6: Copy the build flags below in your project](#step-6-copy-the-build-flags-below-in-your-project)
- [Step 7: Initialize the display (and touch) in your project](#step-7-initialize-the-display-and-touch-in-your-project)
- [Step 8 (Optional): Create your LVGL file or use SquareLine Studio to make a design](#step-8-optional-create-your-lvgl-file-or-use-squareline-studio-to-make-a-design)
- [Step 9: Compile, upload and enjoy](#step-9-compile-upload-and-enjoy)
- [Porting from LVGL 8.3.9](#porting-from-lvgl-839)
- [lv\_conf.h](#lv_confh)
- [Ticker](#ticker)
- [More on lv\_conf.h](#more-on-lv_confh)
- [LVGL initialization Functions](#lvgl-initialization-functions)
- [void smartdisplay\_init()](#void-smartdisplay_init)
- [void smartdisplay\_lcd\_set\_backlight(float duty)](#void-smartdisplay_lcd_set_backlightfloat-duty)
- [void smartdisplay\_lcd\_set\_brightness\_cb(smartdisplay\_lcd\_adaptive\_brightness\_cb\_t cb, uint interval)](#void-smartdisplay_lcd_set_brightness_cbsmartdisplay_lcd_adaptive_brightness_cb_t-cb-uint-interval)
- [void smartdisplay\_led\_set\_rgb(bool r, bool g, bool b)](#void-smartdisplay_led_set_rgbbool-r-bool-g-bool-b)
- [touch\_calibration\_data\_t touch\_calibration\_data](#touch_calibration_data_t-touch_calibration_data)
- [touch\_calibration\_data\_t smartdisplay\_compute\_touch\_calibration(const lv\_point\_t screen\[3\], const lv\_point\_t touch\[3\])](#touch_calibration_data_t-smartdisplay_compute_touch_calibrationconst-lv_point_t-screen3-const-lv_point_t-touch3)
- [Rotation of the display and touch](#rotation-of-the-display-and-touch)
- [Appendix: Template to support ALL the boards](#appendix-template-to-support-all-the-boards)
- [Appendix: External dependencies](#appendix-external-dependencies)
- [Version history](#version-history)

## Supported boards

These Sunton boards have an LCD display and most of them have a touch interface.
Expand Down Expand Up @@ -51,7 +84,7 @@ This library depends on:
- [platformio-espressif32-sunton](https://github.com/rzeldent/platformio-espressif32-sunton)

> [!NOTE]
> This library uses the newly introduced esp_lcd_panel interfaces. This should provide some support in the future for updates and new boards. These drivers are provided by Espressid and have already been copied and included to this library.
> This library uses the newly introduced esp_lcd_panel interfaces. This should provide some support in the future for updates and new boards. These drivers are provided by Espressif and have already been copied and included to this library.

## How to use

Expand Down Expand Up @@ -84,7 +117,14 @@ Make sure you have PlatformIO installed and functional. Follow the documentation

The board definitions required for this library are defined in the boards library [platformio-espressif32-sunton](https://github.com/rzeldent/platformio-espressif32-sunton). This library must reside in the `<project>/boards` directory so PlatformIo will automatically recognize these boards.

**It is recommended to use `git submodule` to include these board definitions automatically.**
**It is recommended to use `git clone --recurse-submodules` to include these board definitions automatically.**

In case the repository was opened without the submodules, the submodules need to be initialized and updated. To do this type at the command prompt:

```bash
git submodule init
git submodule update
```

> [!TIP]
> If you already have a project, clone it with the `git clone --recurse-submodules`. If creating a new project, use `git submodule add https://github.com/rzeldent/platformio-espressif32-sunton.git boards` to add them to your project as a submodule.
Expand Down Expand Up @@ -352,7 +392,7 @@ This function can be called to periodically call a user defined function to set
The callback function must have the following format:

```cpp
float smartdisplay_lcd_adaptive_brightness_function)()
float smartdisplay_lcd_adaptive_brightness_function()
{
...
return <float[0,1]>
Expand Down Expand Up @@ -600,6 +640,10 @@ The following libraries are used from the [Espressif component registry](https:/

## Version history

- June 2025
- Version 2.1.1
- Updated documentation
- Renamed IO pins
- November 2024
- Version 2.1.0
- LVGL 9.2.2
Expand Down
22 changes: 22 additions & 0 deletions include/esp_panel_axs15231b.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include <esp_lcd.h>
#include <esp_lcd_types.h>
#include <esp_lcd_panel_vendor.h>

#ifdef __cplusplus
extern "C"
{
#endif

typedef struct
{
const lcd_init_cmd_t *init_cmds;
uint16_t init_cmds_size;
} axs15231b_vendor_config_t;

esp_err_t esp_lcd_new_panel_axs15231b(const esp_lcd_panel_io_handle_t io, const esp_lcd_panel_dev_config_t *config, esp_lcd_panel_handle_t *handle);

#ifdef __cplusplus
}
#endif
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/schema/library.json",
"name": "esp32_smartdisplay",
"version": "2.1.0",
"version": "2.1.1",
"description": "LVGL v9.2.2 driver for Sunton ESP32 Cheap Yellow Display display boards",
"keywords": "LVGL Sunton CYD LCD TFT Touch",
"repository": {
Expand Down
29 changes: 21 additions & 8 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@
#default_envs = esp32-8048S043R
#default_envs = esp32-8048S050C
#default_envs = esp32-8048S050N
#default_envs = esp32-8048S050R
#default_envs = esp32-8048S050R
#default_envs = esp32-8048S070C
#default_envs = esp32-8048S070N
#default_envs = esp32-8048S070R
#default_envs = esp32-s3touchlcd7
#default_envs = esp32-2432W328C
#default_envs = esp32-8048S550C
#default_envs = esp32-s3touchlcd7
#default_envs = esp32-s3touchlcd4p3
#default_envs = JC2432W328C
#default_envs = JC3248W535N
#default_envs = JC8048W550C


[env]
platform = espressif32
Expand All @@ -53,7 +57,7 @@ build_flags =
-Wall
'-D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE'
# LVGL settings
'-D LV_CONF_PATH=${platformio.test_dir}/lv_conf.h'
'-D LV_CONF_PATH="${platformio.test_dir}/lv_conf.h"'
'-D ESP_LCD_PANEL_IO_ADDITIONS_VER_MAJOR=1'
'-D ESP_LCD_PANEL_IO_ADDITIONS_VER_MINOR=0'
'-D ESP_LCD_PANEL_IO_ADDITIONS_VER_PATCH=1'
Expand Down Expand Up @@ -157,11 +161,20 @@ board = esp32-8048S070N
[env:esp32-8048S070R]
board = esp32-8048S070R

[env:esp32-8048S550C]
board = esp32-8048S550C

[env:esp32-s3touchlcd7]
board = esp32-s3touchlcd7

[env:esp32-2432W328C]
board = esp32-2432W328C
[env:esp32-s3touchlcd4p3]
board = esp32-s3touchlcd4p3

[env:esp32-8048S550C]
board = esp32-8048S550C
[env:JC2432W328C]
board = JC2432W328C

[env:JC3248W535N]
board = JC3248W535N

[env:JC8048W550C]
board = JC8048W550C
10 changes: 5 additions & 5 deletions src/esp32_smartdisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void smartdisplay_lcd_set_backlight(float duty)
if (duty < 0.0f)
duty = 0.0f;
#if ESP_ARDUINO_VERSION_MAJOR >= 3
ledcWrite(GPIO_BCKL, duty * PWM_MAX_BCKL);
ledcWrite(DISPLAY_BCKL, duty * PWM_MAX_BCKL);
#else
ledcWrite(PWM_CHANNEL_BCKL, duty * PWM_MAX_BCKL);
#endif
Expand Down Expand Up @@ -183,13 +183,13 @@ void smartdisplay_init()

lv_init();
// Setup backlight
pinMode(GPIO_BCKL, OUTPUT);
digitalWrite(GPIO_BCKL, LOW);
pinMode(DISPLAY_BCKL, OUTPUT);
digitalWrite(DISPLAY_BCKL, LOW);
#if ESP_ARDUINO_VERSION_MAJOR >= 3
ledcAttach(GPIO_BCKL, PWM_FREQ_BCKL, PWM_BITS_BCKL);
ledcAttach(DISPLAY_BCKL, PWM_FREQ_BCKL, PWM_BITS_BCKL);
#else
ledcSetup(PWM_CHANNEL_BCKL, PWM_FREQ_BCKL, PWM_BITS_BCKL);
ledcAttachPin(GPIO_BCKL, PWM_CHANNEL_BCKL);
ledcAttachPin(DISPLAY_BCKL, PWM_CHANNEL_BCKL);
#endif
// Setup TFT display
display = lvgl_lcd_init();
Expand Down
Loading