General

Open-source Rust driver for AS7341

userHead qwertys318 2026-04-26 21:07:20 15 Views0 Replies

Hi,

We have just published an open-source, platform-agnostic Rust driver for the
AS7341 11-channel spectral color sensor:

- crates.io: https://crates.io/crates/as7341
- GitHub:    https://github.com/qwertys318/as7341
- License:   MIT / Apache-2.0

The driver is built on embedded-hal v1 traits (`no_std`), so it works on any
microcontroller with an I2C bus. We developed and tested it on an ESP32-C3
(RISC-V), but it is equally usable on ARM Cortex-M, nRF, RP2040, and other
targets.

Features covered:
- All 10 spectral channels (F1-F8 415-680 nm, Clear, NIR)
- Configurable gain (0.5x-512x) and integration time
- On-board LED control (4-258 mA)
- Flicker detection (50/60 Hz)
- Optional defmt support for embedded debugging

To the best of our knowledge, this is the first published Rust driver for
the AS7341.

We would love to hear if you have any feedback, suggestions, or interest in
collaboration. We are also open to testing with additional hardware or writing
application notes.