pixels-rs
is a Rust project that demonstrates real-time 3D graphics on an ESP32-S3 microcontroller with RM67162 AMOLED display and touch input capabilities.
- Interactive 3D cube with dual control:
- Automatic rotation
- Touch-based gesture control
- Hardware-accelerated graphics using DMA
- Quaternion-based smooth rotation
- Real-time FPS counter
main.rs
: Main application entry point, handling display, touch input, and 3D renderingdisplay.rs
: Display abstraction layer and graphics primitivesconfig.rs
: Configuration constants for display dimensions
- ESP32-S3 microcontroller
- RM67162 AMOLED display (536x240)
- CST816S touch controller
- SPI interface for display (pins 47, 18, - 6, 7, 17)
- I2C interface for touch (pins 2, 3)
mipidsi
: Display drivercst816s-rs
: Touch controller driverembedded-graphics
: 2D graphics primitivesmicromath
: Mathematical operations including quaternion supportesp-hal
: ESP32-S3 hardware abstraction layerembedded-hal-bus
: Hardware abstraction for I2C/SPI communication
-
Clone the repository:
git clone https://github.com/yourusername/pixels-rs.git cd pixels-rs
-
Build the project:
cargo build --release
The cube can be manipulated in two ways:
- Automatic rotation around the Y-axis
- Touch interaction:
- Touch and drag to rotate the cube
- The rotation angle is proportional to the drag distance
Display dimensions in config.rs
:
pub const DISPLAY_HEIGHT: u16 = 240;
pub const DISPLAY_WIDTH: u16 = 536;
This project is licensed under the MIT License. See the LICENSE file for details.