Struct rubble_nrf5x::radio::BleRadio [−][src]
pub struct BleRadio {
advertising: bool,
radio: RADIO,
tx_buf: &'static mut PacketBuffer,
rx_buf: Option<&'static mut PacketBuffer>,
}Expand description
An interface to the nRF radio in BLE mode.
Fields
advertising: booltrue if the radio is operating on an advertising channel, false if it’s a data channel.
radio: RADIOtx_buf: &'static mut PacketBufferrx_buf: Option<&'static mut PacketBuffer>Receive buffer.
This is an Option because we need to pass a &mut BleRadio to the BLE stack while still
having access to this buffer.
Implementations
pub fn new(
radio: RADIO,
ficr: &FICR,
tx_buf: &'static mut PacketBuffer,
rx_buf: &'static mut PacketBuffer
) -> Self
pub fn new(
radio: RADIO,
ficr: &FICR,
tx_buf: &'static mut PacketBuffer,
rx_buf: &'static mut PacketBuffer
) -> Self
Initializes the radio in BLE mode and takes ownership of the RX and TX buffers.
Configures the Radio for (not) receiving data according to cmd.
Call this when the RADIO interrupt fires.
Automatically reconfigures the radio according to the RadioCmd returned by the BLE stack.
Returns when the update method should be called the next time.
Perform preparations to receive or send on an advertising channel.
This will disable the radio, configure the packet layout, set initial values for CRC and
whitening, and set the frequency to the given channel.
To transmit, the txaddress must be set and the packetptr must be set to the TX
buffer.
To receive, the rxaddresses must be set to receive on logical address 0 and
packetptr must be pointed to the RX buffer.
Of course, other tasks may also be performed.
Trait Implementations
Get a reference to the Transmitter’s PDU payload buffer. Read more
Transmit an Advertising Channel PDU. Read more
fn transmit_data(
&mut self,
_access_address: u32,
_crc_iv: u32,
header: Header,
_channel: DataChannel
)
fn transmit_data(
&mut self,
_access_address: u32,
_crc_iv: u32,
header: Header,
_channel: DataChannel
)
Transmit a Data Channel PDU. Read more