pub struct Radio<'d, T: Instance> { /* private fields */ }
Expand description
Radio driver.
Implementations§
source§impl<'d, T: Instance> Radio<'d, T>
impl<'d, T: Instance> Radio<'d, T>
sourcepub fn new(
radio: impl Peripheral<P = T> + 'd,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
) -> Self
pub fn new( radio: impl Peripheral<P = T> + 'd, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, ) -> Self
Create a new radio driver.
sourcepub fn set_mode(&mut self, mode: Mode)
pub fn set_mode(&mut self, mode: Mode)
Set the radio mode
The radio must be disabled before calling this function
sourcepub fn set_header_expansion(&mut self, use_s1_field: bool)
pub fn set_header_expansion(&mut self, use_s1_field: bool)
Set the header size changing the S1’s len field
The radio must be disabled before calling this function
sourcepub fn set_whitening_init(&mut self, whitening_init: u8)
pub fn set_whitening_init(&mut self, whitening_init: u8)
Set initial data whitening value Data whitening is used to avoid long sequences of zeros or ones, e.g., 0b0000000 or 0b1111111, in the data bit stream On BLE the initial value is the channel index | 0x40
The radio must be disabled before calling this function
sourcepub fn set_frequency(&mut self, frequency: u32)
pub fn set_frequency(&mut self, frequency: u32)
Set the central frequency to be used It should be in the range 2400..2500
sourcepub fn set_access_address(&mut self, access_address: u32)
pub fn set_access_address(&mut self, access_address: u32)
Set the acess address This address is always constants for advertising And a random value generate on each connection It is used to filter the packages
The radio must be disabled before calling this function
sourcepub fn set_crc_poly(&mut self, crc_poly: u32)
pub fn set_crc_poly(&mut self, crc_poly: u32)
Set the CRC polynomial It only uses the 24 least significant bits
The radio must be disabled before calling this function
sourcepub fn set_crc_init(&mut self, crc_init: u32)
pub fn set_crc_init(&mut self, crc_init: u32)
Set the CRC init value It only uses the 24 least significant bits The CRC initial value varies depending of the PDU type
The radio must be disabled before calling this function
sourcepub fn set_tx_power(&mut self, tx_power: TxPower)
pub fn set_tx_power(&mut self, tx_power: TxPower)
Set the radio tx power
The radio must be disabled before calling this function