Skip to main content

Error

Enum Error 

Source
pub enum Error<SpiError> {
    Spi(SpiError),
    RxFifoOverflow,
    TxFifoUnderflow,
    CrcError,
    PayloadTooLong,
    InvalidChip {
        part: u8,
        version: u8,
    },
    UnexpectedState {
        state: u8,
    },
}
Expand description

All errors that can be returned by the CC1101 driver.

Variants§

§

Spi(SpiError)

An error occurred on the SPI bus

§

RxFifoOverflow

The RX FIFO overflowed before we could read it. The driver will automatically flush the FIFO and return to IDLE.

§

TxFifoUnderflow

The TX FIFO underflowed during transmission.

§

CrcError

A packet was received but the hardware CRC check failed. Only returned when crc_enable is set in [RadioConfig].

§

PayloadTooLong

The provided payload exceeds the maximum packet length. For variable-length mode, max is 61 bytes; fixed-length is set at config time.

§

InvalidChip

The chip did not respond correctly during initialisation. Check your SPI wiring and that the CC1101 is powered.

Fields

§part: u8

Raw value of the PARTNUM status register (expected 0x00)

§version: u8

Raw value of the VERSION status register (expected 0x04 or 0x14)

§

UnexpectedState

The chip was in an unexpected state when an operation was attempted.

Fields

§state: u8

Raw MARCSTATE register value at the time of the error

Trait Implementations§

Source§

impl<SpiError: Debug> Debug for Error<SpiError>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E> From<E> for Error<E>

Source§

fn from(e: E) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<SpiError> Freeze for Error<SpiError>
where SpiError: Freeze,

§

impl<SpiError> RefUnwindSafe for Error<SpiError>
where SpiError: RefUnwindSafe,

§

impl<SpiError> Send for Error<SpiError>
where SpiError: Send,

§

impl<SpiError> Sync for Error<SpiError>
where SpiError: Sync,

§

impl<SpiError> Unpin for Error<SpiError>
where SpiError: Unpin,

§

impl<SpiError> UnsafeUnpin for Error<SpiError>
where SpiError: UnsafeUnpin,

§

impl<SpiError> UnwindSafe for Error<SpiError>
where SpiError: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.