Skip to content

Commit 7137c2b

Browse files
committed
Merge branch 'feat/add_usb_extend_lcd' into 'master'
feat: add usb extend screen See merge request ae_group/esp-iot-solution!1058
2 parents da0f0f4 + 4a45eee commit 7137c2b

File tree

84 files changed

+9161
-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.

84 files changed

+9161
-0
lines changed

.gitlab/ci/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,14 @@ build_example_usb_device_usb_dual_uvc_device:
658658
variables:
659659
EXAMPLE_DIR: examples/usb/device/usb_dual_uvc_device
660660

661+
build_example_usb_device_usb_extend_screen:
662+
extends:
663+
- .build_examples_template
664+
- .rules:build:example_usb_device_usb_extend_screen
665+
variables:
666+
EXAMPLE_DIR: examples/usb/device/usb_extend_screen
667+
IMAGE: espressif/idf:release-v5.3
668+
661669
build_example_usb_device_usb_webcam:
662670
extends:
663671
- .build_examples_template

.gitlab/ci/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ pack-upload_files:
9696
- job: "build_example_usb_host_usb_camera_mic_spk: [espressif/idf:release-v5.1]"
9797
- job: "build_example_usb_host_usb_cdc_4g_module: [espressif/idf:release-v5.1]"
9898
- job: "build_example_usb_host_usb_cdc_basic: [espressif/idf:release-v5.1]"
99+
- job: "build_example_usb_device_usb_extend_screen"
99100
artifacts:
100101
when: always
101102
paths:

.gitlab/ci/rules.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@
502502
.patterns-example_usb_device_usb_dual_uvc_device: &patterns-example_usb_device_usb_dual_uvc_device
503503
- "examples/usb/device/usb_dual_uvc_device/**/*"
504504

505+
.patterns-example_usb_device_usb_extend_screen: &patterns-example_usb_device_usb_extend_screen
506+
- "examples/usb/device/usb_extend_screen/**/*"
507+
505508
.patterns-example_usb_device_usb_webcam: &patterns-example_usb_device_usb_webcam
506509
- "examples/usb/device/usb_webcam/**/*"
507510

@@ -1225,6 +1228,16 @@
12251228
- <<: *if-dev-push
12261229
changes: *patterns-components_avi_player
12271230

1231+
.rules:build:example_usb_device_usb_extend_screen:
1232+
rules:
1233+
- <<: *if-protected
1234+
- <<: *if-label-build
1235+
- <<: *if-trigger-job
1236+
- <<: *if-dev-push
1237+
changes: *patterns-build_system
1238+
- <<: *if-dev-push
1239+
changes: *patterns-example_usb_device_usb_extend_screen
1240+
12281241
.rules:build:example_usb_device_usb_webcam:
12291242
rules:
12301243
- <<: *if-protected

examples/.build-rules.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ examples/usb/device/usb_webcam:
258258
enable:
259259
- if: IDF_TARGET in ["esp32s3","esp32s2"]
260260

