Struct radio_sx128x::Sx128x[][src]

pub struct Sx128x<Base, CommsError, PinError, DelayError> { /* fields omitted */ }

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]

pub fn spi(
    spi: Spi,
    cs: CsPin,
    busy: BusyPin,
    ready: ReadyPin,
    sdn: SdnPin,
    delay: Delay,
    config: &Config
) -> Result<Self, Error<CommsError, PinError, DelayError>>
[src]

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]

pub fn new(
    hal: Hal,
    config: &Config
) -> Result<Self, Error<CommsError, PinError, DelayError>>
[src]

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]

pub fn firmware_version(
    &mut self
) -> Result<u16, Error<CommsError, PinError, DelayError>>
[src]

pub fn set_frequency(
    &mut self,
    f: u32
) -> Result<(), Error<CommsError, PinError, DelayError>>
[src]

pub fn set_irq_mask(
    &mut self,
    irq: Irq
) -> Result<(), Error<CommsError, PinError, DelayError>>
[src]

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]

Set the IRQ and DIO masks

pub fn calibrate(
    &mut self,
    c: CalibrationParams
) -> Result<(), Error<CommsError, PinError, DelayError>>
[src]

pub fn set_syncword(
    &mut self,
    index: u8,
    value: &[u8]
) -> Result<(), Error<CommsError, PinError, DelayError>>
[src]

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]

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]

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]

type Error = DelayError

Enumeration of DelayMs errors

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]

type Error = DelayError

Enumeration of DelayMs errors

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]

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]

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]

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]

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]

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]

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]

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]

radio::Transmit implementation for the SX128x

type Error = Error<CommsError, PinError, DelayError>

Radio error

fn start_transmit(&mut self, data: &[u8]) -> Result<(), Self::Error>[src]

Start transmitting a packet

fn check_transmit(&mut self) -> Result<bool, Self::Error>[src]

Check for transmit completion

Auto Trait Implementations

impl<Base, CommsError, PinError, DelayError> RefUnwindSafe for Sx128x<Base, CommsError, PinError, DelayError> where
    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

impl<Base, CommsError, PinError, DelayError> Sync for Sx128x<Base, CommsError, PinError, DelayError> where
    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

impl<Base, CommsError, PinError, DelayError> UnwindSafe for Sx128x<Base, CommsError, PinError, DelayError> where
    Base: UnwindSafe,
    CommsError: UnwindSafe,
    DelayError: UnwindSafe,
    PinError: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, I, E> BlockingReceive<I, E> for T where
    T: Receive<Info = I, Error = E> + DelayUs<u32>,
    E: Debug,
    I: Debug
[src]

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]

impl<T, E> BlockingTransmit<E> for T where
    T: Transmit<Error = E> + DelayUs<u32>,
    E: Debug
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.