- Rust 100%
| .cargo | ||
| src | ||
| .clippy.toml | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Readme.md | ||
| rust-toolchain.toml | ||
| rustfmt.toml | ||
ESP32-C5 C-ITS Visualizer
Displays different C-ITS receive-only use cases for cheap.
Hardware Requirements
The code is currently tailored to:
- Seeed XIAO ESP32-C5 (8MB PSRAM)
- Seeed XIAO L67K (connected on GPIO12 (RX), GPIO11 (TX), GPIO1 (wakeup) and GPIO25 (reset))
only available withgnssfeature (which is included inspatfeature) - Some ST7789 172*320px screen (connected on GPIO8 (SCL/ SCK), GPIO10 (SDA/ MOSI), GPIO7 (reset), GPIO23 (DC), GPIO24 (CS), TODO GPIO0 (BL))
only available withscreenfeature (which is included inspatfeature)
Features
GNSS
Enable L67K GNSS module and in main application logic/ state.
SPAT
Takes the current position and heading from the GNSS receiver and displays the signal phases of the upcoming intersection. The upcoming intersection is selected when the own position is "inside" some ingress approach of the intersection. The display will show the current phase and remaining time for all signal groups of the bike-able lanes in the approach.
DENM
TODO: Not implemented yet!
Shall "publish" the most relevant information of a DENMs via BLE
CAM
Just prints a line for each received CAM.
Usage
Toolchain Installation
Install the toolchain, targe and tools like this:
rustup toolchain install nightly --component rust-src
rustup target add riscv32imac-unknown-none-elf
# cargo install esp-generate --locked
# cargo install esp-config --features=tui --locked
cargo install espflash --locked
(Project was setup using esp-generate with the options --chip esp32c5 -o esp32c5-wroom-1-psram -o alloc -o log -o unstable-hal -o wifi -o esp-backtrace -o embassy.)
To use the proper rustfmt features, enable the nightly toolchain:
rustup component add --toolchain nightly rustfmt
Build and Flash
In default configuration only signal phases (SPAT) data is displayed for the upcoming intersection. Additional features are available though feature flags:
esp: Run on ESP (required as feature flag to enable unit tests on host)std: Run on system withstdlibraryspat: Enable signal phase (and intersection map) datadenm: Enable DENMscam: Enable CAMs
Connect your ESP32-C5 and run:
# default configuration
cargo run --release
# for e.g. also enable DENM feature
cargo run --release -F denm
Run Unit Tests on Host
The unit tests in this project are meant to be run on the host:
cargo test --target host-tuple --bin test --no-default-features -F std,spat