Struct nrf52840_hal::ieee802154::Radio [−][src]
pub struct Radio<'c> { /* fields omitted */ }
Expand description
IEEE 802.15.4 radio
Implementations
Initializes the radio for IEEE 802.15.4 operation
Changes the radio channel
Changes the TX power
Sample the received signal power (i.e. the presence of possibly interfering signals)
within the bandwidth of the currently used channel for sample_cycles
iterations.
Note that one iteration has a sample time of 128μs, and that each iteration produces the
average RSSI value measured during this sample time.
Returns the maximum measurement recorded during sampling as reported by the hardware (not in dBm!). The result can be used to find a suitable ED threshold for Energy Detection-based CCA mechanisms.
For details, see Section 6.20.12.3 Energy detection (ED) of the PS. RSSI samples are averaged over a measurement time of 8 symbol periods (128 μs).
Receives one radio packet and copies its contents into the given packet
buffer
This methods returns the Ok
variant if the CRC included the packet was successfully
validated by the hardware; otherwise it returns the Err
variant. In either case, packet
will be updated with the received packet’s data
Listens for a packet for no longer than the specified amount of microseconds
and copies its contents into the given packet
buffer
If no packet is received within the specified time then the Timeout
error is returned
If a packet is received within the time span then the packet CRC is checked. If the CRC is
incorrect then the Crc
error is returned; otherwise the Ok
variant is returned.
Note that packet
will contain the packet in any case, even if the CRC check failed.
Note that the time it takes to switch the radio to RX mode is included in the timeout count. This transition may take up to a hundred of microseconds; see the section 6.20.15.8 in the Product Specification for more details about timing
Tries to send the given packet
This method performs Clear Channel Assessment (CCA) first and sends the packet
only if the
channel is observed to be clear (no transmission is currently ongoing), otherwise no
packet is transmitted and the Err
variant is returned
NOTE this method will not modify the packet
argument. The mutable reference is used to
ensure the packet
buffer is allocated in RAM, which is required by the RADIO peripheral
Sends the given packet
This is utility method that consecutively calls the try_send
method until it succeeds.
Note that this approach is not IEEE spec compliant – there must be delay between failed
CCA attempts to be spec compliant
NOTE this method will not modify the packet
argument. The mutable reference is used to
ensure the packet
buffer is allocated in RAM, which is required by the RADIO peripheral
Sends the specified packet
without first performing CCA
Acknowledgment packets must be sent using this method
NOTE this method will not modify the packet
argument. The mutable reference is used to
ensure the packet
buffer is allocated in RAM, which is required by the RADIO peripheral