rf24/
lib.rs

1#![doc(
2    html_logo_url = "https://raw.githubusercontent.com/nRF24/rf24-rs/main/docs/src/images/logo-square.png"
3)]
4#![doc(html_favicon_url = "https://github.com/nRF24/rf24-rs/raw/main/docs/src/images/favicon.ico")]
5#![doc = include_str!("../README.md")]
6#![no_std]
7
8mod types;
9pub use types::{CrcLength, DataRate, FifoState, PaLevel, StatusFlags};
10pub mod radio;
11
12#[cfg(test)]
13mod test {
14    /// Takes an indefinite repetition of a tuple of 2 vectors: `(expected_data, response_data)`
15    /// and generates an array of `SpiTransaction`s.
16    ///
17    /// NOTE: This macro is only used to generate code in unit tests (for this crate only).
18    #[macro_export]
19    macro_rules! spi_test_expects {
20        ($( ($expected:expr , $response:expr $(,)? ) , ) + ) => {
21            [
22                $(
23                    SpiTransaction::transaction_start(),
24                    SpiTransaction::transfer_in_place($expected, $response),
25                    SpiTransaction::transaction_end(),
26                )*
27            ]
28        }
29    }
30}