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>
impl<Spi, Busy, Ready, Sdn, PinError, Delay> Hal for Base<Spi, Busy, Ready, Sdn, Delay>
source§fn prefix_write(
&mut self,
prefix: &[u8],
data: &[u8]
) -> Result<(), Error<Self::CommsError, Self::PinError>>
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>>
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>>
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>>
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>>
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>>
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>>
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>>
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>>
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>>
fn get_dio( &mut self ) -> Result<PinState, Error<Self::CommsError, Self::PinError>>
Fetch radio device ready / irq (DIO) pin value
source§fn wait_busy(&mut self) -> Result<(), Error<Self::CommsError, Self::PinError>>
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>>
fn read_reg( &mut self, reg: u16 ) -> Result<u8, Error<Self::CommsError, Self::PinError>>
Read a single u8 value from the specified register
Auto Trait Implementations§
impl<Spi, Busy, Ready, Sdn, Delay> Freeze for Base<Spi, Busy, Ready, Sdn, Delay>
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>
impl<Spi, Busy, Ready, Sdn, Delay> Sync for Base<Spi, Busy, Ready, Sdn, Delay>
impl<Spi, Busy, Ready, Sdn, Delay> Unpin for Base<Spi, Busy, Ready, Sdn, Delay>
impl<Spi, Busy, Ready, Sdn, Delay> UnwindSafe for Base<Spi, Busy, Ready, Sdn, Delay>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more