Skip to content

Commit b76836c

Browse files
Cosmic183123eMUQI
andauthored
content: add ESP32-C6-Touch-AMOLED-1.8 (#6)
* content: add ESP32-C6-Touch-AMOLED-1.8 * content: update esp32-c6-touch-amoled-1.8 * content: refine ESP-IDF setup options text and fields --------- Co-authored-by: Wulu <[email protected]>
1 parent 879b876 commit b76836c

File tree

48 files changed

+1016
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1016
-0
lines changed

docs/ESP32/ESP32-C6/ESP32-C6-Touch-AMOLED-1.8/Arduino.md

Lines changed: 586 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
---
2+
sidebar_position: 3
3+
title: Working with ESP-IDF
4+
slug: /ESP32-C6-Touch-AMOLCD-1.8/Development-Environment-Setup-ESPIDF
5+
product_family:
6+
- ESP32
7+
product_model:
8+
- ESP32-C6-Touch-AMOLCD-1.8
9+
---
10+
11+
import IDF_demo1 from './images/ESP32-C6-Touch-AMOLED-1.8-demo-VS01.webp';
12+
import IDF_demo2 from './images/ESP32-C6-Touch-AMOLED-1.8-demo-VS02.webp';
13+
import IDF_demo4 from './images/ESP32-C6-Touch-AMOLED-1.8-demo-VS04.webp';
14+
import IDF_demo51 from './images/ESP32-C6-Touch-AMOLED-1.8-demo-VS51.webp';
15+
import IDF_demo52 from './images/ESP32-C6-Touch-AMOLED-1.8-demo-VS52.webp';
16+
import IDF_demo31 from './images/ESP32-C6-Touch-AMOLED-1.8-demo-VS31.webp';
17+
import IDF_demo32 from './images/ESP32-C6-Touch-AMOLED-1.8-demo-VS32.webp';
18+
import IDF_demo33 from './images/ESP32-C6-Touch-AMOLED-1.8-demo-VS33.webp';
19+
import IDF_demo34 from './images/ESP32-C6-Touch-AMOLED-1.8-demo-VS34.webp';
20+
import IDF_demo35 from './images/ESP32-C6-Touch-AMOLED-1.8-demo-VS35.webp';
21+
import IDF_demo36 from './images/ESP32-C6-Touch-AMOLED-1.8-demo-VS36.webp';
22+
23+
# Working with ESP-IDF
24+
25+
This chapter includes the following sections, please read as needed:
26+
27+
- [Setting Up Development Environment](#setting-up-development-environment)
28+
- [Demo](#demo)
29+
30+
31+
## Setting Up Development Environment
32+
33+
:::note
34+
The following environment settings are applicable to Windows 10/11 systems. For Mac/Linux users, please refer to the **[official instructions](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html)**
35+
:::
36+
37+
1. Download and install [Visual Studio Code](https://code.visualstudio.com/).
38+
39+
2. In VS Code, open the **Extensions** view by clicking the ![Extensions icon](./images/VSCode-Extension-Icon.webp) in the VS Code sidebar or using the shortcut (<kbd>Ctrl+Shift+X</kbd>). Then, search for the [ESP-IDF](https://marketplace.visualstudio.com/items?itemName=espressif.esp-idf-extension) extension and install it.
40+
41+
![Search and install ESP-IDF extension in VS Code](./images/VSCode-Install-ESP-IDF-Extension.webp)
42+
43+
3. After the extension is installed, the ![Espressif icon](./images/VSCode-ESP-IDF-Extension-Icon.webp) will appear in the activity bar on the left side of VS Code. Clicking this icon will view the basic command list for the ESP-IDF extension. Select **Configure ESP-IDF extension** under **Advanced**.
44+
45+
<!-- Alternatively, press <kbd>F1</kbd>, type `Configure ESP-IDF Extension`, and select the **ESP-IDF: Configure ESP-IDF Extension** option. -->
46+
47+
![Select "Configure ESP-IDF Expansion"](./images/VSCode-ESP-IDF-Configuration-1.webp)
48+
49+
4. Choose **Express** to enter quick configuration mode:
50+
51+
![Select Quick Configuration Mode](./images/VSCode-ESP-IDF-Configuration-2.webp)
52+
53+
5. Modify the following options as needed:
54+
55+
- **Select download server**:
56+
- Espressif: For users in China, use Espressif's China server for faster downloads.
57+
- Github: Use the official GitHub release link.
58+
- **ESP-IDF Version**: Typically, select the version required by the development board. If no specific requirement, it's recommended to use the latest stable version. For [ESP32-C6-Touch-AMOLED-1.8](https://www.waveshare.com/esp32-c6-touch-amoled-1.8.htm), it is recommended to use the Espressif IDF version ≥ v5.5.0.
59+
- **ESP-IDF Container directory**: It is recommended to use the default path, or use a path that contains only English characters and no spaces.
60+
- **ESP-IDF Required Tools directory**: It is recommended to use the default path, or use a path that contains only English characters and no spaces.
61+
62+
![ESP-IDF Extended Quick Configuration Mode Options](./images/VSCode-ESP-IDF-Configuration-3.webp)
63+
64+
6. Click **Install** to start the installation. You will see a page displaying the installation progress, including the progress status of ESP-IDF download, ESP-IDF tool download and installation, as well as the creation of the Python virtual environment.
65+
66+
![Installation Progress](./images/VSCode-ESP-IDF-Configuration-4.webp)
67+
68+
7. If everything is installed correctly, you'll get a prompt confirming all the setup is done, and you're ready to start using the extension.
69+
70+
![Installation Successful](./images/VSCode-ESP-IDF-Configuration-5.webp)
71+
72+
:::warning
73+
Note: If ESP-IDF installation fails or needs to be reinstalled, you can try deleting the `C:\Users\%Username%\esp` and `C:\Users\%Username%\.espressif` folders and then retry.
74+
:::
75+
76+
## Demo
77+
78+
The ESP-IDF demos are located in the `ESP-IDF` directory of the [demo package](https://github.com/waveshareteam/ESP32-C6-Touch-AMOLED-1.8/tree/main/examples).
79+
80+
| Demo | Basic Description |
81+
| :-------------------------------------------------------------: | :----------------------------------------------------------------------: |
82+
| [01_AXP2101](#Demo-1-AXP2101) | Drives the AXP2101 PMU using the ported XPowersLib to get power-related data |
83+
| [02_PCF85063](#Demo-2-PCF85063) | Drives the PCF85063 RTC for time storage and reading |
84+
| [03_esp_brookesia](#Demo-3-esp-brookesia) | Show a complete mobile-style UI system, including components such as the status bar, navigation bar, app launcher, and gesture interactions |
85+
| [04_QMI8658](#Demo-4-QMI8658) | Drives the QMI8658 IMU using the ported SensorLib to get gyroscope-related data |
86+
| [05_LVGL_WITH_RAM](#Demo-5-LVGL_WITH_RAM) | Run the LVGL demo by enabling double buffering and DMA acceleration to prevent tearing |
87+
88+
89+
### 01_AXP2101 {#Demo-1-AXP2101}
90+
91+
#### Demo Description
92+
93+
- This demo demonstrates porting XPowersLib in ESP-IDF, and driving AXP2101 to obtain power-related data through the ported XPowersLib
94+
95+
#### Hardware Connection
96+
97+
- Connect the development board to the computer
98+
99+
#### Code Analysis
100+
101+
- i2c_init: Initializes the I2C master to prepare for communication with other devices (like the PMU)
102+
- Configures I2C parameters, including setting the master device mode, specifying the SDA and SCL pins, enabling the pull-up resistor, and determining the clock frequency
103+
- Installs the I2C driver and apply the configuration to the actual hardware
104+
- pmu_register_read: Reads a series of bytes of data from a specific register on the PMU
105+
- Performs parameter checks to ensure the incoming parameters are valid and avoid invalid read operations
106+
- Performs I2C operations in two steps, first sends the register address to read, then reads the data. During the reading process, different processing is carried out according to the length of bytes to be read to ensure accurate reading of the data. At the same time, handles error cases in the I2C communication process and returns the corresponding status code so that the upper-layer code can determine if the read operation is successful
107+
108+
#### Expected Result
109+
110+
- This demo will not light up the screen
111+
- The serial port monitor displays the parameters: chip temperature, charging state, discharging state, standby state, Vbus connection, Vbus condition, charger status, battery voltage, Vbus voltage, system voltage, battery percentage
112+
<div style={{maxWidth:800}}> <img src={IDF_demo1}/></div>
113+
114+
### 02_PCF85063 {#Demo-2-PCF85063}
115+
116+
#### Demo Description
117+
118+
- This demo uses a simple way to drive the PCF85063 for time storage and reading functionality
119+
120+
#### Hardware Connection
121+
122+
- Connect the development board to the computer
123+
124+
#### Code Analysis
125+
126+
- i2c_master_init
127+
- Defines the I2C configuration structure conf, set the master device mode, SDA and SCL pins, pull-up resistor, and clock frequency
128+
- Uses the i2c_param_config function to configure I2C parameters. If the configuration fails, an error log is recorded and an error code is returned
129+
- Uses the i2c_driver_install function to install the I2C driver, apply the configuration to the actual hardware, and return the result
130+
- rtc_get_time
131+
- Defines a 7-byte array to store the read time data
132+
- Calls the rtc_read_reg function to read 7 bytes of time data starting from the specific register address (0x04) of the RTC chip. If the reading fails, an error log is recorded and an error code is returned
133+
- Processes the time data read, separately extract the seconds, minutes, hours, days, weeks, months, and years, and convert BCD to decimal
134+
- Uses ESP_LOGI to output the formatted current time
135+
136+
#### Expected Result
137+
138+
- This demo will not light up the screen
139+
- The serial port monitor prints time information
140+
<div style={{maxWidth:800}}> <img src={IDF_demo2}/></div>
141+
142+
### 03_esp_brookesia {#Demo-3-esp-brookesia}
143+
144+
#### Demo Description
145+
146+
- This example showcases a complete mobile-style UI system. It includes components like a status bar, navigation bar, app launcher, and gesture interactions.
147+
148+
#### Hardware Connection
149+
150+
- Connect the development board to the computer
151+
152+
#### Expected Result
153+
154+
| <div style={{maxWidth:360}}> <img src={IDF_demo31}/></div> | <div style={{maxWidth:800}}> <img src={IDF_demo32}/></div> | <div style={{maxWidth:800}}> <img src={IDF_demo33}/></div>
155+
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
156+
157+
158+
159+
### 04_QMI8658 {#Demo-4-QMI8658}
160+
161+
#### Demo Description
162+
163+
- This demo demonstrates porting SensorLib in ESP-IDF, then using the ported SensorLib to drive qmi8658 to obtain gyroscope-related data
164+
165+
#### Hardware Connection
166+
167+
- Connect the development board to the computer
168+
169+
#### Code Analysis
170+
171+
- setup_sensor: Sets up and initializes the environment and parameters required to communicate with the QMI8658 sensor
172+
- Initializes I2C communication to ensure that the connection channel to the sensor is established
173+
- Initializes the sensor, check if the sensor is properly connected
174+
- Configures the sensor's accelerometer and gyroscope parameters to meet specific application needs
175+
- Enables the sensor to start collecting data
176+
- read_sensor_data: Reads and processes data from the QMI8658 sensor in a continuous loop and outputs the results
177+
- In the loop, continuously checks if the sensor data is ready
178+
- When the data is ready, the accelerometer, gyroscope, timestamp, and temperature data are read and logged out
179+
- Handles the failure of data reading by recording an error log for troubleshooting
180+
- Controls the execution speed of the loop through delay to avoid excessive consumption of system resources
181+
182+
#### Expected Result
183+
184+
- This demo will not light up the screen
185+
- The serial port monitor prints sensor data
186+
<div style={{maxWidth:800}}> <img src={IDF_demo4}/></div>
187+
188+
### 05_LVGL_WITH_RAM {#Demo-5-LVGL_WITH_RAM}
189+
190+
#### Demo Description
191+
192+
- This example shows LVGL demo, which can run LVGL demo by enabling dual caching, enabling DMA acceleration and anti-tearing, etc. to run dynamic graphics and texts smoothly, achieving a frame rate of 200-300 FPS
193+
194+
#### Hardware Connection
195+
196+
- Connect the development board to the computer
197+
198+
#### Code Analysis
199+
200+
- app_main: The initialization and startup process of the entire application
201+
- Hardware initialization: Configures and initializes hardware devices related to LCD display and touch input (if available), such as GPIO pins, SPI bus, I2C bus, LCD panel driver, and touch controller driver, etc.
202+
- LVGL initialization: Initializes the LVGL library, allocates drawing buffers, registers display driver and touch input device driver (if available), installs timers, and creates smutexes and starts LVGL tasks
203+
- Example display: Finally shows LVGL examples, such as widget examples, etc.
204+
- example_lvgl_port_task: LVGL task function, responsible for handling LVGL regular updates and task delay control, ensuring the smooth operation of the LVGL interface
205+
- Timed update: In its loop, it grabs a mutex lock and calls the lv_timer_handler to handle the LVGL timer event, which updates the UI state
206+
- Delay control: Determine the task's delay time based on the results of timer processing to avoid excessive CPU resource usage and ensure timely response to LVGL events
207+
208+
#### Expected Result
209+
210+
| <div style={{maxWidth:800}}> <img src={IDF_demo51}/></div> | <div style={{maxWidth:800}}> <img src={IDF_demo52}/></div>
211+
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
sidebar_position: 5
3+
title: Product FAQ
4+
slug: /ESP32-C6-Touch-AMOLCD-1.8/FAQ
5+
product_family:
6+
- ESP32
7+
product_model:
8+
- ESP32-C6-Touch-AMOLCD-1.8
9+
---
10+
11+
import Details from '@theme/Details';
12+
13+
# FAQ
14+
15+
<Details summary=" Q: How to get more library support for the demo?" className="faq-details" open>
16+
A: You can subscribe to this repository and raise an issue to describe your requirements. The engineers will assess your request as soon as possible: [ESP32-display-support](https://github.com/waveshareteam/ESP32-display-support/tree/master)
17+
</Details>
18+
19+
<Details summary=" Q: The board is getting too hot. What is the reason and how do I fix it? " className="faq-details" open>
20+
1. If you find the board getting hot, first ensure the buzzer enable pin is pulled low. Otherwise, the passive buzzer will continuously consume power, putting a high current load on the LDO and causing it to overheat
21+
2. If you are also using WiFi/Bluetooth features, overheating cannot be avoided. Enabling the wireless function on the ESP32-S3 will increase the power consumption, leading to overheating
22+
3. In the Arduino IDE environment, enabling PSRAM, using external Flash, and pulling the buzzer enable pin low can still generate significant heat. It is recommended to use low-power solutions
23+
</Details>
24+
25+
<Details summary=" Q: Why does the flashing fail?" className="faq-details" open>
26+
1. When the serial port is occupied, the flashing will fail. Close the serial port monitor and try to flash again
27+
2. When the ESP32 program crashes, the flashing will fail. In this case, you need to completely power off the development module, hold down BOOT button and power it on again to enter the forced download mode and then flash it. It will not automatically exit the download mode after flashing, so you need to power off and restart again
28+
</Details>
29+
30+
<Details summary=" Q: How can I check which COM port I am using?" className="faq-details" open>
31+
**Windows System**:
32+
33+
1. Through Device Manager: Press the Windows + R keys to open the "Run" dialog box; input devmgmt.msc and press Enter to open the Device Manager; expand the "Ports (COM and LPT)" section, where all COM ports and their current statuses will be listed.
34+
2. Using Command Prompt: Open the Command Prompt (CMD), enter the mode command, which will display status information for all COM ports.
35+
3. Check the hardware connection: If you have already connected an external device to the COM port, the device usually occupies a port number, which can be determined by checking the connected hardware.
36+
37+
**Linux System**:
38+
39+
1. Use the `dmesg` command: Open the terminal.
40+
2. Use the `ls` command: Enter `ls /dev/ttyS*` or `ls /dev/ttyUSB*` to list all serial port devices.
41+
3. Use the `setserial` command: Enter `setserial -g /dev/ttyS*` to view the configuration information of all serial port devices.
42+
</Details>
43+
44+
<Details summary=" Q: How to port the provided lib libraries? Or how to develop my own LCD screen? How to drive?" className="faq-details" open>
45+
The LCD screen display chip used in this product is ST7789V2, and the touch chip is CST816T (for touch version only). There are two chip drivers in the lib we provide. For display drivers, please refer to GFX enable. For touch drivers, please refer to Arduino_LVGL demo
46+
</Details>
47+
48+
<Details summary=" Q: Why is there no output even though the code is correct and flashed successfully?" className="faq-details" open>
49+
- Check the schematic diagram: Depending on the Type-C interface of your specific development board, the code handling the output differs:
50+
- For boards with a direct USB connection, they support output via the printf function. To support output via the Serial function, you need to enable the USB CDC On Boot feature or declare HWCDC
51+
- For boards with a UART-to-USB connection, they support output via both printf and Serial functions, and there is no need to enable USB CDC On Boot
52+
</Details>
53+
54+
<Details summary=" Q: How to use SquareLine Studio to design interfaces?" className="faq-details" open>
55+
Please refer to **[SquareLine Studio Tutorial](https://www.waveshare.com/wiki/Waveshare_SquareLine_Studio)**.
56+
</Details>

0 commit comments

Comments
 (0)