capsules_extra::ieee802154::phy_driver

Struct RadioDriver

Source
pub struct RadioDriver<'a, R: Radio<'a>> { /* private fields */ }

Implementations§

Source§

impl<'a, R: Radio<'a>> RadioDriver<'a, R>

Source

pub fn new( radio: &'a R, grant: Grant<App, UpcallCount<{ upcall::COUNT }>, AllowRoCount<{ ro_allow::COUNT }>, AllowRwCount<{ rw_allow::COUNT }>>, kernel_tx: &'static mut [u8], ) -> Self

Trait Implementations§

Source§

impl<'a, R: Radio<'a>> ConfigClient for RadioDriver<'a, R>

Source§

fn config_done(&self, _result: Result<(), ErrorCode>)

Configuring the radio has finished. Read more
Source§

impl<'a, R: Radio<'a>> PowerClient for RadioDriver<'a, R>

Source§

fn changed(&self, _on: bool)

The power state of the radio changed. This is called when the radio has turned on or off. Read more
Source§

impl<'a, R: Radio<'a>> RxClient for RadioDriver<'a, R>

Source§

fn receive<'b>( &self, buf: &'static mut [u8], frame_len: usize, lqi: u8, crc_valid: bool, result: Result<(), ErrorCode>, )

Packet was received. Read more
Source§

impl<'a, R: Radio<'a>> SyscallDriver for RadioDriver<'a, R>

Source§

fn command( &self, command_number: usize, arg1: usize, arg2: usize, processid: ProcessId, ) -> CommandReturn

IEEE 802.15.4 low-level control.

§command_num
  • 0: Driver existence check.
  • 1: Return radio status. Ok(())/OFF = on/off.
  • 2: Set short address.
  • 4: Set PAN ID.
  • 5: Set channel.
  • 6: Set transmission power.
  • 7: Commit any configuration changes.
  • 8: Get the short MAC address.
  • 10: Get the PAN ID.
  • 11: Get the channel.
  • 12: Get the transmission power.
  • 27: Transmit a frame. The frame must be stored in the write RO allow buffer 0. The allowed buffer must be the length of the frame. The frame includes the PDSU (i.e., the MAC payload) without the MFR (i.e., CRC) bytes.
  • 28: Set long address.
  • 29: Get the long MAC address.
  • 30: Turn the radio on.
  • 31: Turn the radio off.
Source§

fn allocate_grant(&self, processid: ProcessId) -> Result<(), Error>

Request to allocate a capsule’s grant for a specific process. Read more
Source§

fn allow_userspace_readable( &self, app: ProcessId, which: usize, slice: ReadWriteProcessBuffer, ) -> Result<ReadWriteProcessBuffer, (ReadWriteProcessBuffer, ErrorCode)>

System call for a process to pass a buffer (a UserspaceReadableProcessBuffer) to the kernel that the kernel can either read or write. The kernel calls this method only after it checks that the entire buffer is within memory the process can both read and write. Read more
Source§

impl<'a, R: Radio<'a>> TxClient for RadioDriver<'a, R>

Source§

fn send_done( &self, spi_buf: &'static mut [u8], acked: bool, result: Result<(), ErrorCode>, )

Send is complete or an error occurred during transmission. Read more

Auto Trait Implementations§

§

impl<'a, R> !Freeze for RadioDriver<'a, R>

§

impl<'a, R> !RefUnwindSafe for RadioDriver<'a, R>

§

impl<'a, R> !Send for RadioDriver<'a, R>

§

impl<'a, R> !Sync for RadioDriver<'a, R>

§

impl<'a, R> Unpin for RadioDriver<'a, R>

§

impl<'a, R> !UnwindSafe for RadioDriver<'a, R>

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.