Documentation

ad9361-rs

docs.rs Crates.io Minimum rustc version

Bindings to the AD9361 part of the Analog Devices Inc. [no-OS] library.

Usage

```rust use ad9361rs::{Ad9361, Ad9361InitParam}; use embeddedhal::blocking::spi::Transfer; use embeddedhal::digital::v2::OutputPin; use embeddedhal::blocking::delay::{DelayMs, DelayUs};

fn example(spi: impl Transfer, delay: impl DelayMs + DelayUs, resetn: impl OutputPin) { let parameters: Ad9361InitParam = Default::default(); let heap = Vec::withcapacity(540);

let mut ad9361 = Ad9361::new(spi, delay, Some(reset_n), heap); // ad9361 must not be moved after this point
ad9361.init(parameters).unwrap();

let _temperature = ad9361.get_temperature().unwrap();

} ```

#[no_std]

To use the crate in a no-std enviroment, specify default-features = false in Cargo.toml. You will then need to specify one of the supported device features.

toml ad9361-rs = { default-features = false, features = ["ad9364_device"] }

The build process for this crate requires a C compiler. When cross-compiling, you will need to make sure you have a suitable compiler installed. If necessary the [cc crate] supports external configuration via enviroment variables

Testing

This crate supports env_logger for log output in tests, try

RUST_LOG=info cargo test

License

For the license terms of the no-OS library, see the [no-OS] library.

This work is licensed under either of

at your option.

Contribution

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.