USB-Screen
USB-Screen copied to clipboard
USB屏幕&编辑器
USB Screen
USB屏幕&编辑器
图文教程:
https://zhuanlan.zhihu.com/p/698789562
视频教程
https://www.bilibili.com/video/BV1eTTwe6EFU/?vd_source=a2700de3db7bd5f0117df32bdd5cef9f
硬件
支持的屏幕型号
目前支持 ST7735 128x160 和 ST7789 320x240两种屏幕
ST7735接线方式
GND <=> GND
VCC <=> 3V3
SCL <=> SCLK(GPIO6)
SDA <=> MOSI(GPIO7)
RES <=> RST(GPIO14)
DC <=> DC(GPIO13)
CS <=> GND
BLK <=> 不连接

ST7789接线方式
GND <=> GND
VCC <=> 3V3
SCL <=> PIN6(clk)
SDA <=> PIN7(mosi)
RESET <=> PIN14(rst)
AO <=> PIN13
CS <=> PIN9
BL <=> 5V

ST7789 240x240 接线方式
GND <=> GND
VCC <=> 3V3
SCL <=> PIN6(clk)
SDA <=> PIN7(mosi)
RESET <=> PIN14(rst)
DC <=> PIN13
CS <=> PIN9
BL <=> 5V
固件源码
https://github.com/planet0104/rp2040_usb_screen
接线方式
编译
编译aarch64-linux
1、设置default features,启用 v4l-webcam
[features]
default = ["v4l-webcam", "usb-serial"]
2、启动 DockerDesktop
3、进入 wsl2 Ubuntu
4、安装 cross
cargo install cross --git https://github.com/cross-rs/cross
5、编译
注意 Cross.toml 中的配置
# rustup component add rust-src --toolchain nightly
RUSTFLAGS="-Zlocation-detail=none" cross +nightly build -Z build-std=std,panic_abort \
-Z build-std-features=panic_immediate_abort \
-Z build-std-features="optimize_for_size" \
--target aarch64-unknown-linux-gnu --release
运行编辑器
windows中运行
设置 deault features
[features]
default = ["editor", "tray", "nokhwa-webcam"]
./run.cmd
Ubuntu中运行
设置 deault features
[features]
default = ["editor", "v4l-webcam"]
# export https_proxy=http://192.168.1.25:6003;export http_proxy=http://192.168.1.25:6003;export all_proxy=socks5://192.168.1.25:6003
# export https_proxy=;export http_proxy=;export all_proxy=;
sudo apt-get install -y libclang-dev libv4l-dev libudev-dev
sh run.sh
# sudo ./target/debug/USB-Screen
# sudo ./target/debug/USB-Screen editor
## v4l utils
## sudo apt install v4l-utils
## v4l2-ctl --list-formats -d /dev/video0
## v4l2-ctl --list-formats-ext -d /dev/video0