[−][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, LoRaConfig> where
Base: Sx127xBase<CommsError, PinError>,
[src]
Base: Sx127xBase<CommsError, PinError>,
pub fn configure(
&mut self,
config: &LoRaConfig
) -> Result<(), Error<CommsError, PinError>>
[src]
&mut self,
config: &LoRaConfig
) -> Result<(), Error<CommsError, PinError>>
Configure the radio in lora mode with the provided configuration
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,
settings: Settings
) -> Result<Self, Error<CommsError, PinError>>
[src]
spi: Spi,
cs: Output,
busy: Input,
sdn: Output,
delay: Delay,
settings: Settings
) -> 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,
settings: Settings
) -> Result<Self, Error<CommsError, PinError>>
[src]
hal: Base,
settings: Settings
) -> Result<Self, Error<CommsError, PinError>>
Create a new radio instance over an arbitrary base::Base implementation
pub fn lora(
self,
lora_config: LoRaConfig
) -> Result<Sx127x<Base, CommsError, PinError, LoRaConfig>, Error<CommsError, PinError>>
[src]
self,
lora_config: LoRaConfig
) -> Result<Sx127x<Base, CommsError, PinError, LoRaConfig>, Error<CommsError, PinError>>
Configure the modem into LoRa mode
impl<Base, CommsError, PinError, Config> Sx127x<Base, CommsError, PinError, Config> 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)
impl<Base, CommsError, PinError, Config> Sx127x<Base, CommsError, PinError, Config> where
Base: Base<CommsError, PinError>,
[src]
Base: Base<CommsError, PinError>,
pub fn silicon_version(&mut self) -> Result<u8, Error<CommsError, PinError>>
[src]
Fetch device silicon version
Trait Implementations
impl<Base, CommsError, PinError> Transmit for Sx127x<Base, CommsError, PinError, LoRaConfig> where
Base: Sx127xBase<CommsError, PinError>,
[src]
Base: Sx127xBase<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> Receive for Sx127x<Base, CommsError, PinError, LoRaConfig> where
Base: Sx127xBase<CommsError, PinError>,
[src]
Base: Sx127xBase<CommsError, PinError>,
type Info = Info
Packet received info
type Error = Error<CommsError, PinError>
Radio error
fn start_receive(&mut self) -> Result<(), Self::Error>
[src]
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, Config> State for Sx127x<Base, CommsError, PinError, Config> 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, LoRaConfig> where
Base: Sx127xBase<CommsError, PinError>,
[src]
Base: Sx127xBase<CommsError, PinError>,
type Channel = Channel
Channel information
type Error = Error<CommsError, PinError>
Radio error type
fn set_channel(
&mut self,
channel: &Channel
) -> Result<(), Error<CommsError, PinError>>
[src]
&mut self,
channel: &Channel
) -> Result<(), Error<CommsError, PinError>>
Set the LoRa mode channel for future receive or transmit operations
impl<Base, CommsError, PinError> Power for Sx127x<Base, CommsError, PinError, LoRaConfig> where
Base: Sx127xBase<CommsError, PinError>,
[src]
Base: Sx127xBase<CommsError, PinError>,
type Error = Error<CommsError, PinError>
Radio error type
fn set_power(&mut self, power: i8) -> Result<(), Error<CommsError, PinError>>
[src]
Set LoRa mode transmit power
impl<Base, CommsError, PinError> Rssi for Sx127x<Base, CommsError, PinError, LoRaConfig> where
Base: Sx127xBase<CommsError, PinError>,
[src]
Base: Sx127xBase<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, LoRaConfig> where
Base: Sx127xBase<CommsError, PinError>,
[src]
Base: Sx127xBase<CommsError, PinError>,
Auto Trait Implementations
impl<Base, CommsError, PinError, Config> Send for Sx127x<Base, CommsError, PinError, Config> where
Base: Send,
CommsError: Send,
Config: Send,
PinError: Send,
Base: Send,
CommsError: Send,
Config: Send,
PinError: Send,
impl<Base, CommsError, PinError, Config> Sync for Sx127x<Base, CommsError, PinError, Config> where
Base: Sync,
CommsError: Sync,
Config: Sync,
PinError: Sync,
Base: Sync,
CommsError: Sync,
Config: Sync,
PinError: Sync,
Blanket Implementations
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> From<T> for T
[src]
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,