Struct radio_sx128x::Sx128x [−][src]
Sx128x device object
Implementations
impl<Spi, CommsError, CsPin, BusyPin, ReadyPin, SdnPin, PinError, Delay, DelayError> Sx128x<SpiWrapper<Spi, CommsError, CsPin, BusyPin, ReadyPin, SdnPin, PinError, Delay, DelayError>, CommsError, PinError, DelayError> where
Spi: Transfer<u8, Error = CommsError> + Write<u8, Error = CommsError> + Transactional<u8, Error = CommsError>,
CsPin: OutputPin<Error = PinError>,
BusyPin: InputPin<Error = PinError>,
ReadyPin: InputPin<Error = PinError>,
SdnPin: OutputPin<Error = PinError>,
Delay: DelayMs<u32, Error = DelayError> + DelayUs<u32, Error = DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
[src]
Spi: Transfer<u8, Error = CommsError> + Write<u8, Error = CommsError> + Transactional<u8, Error = CommsError>,
CsPin: OutputPin<Error = PinError>,
BusyPin: InputPin<Error = PinError>,
ReadyPin: InputPin<Error = PinError>,
SdnPin: OutputPin<Error = PinError>,
Delay: DelayMs<u32, Error = DelayError> + DelayUs<u32, Error = DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
pub fn spi(
spi: Spi,
cs: CsPin,
busy: BusyPin,
ready: ReadyPin,
sdn: SdnPin,
delay: Delay,
config: &Config
) -> Result<Self, Error<CommsError, PinError, DelayError>>
[src]
spi: Spi,
cs: CsPin,
busy: BusyPin,
ready: ReadyPin,
sdn: SdnPin,
delay: Delay,
config: &Config
) -> Result<Self, Error<CommsError, PinError, DelayError>>
Create an Sx128x with the provided Spi
implementation and pins
impl<Hal, CommsError, PinError, DelayError> Sx128x<Hal, CommsError, PinError, DelayError> where
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
[src]
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
pub fn new(
hal: Hal,
config: &Config
) -> Result<Self, Error<CommsError, PinError, DelayError>>
[src]
hal: Hal,
config: &Config
) -> Result<Self, Error<CommsError, PinError, DelayError>>
Create a new Sx128x instance over a generic Hal implementation
pub fn reset(&mut self) -> Result<(), Error<CommsError, PinError, DelayError>>
[src]
pub fn configure(
&mut self,
config: &Config
) -> Result<(), Error<CommsError, PinError, DelayError>>
[src]
&mut self,
config: &Config
) -> Result<(), Error<CommsError, PinError, DelayError>>
pub fn firmware_version(
&mut self
) -> Result<u16, Error<CommsError, PinError, DelayError>>
[src]
&mut self
) -> Result<u16, Error<CommsError, PinError, DelayError>>
pub fn set_frequency(
&mut self,
f: u32
) -> Result<(), Error<CommsError, PinError, DelayError>>
[src]
&mut self,
f: u32
) -> Result<(), Error<CommsError, PinError, DelayError>>
pub fn set_irq_mask(
&mut self,
irq: Irq
) -> Result<(), Error<CommsError, PinError, DelayError>>
[src]
&mut self,
irq: Irq
) -> Result<(), Error<CommsError, PinError, DelayError>>
Set IRQ mask
pub fn set_irq_dio_mask(
&mut self,
irq: Irq,
dio1: DioMask,
dio2: DioMask,
dio3: DioMask
) -> Result<(), Error<CommsError, PinError, DelayError>>
[src]
&mut self,
irq: Irq,
dio1: DioMask,
dio2: DioMask,
dio3: DioMask
) -> Result<(), Error<CommsError, PinError, DelayError>>
Set the IRQ and DIO masks
pub fn calibrate(
&mut self,
c: CalibrationParams
) -> Result<(), Error<CommsError, PinError, DelayError>>
[src]
&mut self,
c: CalibrationParams
) -> Result<(), Error<CommsError, PinError, DelayError>>
pub fn set_syncword(
&mut self,
index: u8,
value: &[u8]
) -> Result<(), Error<CommsError, PinError, DelayError>>
[src]
&mut self,
index: u8,
value: &[u8]
) -> Result<(), Error<CommsError, PinError, DelayError>>
Set the sychronization mode for a given index (1-3). This is 5-bytes for GFSK mode and 4-bytes for FLRC and BLE modes.
Trait Implementations
impl<Hal, CommsError, PinError, DelayError> Busy for Sx128x<Hal, CommsError, PinError, DelayError> where
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
[src]
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
radio::Busy
implementation for the SX128x
type Error = Error<CommsError, PinError, DelayError>
Radio error type
fn is_busy(&mut self) -> Result<bool, Self::Error>
[src]
Fetch device state
impl<Hal, CommsError, PinError, DelayError> Channel for Sx128x<Hal, CommsError, PinError, DelayError> where
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
[src]
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
radio::Channel
implementation for the SX128x
type Channel = Channel
Channel consists of an operating frequency and packet mode
type Error = Error<CommsError, PinError, DelayError>
Radio error type
fn set_channel(&mut self, ch: &Self::Channel) -> Result<(), Self::Error>
[src]
Set operating channel
impl<Hal, CommsError, PinError, DelayError> DelayMs<u32> for Sx128x<Hal, CommsError, PinError, DelayError> where
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
[src]
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
type Error = DelayError
Enumeration of DelayMs
errors
fn try_delay_ms(&mut self, t: u32) -> Result<(), DelayError>
[src]
impl<Hal, CommsError, PinError, DelayError> DelayUs<u32> for Sx128x<Hal, CommsError, PinError, DelayError> where
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
[src]
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
type Error = DelayError
Enumeration of DelayMs
errors
fn try_delay_us(&mut self, t: u32) -> Result<(), DelayError>
[src]
impl<Hal, CommsError, PinError, DelayError> Interrupts for Sx128x<Hal, CommsError, PinError, DelayError> where
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
[src]
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
radio::Interrupts
implementation for the SX128x
type Irq = Irq
Interrupt object
type Error = Error<CommsError, PinError, DelayError>
Radio error
fn get_interrupts(&mut self, clear: bool) -> Result<Self::Irq, Self::Error>
[src]
Fetch (and optionally clear) current interrupts
impl<Hal, CommsError, PinError, DelayError> Power for Sx128x<Hal, CommsError, PinError, DelayError> where
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
[src]
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
radio::Power
implementation for the SX128x
type Error = Error<CommsError, PinError, DelayError>
Radio error type
fn set_power(
&mut self,
power: i8
) -> Result<(), Error<CommsError, PinError, DelayError>>
[src]
&mut self,
power: i8
) -> Result<(), Error<CommsError, PinError, DelayError>>
Set TX power in dBm
impl<Hal, CommsError, PinError, DelayError> Receive for Sx128x<Hal, CommsError, PinError, DelayError> where
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
[src]
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
radio::Receive
implementation for the SX128x
type Info = PacketInfo
Receive info structure
type Error = Error<CommsError, PinError, DelayError>
RF Error object
fn start_receive(&mut self) -> Result<(), Self::Error>
[src]
Start radio in receive mode
fn check_receive(&mut self, restart: bool) -> Result<bool, Self::Error>
[src]
Check for a received packet
fn get_received<'a>(
&mut self,
info: &mut Self::Info,
data: &'a mut [u8]
) -> Result<usize, Self::Error>
[src]
&mut self,
info: &mut Self::Info,
data: &'a mut [u8]
) -> Result<usize, Self::Error>
Fetch a received packet
impl<Hal, CommsError, PinError, DelayError> Rssi for Sx128x<Hal, CommsError, PinError, DelayError> where
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
[src]
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
radio::Rssi
implementation for the SX128x
type Error = Error<CommsError, PinError, DelayError>
Radio error
fn poll_rssi(&mut self) -> Result<i16, Error<CommsError, PinError, DelayError>>
[src]
Poll for the current channel RSSI This should only be called when in receive mode
impl<Hal, CommsError, PinError, DelayError> State for Sx128x<Hal, CommsError, PinError, DelayError> where
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
[src]
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
radio::State
implementation for the SX128x
type State = State
Radio state
type Error = Error<CommsError, PinError, DelayError>
Radio error type
fn get_state(&mut self) -> Result<Self::State, Self::Error>
[src]
Fetch device state
fn set_state(&mut self, state: Self::State) -> Result<(), Self::Error>
[src]
Set device state
impl<Hal, CommsError, PinError, DelayError> Transmit for Sx128x<Hal, CommsError, PinError, DelayError> where
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
[src]
Hal: Hal<CommsError, PinError, DelayError>,
CommsError: Debug + Sync + Send + 'static,
PinError: Debug + Sync + Send + 'static,
DelayError: Debug + Sync + Send + 'static,
radio::Transmit
implementation for the SX128x
Auto Trait Implementations
impl<Base, CommsError, PinError, DelayError> RefUnwindSafe for Sx128x<Base, CommsError, PinError, DelayError> where
Base: RefUnwindSafe,
CommsError: RefUnwindSafe,
DelayError: RefUnwindSafe,
PinError: RefUnwindSafe,
Base: RefUnwindSafe,
CommsError: RefUnwindSafe,
DelayError: RefUnwindSafe,
PinError: RefUnwindSafe,
impl<Base, CommsError, PinError, DelayError> Send for Sx128x<Base, CommsError, PinError, DelayError> where
Base: Send,
CommsError: Send,
DelayError: Send,
PinError: Send,
Base: Send,
CommsError: Send,
DelayError: Send,
PinError: Send,
impl<Base, CommsError, PinError, DelayError> Sync for Sx128x<Base, CommsError, PinError, DelayError> where
Base: Sync,
CommsError: Sync,
DelayError: Sync,
PinError: Sync,
Base: Sync,
CommsError: Sync,
DelayError: Sync,
PinError: Sync,
impl<Base, CommsError, PinError, DelayError> Unpin for Sx128x<Base, CommsError, PinError, DelayError> where
Base: Unpin,
CommsError: Unpin,
DelayError: Unpin,
PinError: Unpin,
Base: Unpin,
CommsError: Unpin,
DelayError: Unpin,
PinError: Unpin,
impl<Base, CommsError, PinError, DelayError> UnwindSafe for Sx128x<Base, CommsError, PinError, DelayError> where
Base: UnwindSafe,
CommsError: UnwindSafe,
DelayError: UnwindSafe,
PinError: UnwindSafe,
Base: UnwindSafe,
CommsError: UnwindSafe,
DelayError: UnwindSafe,
PinError: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, I, E> BlockingReceive<I, E> for T where
T: Receive<Info = I, Error = E> + DelayUs<u32>,
E: Debug,
I: Debug,
[src]
T: Receive<Info = I, Error = E> + DelayUs<u32>,
E: Debug,
I: Debug,
pub fn do_receive(
&mut self,
buff: &mut [u8],
info: &mut I,
rx_options: BlockingOptions
) -> Result<usize, BlockingError<E>>
[src]
&mut self,
buff: &mut [u8],
info: &mut I,
rx_options: BlockingOptions
) -> Result<usize, BlockingError<E>>
impl<T, S, E> BlockingSetState<S, E> for T where
T: State<State = S, Error = E> + DelayUs<u32>,
E: Debug,
S: Debug + PartialEq<S> + Copy,
[src]
T: State<State = S, Error = E> + DelayUs<u32>,
E: Debug,
S: Debug + PartialEq<S> + Copy,
pub fn set_state_checked(
&mut self,
state: S,
options: BlockingOptions
) -> Result<(), BlockingError<E>>
[src]
&mut self,
state: S,
options: BlockingOptions
) -> Result<(), BlockingError<E>>
impl<T, E> BlockingTransmit<E> for T where
T: Transmit<Error = E> + DelayUs<u32>,
E: Debug,
[src]
T: Transmit<Error = E> + DelayUs<u32>,
E: Debug,
pub fn do_transmit(
&mut self,
data: &[u8],
tx_options: BlockingOptions
) -> Result<(), BlockingError<E>>
[src]
&mut self,
data: &[u8],
tx_options: BlockingOptions
) -> Result<(), BlockingError<E>>
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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>,