4 releases (2 breaking)
|0.2.0||Aug 14, 2020|
|0.1.0||May 26, 2018|
|0.0.1||May 15, 2018|
|0.0.0||May 15, 2018|
#998 in Embedded development
32 downloads per month
- Designed for use with the embedded-hal crate
- Safe and declarative register definitions
- Chip operation modes lifted to the type-level
- Lets you go straight into RX/TX with the default config
- Auto-ack support
*-hal crate for your micro-controller unit. Figure out how
to get to the peripherals implementing these embedded-hal traits:
embedded_hal::blocking::spi::Transferfor the SPI peripheral
We provide a
mod setupwith a few constants for SPI.
embedded_hal::digital::OutputPinfor the CE pin
embedded_hal::digital::OutputPinfor the CSN pin
(Although that one belongs to the SPI, we found it much more reliable to implement in software.)
let mut nrf24 = NRF24L01::new(ce, csn, spi).unwrap();
This will provide an instance of
Standby. You can use
.tx() to transfer into a
TXMode instances. They
.standby() methods to get back to
Standby and then
switch to the other mode.
rx.can_read() to poll (returning the pipe number), then
rx.read() to receive payload.
tx.send() to enqueue a packet.
tx.can_send() to prevent sending on a full queue, and
tx.wait_empty() to flush.