[−][src]Struct esb::EsbBuffer
This is the backing structure for the ESB interface
It is intended to live at 'static
scope, and provides
storage for the EsbApp
and EsbIrq
interfaces
Creating at static scope
Currently due to lacking const generics, the UX for this isn't great. You'll probably want something like this:
NOTE
Although the members of this struct are public, due to const
generic limitations, they are not intended to be used directly,
outside of static
creation.
This could cause unintended, though not undefined, behavior.
TL;DR: It's not unsafe, but it's also not going to work correctly.
// This creates an ESB storage structure with room for // 512 bytes of outgoing packets (including headers), // and 256 bytes of incoming packets (including // headers). static BUFFER: EsbBuffer<U512, U256> = EsbBuffer { app_to_radio_buf: BBBuffer( ConstBBBuffer::new() ), radio_to_app_buf: BBBuffer( ConstBBBuffer::new() ), };
Fields
app_to_radio_buf: BBBuffer<OutgoingLen>
radio_to_app_buf: BBBuffer<IncomingLen>
Methods
impl<OutgoingLen, IncomingLen> EsbBuffer<OutgoingLen, IncomingLen> where
OutgoingLen: ArrayLength<u8>,
IncomingLen: ArrayLength<u8>,
[src]
OutgoingLen: ArrayLength<u8>,
IncomingLen: ArrayLength<u8>,
pub fn try_split<Timer: EsbTimer>(
&'static self,
timer: Timer,
radio: RADIO,
addresses: Addresses,
max_payload_bytes: u8
) -> Result<(EsbApp<OutgoingLen, IncomingLen>, EsbIrq<OutgoingLen, IncomingLen, Timer>), Error>
[src]
&'static self,
timer: Timer,
radio: RADIO,
addresses: Addresses,
max_payload_bytes: u8
) -> Result<(EsbApp<OutgoingLen, IncomingLen>, EsbIrq<OutgoingLen, IncomingLen, Timer>), Error>
Attempt to split the static
buffer into handles for Interrupt and App context
This function will only succeed once. If the underlying buffers have also been split directly, this function will also fail.
Upon splitting, the Radio will be initialized and set to idle.
Auto Trait Implementations
impl<OutgoingLen, IncomingLen> Send for EsbBuffer<OutgoingLen, IncomingLen>
impl<OutgoingLen, IncomingLen> Sync for EsbBuffer<OutgoingLen, IncomingLen>
impl<OutgoingLen, IncomingLen> Unpin for EsbBuffer<OutgoingLen, IncomingLen> where
<IncomingLen as ArrayLength<u8>>::ArrayType: Unpin,
<OutgoingLen as ArrayLength<u8>>::ArrayType: Unpin,
<IncomingLen as ArrayLength<u8>>::ArrayType: Unpin,
<OutgoingLen as ArrayLength<u8>>::ArrayType: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,