[−][src]Struct radio_sx127x::Sx127x
Sx127x device object
Operating functions are implemented as traits from the radio package
Methods
impl<Base, CommsError, PinError> Sx127x<Base, CommsError, PinError> where
Base: Sx127xBase<CommsError, PinError>,
[src]
Base: Sx127xBase<CommsError, PinError>,
pub fn fsk_configure(
&mut self,
config: &FskConfig,
channel: &FskChannel
) -> Result<(), Error<CommsError, PinError>>
[src]
&mut self,
config: &FskConfig,
channel: &FskChannel
) -> Result<(), Error<CommsError, PinError>>
impl<Base, CommsError, PinError> Sx127x<Base, CommsError, PinError> where
Base: Sx127xBase<CommsError, PinError>,
[src]
Base: Sx127xBase<CommsError, PinError>,
pub fn lora_configure(
&mut self,
config: &LoRaConfig,
channel: &LoRaChannel
) -> Result<(), Error<CommsError, PinError>>
[src]
&mut self,
config: &LoRaConfig,
channel: &LoRaChannel
) -> Result<(), Error<CommsError, PinError>>
Configure the radio in lora mode with the provided configuration and channel
impl<Spi, CommsError, Output, Input, PinError, Delay> Sx127x<SpiWrapper<Spi, CommsError, Output, Input, 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 Sx127x with the provided SPI implementation and pins
impl<Base, CommsError, PinError> Sx127x<Base, CommsError, PinError> where
Base: Base<CommsError, PinError>,
[src]
Base: Base<CommsError, PinError>,
pub fn new(
hal: Base,
config: &Config
) -> Result<Self, Error<CommsError, PinError>>
[src]
hal: Base,
config: &Config
) -> Result<Self, Error<CommsError, PinError>>
Create a new radio instance over an arbitrary base::Base implementation
pub fn configure(
&mut self,
config: &Config
) -> Result<(), Error<CommsError, PinError>>
[src]
&mut self,
config: &Config
) -> Result<(), Error<CommsError, PinError>>
(re)apply device configuration
pub fn silicon_version(&mut self) -> Result<u8, Error<CommsError, PinError>>
[src]
Fetch device silicon version
impl<Base, CommsError, PinError> Sx127x<Base, CommsError, PinError> where
Base: Base<CommsError, PinError>,
[src]
Base: Base<CommsError, PinError>,
pub fn read_reg<R>(&mut self, reg: R) -> Result<u8, Error<CommsError, PinError>> where
R: Copy + Clone + Into<u8>,
[src]
R: Copy + Clone + Into<u8>,
Read a u8 value from the specified register
pub fn write_reg<R>(
&mut self,
reg: R,
value: u8
) -> Result<(), Error<CommsError, PinError>> where
R: Copy + Clone + Into<u8>,
[src]
&mut self,
reg: R,
value: u8
) -> Result<(), Error<CommsError, PinError>> where
R: Copy + Clone + Into<u8>,
Write a u8 value to the specified register
pub fn update_reg<R>(
&mut self,
reg: R,
mask: u8,
value: u8
) -> Result<u8, Error<CommsError, PinError>> where
R: Copy + Clone + Into<u8>,
[src]
&mut self,
reg: R,
mask: u8,
value: u8
) -> Result<u8, Error<CommsError, PinError>> where
R: Copy + Clone + Into<u8>,
Update the specified register with the provided (value & mask)
Trait Implementations
impl<Base, CommsError, PinError> DelayMs<u32> for Sx127x<Base, CommsError, PinError> where
Base: Base<CommsError, PinError>,
[src]
Base: Base<CommsError, PinError>,
impl<Base, CommsError, PinError> Transmit for Sx127x<Base, CommsError, PinError> where
Base: Base<CommsError, PinError>,
[src]
Base: Base<CommsError, PinError>,
type Error = Error<CommsError, PinError>
Radio error
fn start_transmit(&mut self, data: &[u8]) -> Result<(), Self::Error>
[src]
Start sending a packet
fn check_transmit(&mut self) -> Result<bool, Error<CommsError, PinError>>
[src]
Check for transmission completion This method should be polled (or checked following and interrupt) to indicate sending has completed
impl<Base, CommsError, PinError> Power for Sx127x<Base, CommsError, PinError> where
Base: Base<CommsError, PinError>,
[src]
Base: Base<CommsError, PinError>,
type Error = Error<CommsError, PinError>
Radio error type
fn set_power(&mut self, power: i8) -> Result<(), Error<CommsError, PinError>>
[src]
Set transmit power (using the existing PaConfig
)
impl<Base, CommsError, PinError> Receive for Sx127x<Base, CommsError, PinError> where
Base: Base<CommsError, PinError>,
[src]
Base: Base<CommsError, PinError>,
type Info = PacketInfo
Packet received info
type Error = Error<CommsError, PinError>
Radio error
fn start_receive(&mut self) -> Result<(), Self::Error>
[src]
Start receive mode
fn check_receive(&mut self, restart: bool) -> Result<bool, Self::Error>
[src]
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.
fn get_received(
&mut self,
info: &mut Self::Info,
data: &mut [u8]
) -> Result<usize, Self::Error>
[src]
&mut self,
info: &mut Self::Info,
data: &mut [u8]
) -> Result<usize, 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
impl<Base, CommsError, PinError> State for Sx127x<Base, CommsError, PinError> where
Base: Base<CommsError, PinError>,
[src]
Base: Base<CommsError, PinError>,
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<Base, CommsError, PinError> Channel for Sx127x<Base, CommsError, PinError> where
Base: Base<CommsError, PinError>,
[src]
Base: Base<CommsError, PinError>,
type Channel = Channel
Channel information
type Error = Error<CommsError, PinError>
Radio error type
fn set_channel(
&mut self,
channel: &Self::Channel
) -> Result<(), Error<CommsError, PinError>>
[src]
&mut self,
channel: &Self::Channel
) -> Result<(), Error<CommsError, PinError>>
Set the LoRa mode channel for future receive or transmit operations
impl<Base, CommsError, PinError> Rssi for Sx127x<Base, CommsError, PinError> where
Base: Base<CommsError, PinError>,
[src]
Base: Base<CommsError, PinError>,
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 in receive mode
impl<Base, CommsError, PinError> Interrupts for Sx127x<Base, CommsError, PinError> where
Base: Base<CommsError, PinError>,
[src]
Base: Base<CommsError, PinError>,
type Irq = Interrupts
Interrupt object
type Error = Error<CommsError, PinError>
Radio error
fn get_interrupts(&mut self, clear: bool) -> Result<Self::Irq, Self::Error>
[src]
Fetch pending interrupts from the device If the clear option is set, this will also clear any pending flags
Auto Trait Implementations
impl<Base, CommsError, PinError> Unpin for Sx127x<Base, CommsError, PinError> where
Base: Unpin,
CommsError: Unpin,
PinError: Unpin,
Base: Unpin,
CommsError: Unpin,
PinError: Unpin,
impl<Base, CommsError, PinError> Send for Sx127x<Base, CommsError, PinError> where
Base: Send,
CommsError: Send,
PinError: Send,
Base: Send,
CommsError: Send,
PinError: Send,
impl<Base, CommsError, PinError> Sync for Sx127x<Base, CommsError, PinError> where
Base: Sync,
CommsError: Sync,
PinError: Sync,
Base: Sync,
CommsError: Sync,
PinError: Sync,
impl<Base, CommsError, PinError> UnwindSafe for Sx127x<Base, CommsError, PinError> where
Base: UnwindSafe,
CommsError: UnwindSafe,
PinError: UnwindSafe,
Base: UnwindSafe,
CommsError: UnwindSafe,
PinError: UnwindSafe,
impl<Base, CommsError, PinError> RefUnwindSafe for Sx127x<Base, CommsError, PinError> where
Base: RefUnwindSafe,
CommsError: RefUnwindSafe,
PinError: RefUnwindSafe,
Base: RefUnwindSafe,
CommsError: RefUnwindSafe,
PinError: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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, 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>>