[−][src]Struct nrf52_radio_802154::radio::Radio
802.15.4 PHY layer implementation for nRF Radio
This is work in progress.
Methods
impl Radio
[src]
pub fn new(radio: RADIO) -> Self
[src]
Initialise the radio in 802.15.4 mode
pub fn set_channel(&mut self, channel: u8)
[src]
Configure channel to use
There are 16 channels, 11 to 26. The channel frequency can be calculated as follows,
frequency = 2400 MHz + ((channel - 10) * 5 MHz)
pub fn get_channel(&mut self) -> u8
[src]
Get the configured channel
pub fn set_transmission_power(&mut self, power: i8)
[src]
Configure transmission power
Valid power levels are 8-2,0,-4,-8,-12,-16,-20,-40 dBm
pub fn print_interrupt(&self)
[src]
pub fn state(&mut self) -> STATER
[src]
Get the radio state
pub fn receive_prepare(&mut self)
[src]
Prepare to receive data
pub fn receive(&mut self, buffer: &mut PacketBuffer) -> usize
[src]
Read received data into buffer
------------------------
| size | payload | LQI |
------------------------
1 * 1 octets
The first octet in the buffer is the size of the packet (including size and LQI). Then comes the payload. Last octet is the link quality indicator (LQI).
Return
Returns the number of bytes received, or zero if no data could be received.
pub fn queue_transmission(&mut self, data: &[u8]) -> usize
[src]
Queue a transmission of the provided data
data
should contain the packet payload to be sent without the PHR and FCS.
If the transmission succeeds the PHYEND event shall signal. The transmission might fail if the channel is used, then the CCABUSY event will be signalled.
Return
Returns the number of bytes queued for transmission, or zero if no data could be sent.
pub fn start_energy_detect(&mut self, count: u32) -> bool
[src]
Start a energy detect query on the current channel
Return
Returns true if the energy detection query could be started.
pub fn report_energy_detect(&mut self) -> Option<u8>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> From for T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self