261+
examples/usb/device/usb_extend_screen:
262+
enable:
263+
- if: IDF_TARGET in ["esp32p4"]
264+
261265
examples/usb/device/usb_hid_device:
262266
enable:
263267
- if: IDF_TARGET in ["esp32s2","esp32s3"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# The following five lines of boilerplate have to be in your project's
2+
# CMakeLists in this exact order for cmake to work correctly
3+
cmake_minimum_required(VERSION 3.16)
4+
5+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
6+
add_compile_options(-Wno-ignored-qualifiers)
7+
project(usb_touch_screen)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
## USB Extension Screen Example
2+
3+
Try with [LaunchPad](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://dl.espressif.com/AE/esp-iot-solution/config.toml)
4+
5+
The USB Extension Screen Example allows the P4 development board to be used as an additional screen for Windows. It supports the following features:
6+
7+
* Supports a screen refresh rate of 1024*600@60FPS
8+
* Supports up to five touch points
9+
* Supports audio input and output
10+
11+
## Required Hardware
12+
13+
* Development Board
14+
1. [ESP32-P4-Function-EV-Board](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32p4/esp32-p4-function-ev-board/user_guide.html#getting-started) development board
15+
2. A 1024*600 MIPI screen from the development kit
16+
3. A speaker
17+
18+
* Connections
19+
1. Connect the high-speed USB port on the development board to the PC
20+
21+
## Compilation and Flashing
22+
23+
### P4 Device Side
24+
25+
Build the project and flash it to the board, then run the monitor tool to view serial output:
26+
27+
* Run `. ./export.sh` to set up the IDF environment
28+
* Run `idf.py set-target esp32p4` to set the target chip
29+
* If there are any errors in the previous step, run `pip install "idf-component-manager~=1.1.4"` to upgrade your component manager
30+
* Run `idf.py -p PORT flash monitor` to build, flash, and monitor the project
31+
32+
(To exit the serial monitor, press `Ctrl-]`.)
33+
34+
Refer to the Getting Started Guide for all steps to configure and use ESP-IDF to build projects.
35+
36+
> Note: This example will fetch an AVI file online. Ensure that you are connected to the internet during the initial compilation.
37+
38+
### PC Side
39+
40+
For preparation, refer to the [windows_driver](./windows_driver/README.md)
41+
42+
![Demo](https://dl.espressif.com/AE/esp-iot-solution/p4_usb_extern_screen.gif)
43+
44+
## Other Issues
45+
46+
### Touch Screen Does Not Control the P4 Screen
47+
48+
* In the Control Panel, select `Tablet PC Settings`
49+
* In the configuration section, select `Setup`
50+
* Follow the prompts to choose the P4 extension screen
51+
52+
### Adjusting JPEG Image Quality
53+
54+
* Modify the `string_desc_arr` vendor interface string in the `usb_descriptor.c` file. Change `Ejpg4` to the desired image quality level; the higher the number, the better the quality, but it will use more memory for the same frame.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
## USB 扩展屏示例
2+
3+
使用 [LaunchPad](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://dl.espressif.com/AE/esp-iot-solution/config.toml) 烧录该示例
4+
5+
USB 扩展屏示例可以将 P4 开发板作为一块 windows 的副屏。支持以下功能。
6+
7+
* 支持 1024*600@60FPS 的屏幕刷新速率
8+
9+
* 支持最多五点的屏幕触摸
10+
11+
* 支持音频的输入和输出
12+
13+
## 所需硬件
14+
15+
* 开发板
16+
17+
1. [ESP32-P4-Function-EV-Board](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32p4/esp32-p4-function-ev-board/user_guide.html#getting-started) 开发板
18+
2. 开发套件中的一块 1024*600 的 MIPI 屏幕
19+
3. 一个扬声器
20+
21+
* 连接
22+
23+
1. 将开发板上的高速 USB 口连接到 PC 上
24+
25+
## 编译和烧录
26+
27+
### P4 设备端
28+
29+
构建项目并将其烧录到板子上,然后运行监控工具以查看串行输出:
30+
31+
* 运行 `. ./export.sh` 以设置 IDF 环境
32+
* 运行 `idf.py set-target esp32p4` 以设置目标芯片
33+
* 如果上一步出现任何错误,请运行 `pip install "idf-component-manager~=1.1.4"` 来升级你的组件管理器
34+
* 运行 `idf.py -p PORT flash monitor` 来构建、烧录并监控项目
35+
36+
(要退出串行监视器,请按 `Ctrl-]`。)
37+
38+
请参阅《入门指南》了解配置和使用 ESP-IDF 构建项目的所有步骤。
39+
40+
>> 注意:此示例将在线获取 AVI 文件。请确保首次编译时连接互联网。
41+
42+
### PC 端
43+
44+
准备工作,请参考 [windows_driver](./windows_driver/README_cn.md)
45+
46+
![Demo](https://dl.espressif.com/AE/esp-iot-solution/p4_usb_extern_screen.gif)
47+
48+
## 其他问题
49+
50+
### 触摸屏控制的不是 P4 的屏幕
51+
52+
* 在控制面板中选择 `平板电脑设置`
53+
54+
* 在配置栏中选择 `设置`
55+
56+
* 按照提示选择 P4 扩展屏
57+
58+
### 调高/调低 JPEG 的图片质量
59+
60+
* 修改 `usb_descriptor.c` 文件中的 `string_desc_arr` Vendor 接口字符串,将 `Ejpg4` 修改为所需的图片质量,数字越大质量越高,同样的一帧图像占用内存更多。
70.3 KB
Loading
18.1 KB
Loading
13.8 KB
Loading

0 commit comments

Comments
 (0)