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: bool

true 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

Initializes the radio in BLE mode and takes ownership of the RX and TX buffers.

Returns the current radio state.

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.

Transmit a PDU from the internal buffer.

This will block until the transmission has completed.

Assumes that all registers are correct for this type of transmission.

Trait Implementations

Get a reference to the Transmitter’s PDU payload buffer. Read more

Transmit an Advertising Channel PDU. Read more

Transmit a Data Channel PDU. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.