Struct cc1101::Cc1101

source ·
pub struct Cc1101<SPI>(/* private fields */);
Expand description

High level API for interacting with the CC1101 radio chip.

Implementations§

source§

impl<SPI, SpiE> Cc1101<SPI>
where SPI: SpiDevice<u8, Error = SpiE>,

source

pub fn new(spi: SPI) -> Result<Self, Error<SpiE>>

source

pub fn set_frequency(&mut self, hz: u64) -> Result<(), Error<SpiE>>

Sets the carrier frequency (in Hertz).

source

pub fn set_synthesizer_if(&mut self, hz: u64) -> Result<(), Error<SpiE>>

Sets the frequency synthesizer intermediate frequency (in Hertz).

source

pub fn set_agc_target( &mut self, target: TargetAmplitude ) -> Result<(), Error<SpiE>>

Sets the target value for the averaged amplitude from the digital channel filter.

source

pub fn set_agc_filter_length( &mut self, filter_length: FilterLength ) -> Result<(), Error<SpiE>>

Sets the filter length (in FSK/MSK mode) or decision boundary (in OOK/ASK mode) for the AGC.

source

pub fn set_autocalibration( &mut self, autocal: AutoCalibration ) -> Result<(), Error<SpiE>>

Configures when to run automatic calibration.

source

pub fn set_deviation(&mut self, deviation: u64) -> Result<(), Error<SpiE>>

source

pub fn set_data_rate(&mut self, baud: u64) -> Result<(), Error<SpiE>>

Sets the data rate (in bits per second).

source

pub fn set_chanbw(&mut self, bandwidth: u64) -> Result<(), Error<SpiE>>

Sets the channel bandwidth (in Hertz).

source

pub fn get_hw_info(&mut self) -> Result<(u8, u8), Error<SpiE>>

source

pub fn get_rssi_dbm(&mut self) -> Result<i16, Error<SpiE>>

Received Signal Strength Indicator is an estimate of the signal power level in the chosen channel.

source

pub fn get_lqi(&mut self) -> Result<u8, Error<SpiE>>

The Link Quality Indicator metric of the current quality of the received signal.

source

pub fn set_sync_mode(&mut self, sync_mode: SyncMode) -> Result<(), Error<SpiE>>

Configure the sync word to use, and at what level it should be verified.

source

pub fn set_modulation(&mut self, format: Modulation) -> Result<(), Error<SpiE>>

Configure signal modulation.

source

pub fn set_address_filter( &mut self, filter: AddressFilter ) -> Result<(), Error<SpiE>>

Configure device address, and address filtering.

source

pub fn set_packet_length( &mut self, length: PacketLength ) -> Result<(), Error<SpiE>>

Configure packet mode, and length.

source

pub fn set_radio_mode( &mut self, radio_mode: RadioMode ) -> Result<(), Error<SpiE>>

Set radio in Receive/Transmit/Idle/Calibrate mode.

source

pub fn reset(&mut self) -> Result<(), Error<SpiE>>

Resets the chip.

source

pub fn set_defaults(&mut self) -> Result<(), Error<SpiE>>

Configure some default settings, to be removed in the future.

source

pub fn receive( &mut self, addr: &mut u8, buf: &mut [u8] ) -> Result<u8, Error<SpiE>>

source

pub fn set_raw_mode(&mut self) -> Result<(), Error<SpiE>>

Configures raw data to be passed through, without any packet handling.

Auto Trait Implementations§

§

impl<SPI> RefUnwindSafe for Cc1101<SPI>
where SPI: RefUnwindSafe,

§

impl<SPI> Send for Cc1101<SPI>
where SPI: Send,

§

impl<SPI> Sync for Cc1101<SPI>
where SPI: Sync,

§

impl<SPI> Unpin for Cc1101<SPI>
where SPI: Unpin,

§

impl<SPI> UnwindSafe for Cc1101<SPI>
where SPI: 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<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>,

§

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>,

§

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.