Struct radio_sx127x::Sx127x
source · [−]pub struct Sx127x<Hal> { /* private fields */ }
Expand description
Sx127x device object
Operating functions are implemented as traits from the radio package
Implementations
sourceimpl<Spi, CsPin, BusyPin, ReadyPin, SdnPin, PinError, Delay> Sx127x<Base<Spi, CsPin, BusyPin, ReadyPin, SdnPin, Delay>> where
Spi: SpiBase,
<Spi as SpiBase>::Error: Debug,
CsPin: OutputPin<Error = PinError>,
BusyPin: InputPin<Error = PinError>,
ReadyPin: InputPin<Error = PinError>,
SdnPin: OutputPin<Error = PinError>,
PinError: Debug,
Delay: DelayUs,
<Delay as DelayUs>::Error: Debug,
impl<Spi, CsPin, BusyPin, ReadyPin, SdnPin, PinError, Delay> Sx127x<Base<Spi, CsPin, BusyPin, ReadyPin, SdnPin, Delay>> where
Spi: SpiBase,
<Spi as SpiBase>::Error: Debug,
CsPin: OutputPin<Error = PinError>,
BusyPin: InputPin<Error = PinError>,
ReadyPin: InputPin<Error = PinError>,
SdnPin: OutputPin<Error = PinError>,
PinError: Debug,
Delay: DelayUs,
<Delay as DelayUs>::Error: Debug,
sourceimpl<Hal> Sx127x<Hal> where
Hal: Hal,
impl<Hal> Sx127x<Hal> where
Hal: Hal,
sourcepub fn new(
hal: Hal,
config: &Config
) -> Result<Self, Error<<Hal as Hal>::Error>>
pub fn new(
hal: Hal,
config: &Config
) -> Result<Self, Error<<Hal as Hal>::Error>>
Create a new radio instance over an arbitrary base::Base implementation
sourcepub fn reset(&mut self) -> Result<(), Error<<Hal as Hal>::Error>>
pub fn reset(&mut self) -> Result<(), Error<<Hal as Hal>::Error>>
Reset the device. This recalibrates and patches the device, however, still requires configuration.
sourceimpl<Hal> Sx127x<Hal> where
Hal: Hal,
impl<Hal> Sx127x<Hal> where
Hal: Hal,
sourcepub fn read_reg<R>(&mut self, reg: R) -> Result<u8, Error<<Hal as Hal>::Error>> where
R: Copy + Clone + Debug + Into<u8>,
pub fn read_reg<R>(&mut self, reg: R) -> Result<u8, Error<<Hal as Hal>::Error>> where
R: Copy + Clone + Debug + Into<u8>,
Read a u8 value from the specified register
Trait Implementations
sourceimpl<Hal> DelayUs for Sx127x<Hal> where
Hal: Hal,
impl<Hal> DelayUs for Sx127x<Hal> where
Hal: Hal,
sourceimpl<Hal> Interrupts for Sx127x<Hal> where
Hal: Hal,
impl<Hal> Interrupts for Sx127x<Hal> where
Hal: Hal,
sourceimpl<Hal> Receive for Sx127x<Hal> where
Hal: Hal,
impl<Hal> Receive for Sx127x<Hal> where
Hal: Hal,
sourcefn start_receive(&mut self) -> Result<(), Self::Error>
fn start_receive(&mut self) -> Result<(), Self::Error>
Start receive mode
sourcefn check_receive(&mut self, restart: bool) -> Result<bool, Self::Error>
fn check_receive(&mut self, restart: bool) -> Result<bool, Self::Error>
Check receive state
This returns true if a boolean indicating whether a packet has been received. The restart option specifies whether transient timeout or CRC errors should be internally handled (returning Ok(false)) or passed back to the caller as errors.
sourcefn get_received(
&mut self,
buff: &mut [u8]
) -> Result<(usize, Self::Info), Self::Error>
fn get_received(
&mut self,
buff: &mut [u8]
) -> Result<(usize, Self::Info), Self::Error>
Fetch a received message
This copies data into the provided slice, updates the provided information object, and returns the number of bytes received on success
type Info = PacketInfo
type Info = PacketInfo
Packet received info
Auto Trait Implementations
impl<Hal> RefUnwindSafe for Sx127x<Hal> where
Hal: RefUnwindSafe,
impl<Hal> Send for Sx127x<Hal> where
Hal: Send,
impl<Hal> Sync for Sx127x<Hal> where
Hal: Sync,
impl<Hal> Unpin for Sx127x<Hal> where
Hal: Unpin,
impl<Hal> UnwindSafe for Sx127x<Hal> where
Hal: UnwindSafe,
Blanket Implementations
sourceimpl<T, S, E> BlockingSetState<S, E> for T where
T: State<State = S, Error = E> + DelayUs,
S: Debug + PartialEq<S> + Copy,
E: Debug,
impl<T, S, E> BlockingSetState<S, E> for T where
T: State<State = S, Error = E> + DelayUs,
S: Debug + PartialEq<S> + Copy,
E: Debug,
fn set_state_checked(
&mut self,
state: S,
options: BlockingOptions
) -> Result<(), BlockingError<E>>
sourceimpl<T, E> BlockingTransmit<E> for T where
T: Transmit<Error = E> + DelayUs,
E: Debug,
impl<T, E> BlockingTransmit<E> for T where
T: Transmit<Error = E> + DelayUs,
E: Debug,
fn do_transmit(
&mut self,
data: &[u8],
tx_options: BlockingOptions
) -> Result<(), BlockingError<E>>
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more