[−][src]Struct radio_sx128x::Sx128x
Sx128x device object
Methods
impl<Spi, CommsError, Output, Input, PinError, Delay> Sx128x<SpiWrapper<Spi, CommsError, Output, Input, (), Output, PinError, Delay>, CommsError, PinError> where
Spi: Transfer<u8, Error = CommsError> + Write<u8, Error = CommsError>,
Output: OutputPin<Error = PinError>,
Input: InputPin<Error = PinError>,
Delay: DelayMs<u32>,
[src]
Spi: Transfer<u8, Error = CommsError> + Write<u8, Error = CommsError>,
Output: OutputPin<Error = PinError>,
Input: InputPin<Error = PinError>,
Delay: DelayMs<u32>,
pub fn spi(
spi: Spi,
cs: Output,
busy: Input,
sdn: Output,
delay: Delay,
config: &Config
) -> Result<Self, Error<CommsError, PinError>>
[src]
spi: Spi,
cs: Output,
busy: Input,
sdn: Output,
delay: Delay,
config: &Config
) -> Result<Self, Error<CommsError, PinError>>
Create an Sx128x with the provided Spi
implementation and pins
impl<Hal, CommsError, PinError> Sx128x<Hal, CommsError, PinError> where
Hal: Hal<CommsError, PinError>,
[src]
Hal: Hal<CommsError, PinError>,
pub fn new(
hal: Hal,
config: &Config
) -> Result<Self, Error<CommsError, PinError>>
[src]
hal: Hal,
config: &Config
) -> Result<Self, Error<CommsError, PinError>>
Create a new Sx128x instance over a generic Hal implementation
pub fn reset(&mut self) -> Result<(), Error<CommsError, PinError>>
[src]
pub fn configure(
&mut self,
config: &Config
) -> Result<(), Error<CommsError, PinError>>
[src]
&mut self,
config: &Config
) -> Result<(), Error<CommsError, PinError>>
pub fn firmware_version(&mut self) -> Result<u16, Error<CommsError, PinError>>
[src]
pub fn set_frequency(
&mut self,
f: u32
) -> Result<(), Error<CommsError, PinError>>
[src]
&mut self,
f: u32
) -> Result<(), Error<CommsError, PinError>>
pub fn set_irq_mask(
&mut self,
irq: Irq
) -> Result<(), Error<CommsError, PinError>>
[src]
&mut self,
irq: Irq
) -> Result<(), Error<CommsError, PinError>>
pub fn calibrate(
&mut self,
c: CalibrationParams
) -> Result<(), Error<CommsError, PinError>>
[src]
&mut self,
c: CalibrationParams
) -> Result<(), Error<CommsError, PinError>>
pub fn set_syncword(
&mut self,
index: u8,
value: &[u8]
) -> Result<(), Error<CommsError, PinError>>
[src]
&mut self,
index: u8,
value: &[u8]
) -> Result<(), Error<CommsError, PinError>>
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> Channel for Sx128x<Hal, CommsError, PinError> where
Hal: Hal<CommsError, PinError>,
[src]
Hal: Hal<CommsError, PinError>,
radio::Channel
implementation for the SX128x
type Channel = Channel
Channel consists of an operating frequency and packet mode
type Error = Error<CommsError, PinError>
Radio error type
fn set_channel(&mut self, ch: &Self::Channel) -> Result<(), Self::Error>
[src]
Set operating channel
impl<Hal, CommsError, PinError> DelayMs<u32> for Sx128x<Hal, CommsError, PinError> where
Hal: Hal<CommsError, PinError>,
[src]
Hal: Hal<CommsError, PinError>,
impl<Hal, CommsError, PinError> Interrupts for Sx128x<Hal, CommsError, PinError> where
Hal: Hal<CommsError, PinError>,
[src]
Hal: Hal<CommsError, PinError>,
radio::Interrupts
implementation for the SX128x
type Irq = Irq
Interrupt object
type Error = Error<CommsError, PinError>
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> Power for Sx128x<Hal, CommsError, PinError> where
Hal: Hal<CommsError, PinError>,
[src]
Hal: Hal<CommsError, PinError>,
radio::Power
implementation for the SX128x
type Error = Error<CommsError, PinError>
Radio error type
fn set_power(&mut self, power: i8) -> Result<(), Error<CommsError, PinError>>
[src]
Set TX power in dBm
impl<Hal, CommsError, PinError> Receive for Sx128x<Hal, CommsError, PinError> where
Hal: Hal<CommsError, PinError>,
[src]
Hal: Hal<CommsError, PinError>,
radio::Receive
implementation for the SX128x
type Info = PacketInfo
Receive info structure
type Error = Error<CommsError, PinError>
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> Rssi for Sx128x<Hal, CommsError, PinError> where
Hal: Hal<CommsError, PinError>,
[src]
Hal: Hal<CommsError, PinError>,
radio::Rssi
implementation for the SX128x
type Error = Error<CommsError, PinError>
Radio error
fn poll_rssi(&mut self) -> Result<i16, Error<CommsError, PinError>>
[src]
Poll for the current channel RSSI This should only be called when in receive mode
impl<Hal, CommsError, PinError> State for Sx128x<Hal, CommsError, PinError> where
Hal: Hal<CommsError, PinError>,
[src]
Hal: Hal<CommsError, PinError>,
radio::State
implementation for the SX128x
type State = State
Channel information
type Error = Error<CommsError, PinError>
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> Transmit for Sx128x<Hal, CommsError, PinError> where
Hal: Hal<CommsError, PinError>,
[src]
Hal: Hal<CommsError, PinError>,
radio::Transmit
implementation for the SX128x
Auto Trait Implementations
impl<Base, CommsError, PinError> RefUnwindSafe for Sx128x<Base, CommsError, PinError> where
Base: RefUnwindSafe,
CommsError: RefUnwindSafe,
PinError: RefUnwindSafe,
Base: RefUnwindSafe,
CommsError: RefUnwindSafe,
PinError: RefUnwindSafe,
impl<Base, CommsError, PinError> Send for Sx128x<Base, CommsError, PinError> where
Base: Send,
CommsError: Send,
PinError: Send,
Base: Send,
CommsError: Send,
PinError: Send,
impl<Base, CommsError, PinError> Sync for Sx128x<Base, CommsError, PinError> where
Base: Sync,
CommsError: Sync,
PinError: Sync,
Base: Sync,
CommsError: Sync,
PinError: Sync,
impl<Base, CommsError, PinError> Unpin for Sx128x<Base, CommsError, PinError> where
Base: Unpin,
CommsError: Unpin,
PinError: Unpin,
Base: Unpin,
CommsError: Unpin,
PinError: Unpin,
impl<Base, CommsError, PinError> UnwindSafe for Sx128x<Base, CommsError, PinError> where
Base: UnwindSafe,
CommsError: UnwindSafe,
PinError: UnwindSafe,
Base: UnwindSafe,
CommsError: 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
E: Debug,
I: Debug,
T: Receive<Info = I, Error = E> + DelayMs<u32>,
[src]
E: Debug,
I: Debug,
T: Receive<Info = I, Error = E> + DelayMs<u32>,
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
E: Debug,
S: Debug + PartialEq<S> + Copy,
T: State<State = S, Error = E> + DelayMs<u32>,
[src]
E: Debug,
S: Debug + PartialEq<S> + Copy,
T: State<State = S, Error = E> + DelayMs<u32>,
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
E: Debug,
T: Transmit<Error = E> + Power<Error = E> + DelayMs<u32>,
[src]
E: Debug,
T: Transmit<Error = E> + Power<Error = E> + DelayMs<u32>,
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,
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, 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>,