Struct radio_at86rf212::AT86RF212
source · pub struct AT86RF212<SPI, OUTPUT, DELAY> { /* private fields */ }
Expand description
AT86RF212 device object
Implementations
sourceimpl<E, SPI, OUTPUT, DELAY> AT86RF212<SPI, OUTPUT, DELAY>where
SPI: Transfer<u8, Error = E> + Write<u8, Error = E>,
OUTPUT: OutputPin,
DELAY: DelayMs<u32>,
impl<E, SPI, OUTPUT, DELAY> AT86RF212<SPI, OUTPUT, DELAY>where
SPI: Transfer<u8, Error = E> + Write<u8, Error = E>,
OUTPUT: OutputPin,
DELAY: DelayMs<u32>,
pub fn new(
spi: SPI,
reset: OUTPUT,
cs: OUTPUT,
sleep: OUTPUT,
delay: DELAY
) -> Result<Self, At86rf212Error<E>>
sourcepub fn reg_read<'a>(&mut self, reg: Register) -> Result<u8, At86rf212Error<E>>
pub fn reg_read<'a>(&mut self, reg: Register) -> Result<u8, At86rf212Error<E>>
Read data from a specified register address This consumes the provided input data array and returns a reference to this on success
sourcepub fn reg_write(
&mut self,
reg: Register,
value: u8
) -> Result<(), At86rf212Error<E>>
pub fn reg_write(
&mut self,
reg: Register,
value: u8
) -> Result<(), At86rf212Error<E>>
Write data to a specified register address
sourcepub fn reg_update(
&mut self,
reg: Register,
mask: u8,
value: u8
) -> Result<(), At86rf212Error<E>>
pub fn reg_update(
&mut self,
reg: Register,
mask: u8,
value: u8
) -> Result<(), At86rf212Error<E>>
Update a portion of a register with the provided mask and value Note that shifting is not automatically applied
sourcepub fn read_frame<'a>(
&mut self,
data: &'a mut [u8]
) -> Result<&'a [u8], At86rf212Error<E>>
pub fn read_frame<'a>(
&mut self,
data: &'a mut [u8]
) -> Result<&'a [u8], At86rf212Error<E>>
Read a frame from the device
sourcepub fn write_frame(&mut self, data: &[u8]) -> Result<(), At86rf212Error<E>>
pub fn write_frame(&mut self, data: &[u8]) -> Result<(), At86rf212Error<E>>
Write a frame to the device
sourcepub fn set_state(&mut self, state: TrxCmd) -> Result<(), At86rf212Error<E>>
pub fn set_state(&mut self, state: TrxCmd) -> Result<(), At86rf212Error<E>>
Set the radio state
pub fn set_state_blocking(
&mut self,
state: TrxCmd
) -> Result<(), At86rf212Error<E>>
sourcepub fn get_state(&mut self) -> Result<u8, At86rf212Error<E>>
pub fn get_state(&mut self) -> Result<u8, At86rf212Error<E>>
Fetch the radio state
sourcepub fn set_channel(&mut self, channel: u8) -> Result<(), At86rf212Error<E>>
pub fn set_channel(&mut self, channel: u8) -> Result<(), At86rf212Error<E>>
Set the radio channel
sourcepub fn get_channel(&mut self) -> Result<u8, At86rf212Error<E>>
pub fn get_channel(&mut self) -> Result<u8, At86rf212Error<E>>
Fetch the radio channel
sourcepub fn set_irq_mask(&mut self, mask: u8) -> Result<(), At86rf212Error<E>>
pub fn set_irq_mask(&mut self, mask: u8) -> Result<(), At86rf212Error<E>>
Set the IRQ mask
sourcepub fn get_irq_status(&mut self) -> Result<u8, At86rf212Error<E>>
pub fn get_irq_status(&mut self) -> Result<u8, At86rf212Error<E>>
Fetch the IRQ status (clears pending interrupts)
sourcepub fn set_cca_mode(&mut self, mode: CCAMode) -> Result<(), At86rf212Error<E>>
pub fn set_cca_mode(&mut self, mode: CCAMode) -> Result<(), At86rf212Error<E>>
Set the Clear Channel Assessment (CCA) mode
sourcepub fn get_cca_mode(&mut self) -> Result<u8, At86rf212Error<E>>
pub fn get_cca_mode(&mut self) -> Result<u8, At86rf212Error<E>>
Fetch the Clear Channel Assessment (CCA) mode
sourcepub fn set_short_address(
&mut self,
address: u16
) -> Result<(), At86rf212Error<E>>
pub fn set_short_address(
&mut self,
address: u16
) -> Result<(), At86rf212Error<E>>
Set the 802.15.4 short address
sourcepub fn set_pan_id(&mut self, pan_id: u16) -> Result<(), At86rf212Error<E>>
pub fn set_pan_id(&mut self, pan_id: u16) -> Result<(), At86rf212Error<E>>
Set the 802.15.4 PAN ID
pub fn set_power_raw(&mut self, power: u8) -> Result<(), At86rf212Error<E>>
pub fn start_rx(&mut self, channel: u8) -> Result<(), At86rf212Error<E>>
pub fn check_tx_rx(&mut self) -> Result<bool, At86rf212Error<E>>
pub fn get_rx<'a>(
&mut self,
data: &'a mut [u8]
) -> Result<&'a [u8], At86rf212Error<E>>
pub fn start_tx(&mut self, data: &[u8]) -> Result<(), At86rf212Error<E>>
Auto Trait Implementations
impl<SPI, OUTPUT, DELAY> RefUnwindSafe for AT86RF212<SPI, OUTPUT, DELAY>where
DELAY: RefUnwindSafe,
OUTPUT: RefUnwindSafe,
SPI: RefUnwindSafe,
impl<SPI, OUTPUT, DELAY> Send for AT86RF212<SPI, OUTPUT, DELAY>where
DELAY: Send,
OUTPUT: Send,
SPI: Send,
impl<SPI, OUTPUT, DELAY> Sync for AT86RF212<SPI, OUTPUT, DELAY>where
DELAY: Sync,
OUTPUT: Sync,
SPI: Sync,
impl<SPI, OUTPUT, DELAY> Unpin for AT86RF212<SPI, OUTPUT, DELAY>where
DELAY: Unpin,
OUTPUT: Unpin,
SPI: Unpin,
impl<SPI, OUTPUT, DELAY> UnwindSafe for AT86RF212<SPI, OUTPUT, DELAY>where
DELAY: UnwindSafe,
OUTPUT: UnwindSafe,
SPI: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more