JSY-MK-194 Rust Driver
May 25, 2026 ยท View on GitHub
Rust driver for the JSY MK-194 power monitor IC, designed for both desktop and embedded environments. It uses embedded-io and embedded-io-async traits to enable true cross-platform support.
Add to Cargo.toml
Choose one runtime mode feature to work with in your application.
sync mode example:
[dependencies]
jsy-mk-194-rs = { version = "x.x", default-features = false, features = ["sync"] }
std-sync (default) mode example:
[dependencies]
jsy-mk-194-rs = { version = "x.x", features = ["std-sync"] }
async mode example:
[dependencies]
jsy-mk-194-rs = { version = "x.x", default-features = false, features = ["async"] }
tokio-async mode example:
[dependencies]
jsy-mk-194-rs = { version = "x.x", default-features = false, features = ["tokio-async"] }
defmt with embedded runtime example:
[dependencies]
jsy-mk-194-rs = { version = "x.x", default-features = false, features = ["sync", "defmt"] }
Why this crate
- Multi-platform support via feature flags.
sync,async,std-syncandtokio-asyncoperation modes.- Strongly typed measurements using uom (units of measurement), so APIs return quantities like voltage, current, frequency, and energy as typed values instead of raw floats.
Feature flags
Only one runtime mode should be enabled at a time:
std-sync(default): desktop/std usage.tokio-async: async desktop/std usage withtokio::io.sync: no_std synchronous embedded usage.async: no_std asynchronous embedded usage.defmt: enablesdefmt::Formatimplementations for embedded logging.advanced: exposes low-level register modules and direct register read/write access.
Run examples
The repository currently includes examples in the examples directory. There is also an ESP32C3 example using Embassy and a bare-metal example on STM32F103C8T6 and RP2040 using the sync mode.
For more information on running the examples, please see the Example README.
Run tests
Some integration tests require real JSY MK-194 hardware connected over serial. Tests should be run single-threaded to avoid hardware access conflicts.
Run the full test suite with the std-sync flag. This is the easiest way and doesn't require any extra hardware other than a serial converter:
Run tests in std-sync mode explicitly:
cargo test --features std-sync advanced -- --test-threads=1