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>
impl<SPI, SpiE> Cc1101<SPI>
pub fn new(spi: SPI) -> Result<Self, Error<SpiE>>
sourcepub fn set_frequency(&mut self, hz: u64) -> Result<(), Error<SpiE>>
pub fn set_frequency(&mut self, hz: u64) -> Result<(), Error<SpiE>>
Sets the carrier frequency (in Hertz).
sourcepub fn set_synthesizer_if(&mut self, hz: u64) -> Result<(), Error<SpiE>>
pub fn set_synthesizer_if(&mut self, hz: u64) -> Result<(), Error<SpiE>>
Sets the frequency synthesizer intermediate frequency (in Hertz).
sourcepub fn set_agc_target(
&mut self,
target: TargetAmplitude
) -> Result<(), Error<SpiE>>
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.
sourcepub fn set_agc_filter_length(
&mut self,
filter_length: FilterLength
) -> Result<(), Error<SpiE>>
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.
sourcepub fn set_autocalibration(
&mut self,
autocal: AutoCalibration
) -> Result<(), Error<SpiE>>
pub fn set_autocalibration( &mut self, autocal: AutoCalibration ) -> Result<(), Error<SpiE>>
Configures when to run automatic calibration.
pub fn set_deviation(&mut self, deviation: u64) -> Result<(), Error<SpiE>>
sourcepub fn set_data_rate(&mut self, baud: u64) -> Result<(), Error<SpiE>>
pub fn set_data_rate(&mut self, baud: u64) -> Result<(), Error<SpiE>>
Sets the data rate (in bits per second).
sourcepub fn set_chanbw(&mut self, bandwidth: u64) -> Result<(), Error<SpiE>>
pub fn set_chanbw(&mut self, bandwidth: u64) -> Result<(), Error<SpiE>>
Sets the channel bandwidth (in Hertz).
pub fn get_hw_info(&mut self) -> Result<(u8, u8), Error<SpiE>>
sourcepub fn get_rssi_dbm(&mut self) -> Result<i16, Error<SpiE>>
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.
sourcepub fn get_lqi(&mut self) -> Result<u8, Error<SpiE>>
pub fn get_lqi(&mut self) -> Result<u8, Error<SpiE>>
The Link Quality Indicator metric of the current quality of the received signal.
sourcepub fn set_sync_mode(&mut self, sync_mode: SyncMode) -> Result<(), Error<SpiE>>
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.
sourcepub fn set_modulation(&mut self, format: Modulation) -> Result<(), Error<SpiE>>
pub fn set_modulation(&mut self, format: Modulation) -> Result<(), Error<SpiE>>
Configure signal modulation.
sourcepub fn set_address_filter(
&mut self,
filter: AddressFilter
) -> Result<(), Error<SpiE>>
pub fn set_address_filter( &mut self, filter: AddressFilter ) -> Result<(), Error<SpiE>>
Configure device address, and address filtering.
sourcepub fn set_packet_length(
&mut self,
length: PacketLength
) -> Result<(), Error<SpiE>>
pub fn set_packet_length( &mut self, length: PacketLength ) -> Result<(), Error<SpiE>>
Configure packet mode, and length.
sourcepub fn set_radio_mode(
&mut self,
radio_mode: RadioMode
) -> Result<(), Error<SpiE>>
pub fn set_radio_mode( &mut self, radio_mode: RadioMode ) -> Result<(), Error<SpiE>>
Set radio in Receive/Transmit/Idle/Calibrate mode.
sourcepub fn set_defaults(&mut self) -> Result<(), Error<SpiE>>
pub fn set_defaults(&mut self) -> Result<(), Error<SpiE>>
Configure some default settings, to be removed in the future.
pub fn receive( &mut self, addr: &mut u8, buf: &mut [u8] ) -> Result<u8, Error<SpiE>>
sourcepub fn set_raw_mode(&mut self) -> Result<(), Error<SpiE>>
pub fn set_raw_mode(&mut self) -> Result<(), Error<SpiE>>
Configures raw data to be passed through, without any packet handling.