Struct radio_sx128x::base::Base

source ·
pub struct Base<Spi: SpiDevice<u8>, Busy: InputPin, Ready: InputPin, Sdn: OutputPin, Delay: DelayNs> {
    pub spi: Spi,
    pub busy: Busy,
    pub ready: Ready,
    pub sdn: Sdn,
    pub delay: Delay,
}
Expand description

Base interface for radio device

Fields§

§spi: Spi§busy: Busy§ready: Ready§sdn: Sdn§delay: Delay

Trait Implementations§

source§

impl<Spi, Busy, Ready, Sdn, PinError, Delay> Hal for Base<Spi, Busy, Ready, Sdn, Delay>
where Spi: SpiDevice<u8>, <Spi as ErrorType>::Error: Debug + 'static, Busy: InputPin<Error = PinError>, Ready: InputPin<Error = PinError>, Sdn: OutputPin<Error = PinError>, PinError: Debug + 'static, Delay: DelayNs,

source§

fn reset(&mut self) -> Result<(), Error<Self::CommsError, Self::PinError>>

Reset the radio

source§

fn delay_ms(&mut self, ms: u32)

Delay for the specified time

source§

fn delay_us(&mut self, us: u32)

Delay for the specified time

source§

fn prefix_write( &mut self, prefix: &[u8], data: &[u8] ) -> Result<(), Error<Self::CommsError, Self::PinError>>

Write data with prefix, asserting CS as required

source§

fn prefix_read( &mut self, prefix: &[u8], data: &mut [u8] ) -> Result<(), Error<Self::CommsError, Self::PinError>>

Read data with prefix, asserting CS as required

source§

fn write_cmd( &mut self, command: u8, data: &[u8] ) -> Result<(), Error<Self::CommsError, Self::PinError>>

Write the specified command and data

source§

fn read_cmd<'a>( &mut self, command: u8, data: &mut [u8] ) -> Result<(), Error<Self::CommsError, Self::PinError>>

Read the specified command and data

source§

fn write_regs( &mut self, reg: u16, data: &[u8] ) -> Result<(), Error<Self::CommsError, Self::PinError>>

Write to the specified register

source§

fn read_regs<'a>( &mut self, reg: u16, data: &mut [u8] ) -> Result<(), Error<Self::CommsError, Self::PinError>>

Read from the specified register

source§

fn write_buff( &mut self, offset: u8, data: &[u8] ) -> Result<(), Error<Self::CommsError, Self::PinError>>

Write to the specified buffer

source§

fn read_buff<'a>( &mut self, offset: u8, data: &mut [u8] ) -> Result<(), Error<Self::CommsError, Self::PinError>>

Read from the specified buffer

§

type CommsError = <Spi as ErrorType>::Error

§

type PinError = PinError

source§

fn get_busy( &mut self ) -> Result<PinState, Error<Self::CommsError, Self::PinError>>

Fetch radio device busy pin value
source§

fn get_dio( &mut self ) -> Result<PinState, Error<Self::CommsError, Self::PinError>>

Fetch radio device ready / irq (DIO) pin value
source§

fn delay_ns(&mut self, ns: u32)

Delay for the specified time
source§

fn wait_busy(&mut self) -> Result<(), Error<Self::CommsError, Self::PinError>>

Wait on radio device busy
source§

fn read_reg( &mut self, reg: u16 ) -> Result<u8, Error<Self::CommsError, Self::PinError>>

Read a single u8 value from the specified register
source§

fn write_reg( &mut self, reg: u16, value: u8 ) -> Result<(), Error<Self::CommsError, Self::PinError>>

Write a single u8 value to the specified register
source§

fn update_reg( &mut self, reg: u16, mask: u8, value: u8 ) -> Result<u8, Error<Self::CommsError, Self::PinError>>

Update the specified register with the provided value & mask

Auto Trait Implementations§

§

impl<Spi, Busy, Ready, Sdn, Delay> Freeze for Base<Spi, Busy, Ready, Sdn, Delay>
where Spi: Freeze, Busy: Freeze, Ready: Freeze, Sdn: Freeze, Delay: Freeze,

§

impl<Spi, Busy, Ready, Sdn, Delay> RefUnwindSafe for Base<Spi, Busy, Ready, Sdn, Delay>
where Spi: RefUnwindSafe, Busy: RefUnwindSafe, Ready: RefUnwindSafe, Sdn: RefUnwindSafe, Delay: RefUnwindSafe,

§

impl<Spi, Busy, Ready, Sdn, Delay> Send for Base<Spi, Busy, Ready, Sdn, Delay>
where Spi: Send, Busy: Send, Ready: Send, Sdn: Send, Delay: Send,

§

impl<Spi, Busy, Ready, Sdn, Delay> Sync for Base<Spi, Busy, Ready, Sdn, Delay>
where Spi: Sync, Busy: Sync, Ready: Sync, Sdn: Sync, Delay: Sync,

§

impl<Spi, Busy, Ready, Sdn, Delay> Unpin for Base<Spi, Busy, Ready, Sdn, Delay>
where Spi: Unpin, Busy: Unpin, Ready: Unpin, Sdn: Unpin, Delay: Unpin,

§

impl<Spi, Busy, Ready, Sdn, Delay> UnwindSafe for Base<Spi, Busy, Ready, Sdn, Delay>
where Spi: UnwindSafe, Busy: UnwindSafe, Ready: UnwindSafe, Sdn: UnwindSafe, Delay: UnwindSafe,

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> HalError for T
where T: Hal,

§

type E = Error<<T as Hal>::CommsError, <T as Hal>::PinError>

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>,

§

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>,

§

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.