nrf52::ieee802154_radio

Struct Radio

Source
pub struct Radio<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Radio<'a>

Source

pub fn new(ack_buf: &'static mut [u8; 7]) -> Self

Source

pub fn set_timer_ref(&self, timer: &'a TimerAlarm<'a>)

Source

pub fn is_enabled(&self) -> bool

Source

pub fn handle_interrupt(&self)

Source

pub fn enable_interrupts(&self)

Source

pub fn enable_interrupt(&self, intr: u32)

Source

pub fn clear_interrupt(&self, intr: u32)

Source

pub fn disable_all_interrupts(&self)

Source

pub fn set_ack_buffer(&self, buffer: &'static mut [u8])

Source

pub fn startup(&self) -> Result<(), ErrorCode>

Trait Implementations§

Source§

impl AlarmClient for Radio<'_>

Source§

fn alarm(&self)

Callback indicating the alarm time has been reached. The alarm MUST be disabled when this is called. If a new alarm is needed, the client can call Alarm::set_alarm.
Source§

impl DeferredCallClient for Radio<'_>

Source§

fn handle_deferred_call(&self)

Software interrupt function that is called when the deferred call is triggered.
Source§

fn register(&'static self)

Source§

impl<'a> RadioConfig<'a> for Radio<'a>

Source§

fn config_commit(&self)

Commit the config calls to hardware, changing (in theory):

  • the RX address
  • PAN ID
  • TX power
  • channel

to the specified values. However, the nRF52840 IEEE 802.15.4 radio does not support hardware-level address filtering (see here). So setting the addresses and PAN ID have no meaning for this chip and any filtering must be done in higher layers in software.

Issues a callback to the config client when done.

Source§

fn get_address(&self) -> u16

Accessors

Source§

fn get_pan(&self) -> u16

The 16-bit PAN ID

Source§

fn get_tx_power(&self) -> i8

The transmit power, in dBm

Source§

fn get_channel(&self) -> u8

The 802.15.4 channel

Source§

fn set_address(&self, addr: u16)

Mutators

Source§

fn initialize(&self) -> Result<(), ErrorCode>

Initialize the radio. Read more
Source§

fn set_power_client(&self, client: &'a dyn PowerClient)

Set the client that is called when the radio changes power states.
Source§

fn reset(&self) -> Result<(), ErrorCode>

Reset the radio. Read more
Source§

fn start(&self) -> Result<(), ErrorCode>

Start the radio. Read more
Source§

fn stop(&self) -> Result<(), ErrorCode>

Stop the radio. Read more
Source§

fn is_on(&self) -> bool

Check if the radio is currently on. Read more
Source§

fn busy(&self) -> bool

Check if the radio is currently busy transmitting or receiving a packet. Read more
Source§

fn set_config_client(&self, client: &'a dyn ConfigClient)

Set the client that is called when configuration finishes.
Source§

fn get_address_long(&self) -> [u8; 8]

Get the 802.15.4 extended (64-bit) address for the radio. Read more
Source§

fn set_address_long(&self, addr: [u8; 8])

Set the 802.15.4 extended (64-bit) address for the radio. Read more
Source§

fn set_pan(&self, id: u16)

Set the 802.15.4 PAN ID (16-bit) for the radio. Read more
Source§

fn set_channel(&self, chan: RadioChannel)

Set the 802.15.4 channel for the radio. Read more
Source§

fn set_tx_power(&self, tx_power: i8) -> Result<(), ErrorCode>

Set the radio’s transmit power. Read more
Source§

impl<'a> RadioData<'a> for Radio<'a>

Source§

fn set_receive_client(&self, client: &'a dyn RxClient)

Set the client that will be called when packets are received.
Source§

fn set_receive_buffer(&self, buffer: &'static mut [u8])

Set the buffer to receive packets into. Read more
Source§

fn set_transmit_client(&self, client: &'a dyn TxClient)

Set the client that will be called when packets are transmitted.
Source§

fn transmit( &self, buf: &'static mut [u8], frame_len: usize, ) -> Result<(), (ErrorCode, &'static mut [u8])>

Transmit a packet. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for Radio<'a>

§

impl<'a> !RefUnwindSafe for Radio<'a>

§

impl<'a> !Send for Radio<'a>

§

impl<'a> !Sync for Radio<'a>

§

impl<'a> Unpin for Radio<'a>

§

impl<'a> !UnwindSafe for Radio<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<'a, T> Radio<'a> for T
where T: RadioConfig<'a> + RadioData<'a>,