Expand description
Generate SPI byte sequences for nRF24L01+ commands.
§Example with writing the CONFIG
register
use nrf24l01_commands::{commands, fields, registers, registers::AddressRegister};
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(fields::Crco::TwoByte)
.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§
- FlushRx
- FLUSH_RX command
- FlushTx
- FLUSH_TX command
- Nop
- NOP command
- RRegister
- R_REGISTER command
- RRxPayload
- R_RX_PAYLOAD command
- RRxPl
Wid - R_RX_PL_WID command
- Reuse
TxPl - REUSE_TX_PL command
- WAck
Payload - W_ACK_PAYLOAD command
- WRegister
- W_REGISTER command
- WTxPayload
- W_TX_PAYLOAD command
- WTxPayload
Noack - W_TX_PAYLOAD_NOACK command
Traits§
- Command
- A trait for nRF24L01+ commands. Defines the command’s command word.