A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rust-embedded/rust-sysfs-pwm below:

rust-embedded/rust-sysfs-pwm: Linux PWM Access via Sysfs in Rust

rust-sysfs-pwm is a rust library/crate providing access to the Linux sysfs PWM interface. It seeks to provide an API that is safe, convenient, and efficient.

To use sysfs-pwm, first add this to your Cargo.toml:

[dependencies]
# or latest version
sysfs-pwm = "0.2.0"

Then, add this to your crate root:

MSRV (Minimum Supported Rust Version)

This crate is guaranteed to compile on stable Rust 1.28.0 and up. It might compile with older versions but that may change in any new patch release.

The main API consists of a Pwm struct with the following methods:

Check out the Breathing LED example for a usage example.

Most likely, the machine you are running on is not your development machine (although it could be). In those cases, you will need to cross-compile. The instructions here provide great details on cross compiling for your platform.

Cross-compiling can be done by specifying an appropriate target. You can then move that to your device by whatever means and run it.

$ cargo build --target=arm-unknown-linux-gnueabihf --example breathe
$ scp target/arm-unknown-linux-gnueabihf/debug/examples/breathe ...

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Contribution to this crate is organized under the terms of the Rust Code of Conduct, the maintainer of this crate, the Embedded Linux Team, promises to intervene to uphold that code of conduct.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4