nrf24l01_commands

Module commands

source
Expand description

Generate SPI byte sequences for nRF24L01 commands.

§Example with writing the CONFIG register

use nrf24l01_commands::{registers, commands};

let config = registers::Config::new()
    .with_mask_rx_dr(true)
    .with_mask_tx_ds(false)
    .with_mask_max_rt(false)
    .with_en_crc(false)
    .with_crco(true)
    .with_pwr_up(true)
    .with_prim_rx(false);
let write_command = commands::WRegister(config);
let spi_bytes = write_command.bytes();
assert_eq!(spi_bytes, [0b0010_0000, 0b0100_0110]);

Structs§

Traits§

  • A trait for nRF24L01 commands. Defines the command’s command word.