Struct RXConfig

Source
#[repr(C)]
pub struct RXConfig { /* private fields */ }
Expand description

Configuration values specific to receive

Implementations§

Source§

impl RXConfig

Source

pub fn new( frequency: f32, modulation: Modulation, baud_rate: f32, packet_length: u32, deviation: Option<f32>, sync_word: Option<u32>, bandwidth: Option<u32>, carrier_sense: Option<CarrierSense>, max_lna_gain: Option<u8>, max_dvga_gain: Option<u8>, magn_target: Option<u8>, ) -> Result<RXConfig, CC1101Error>

Create a new receive configuration

See CommonConfig for valid argument values.

§Example
let config = RXConfig::new(433.92, Modulation::OOK, 1.0, 1024, None, None, None, None, None, None, None)?;
Source

pub fn get_common_config(&self) -> &CommonConfig

Get the common configuration elements

Source

pub fn get_common_config_mut(&mut self) -> &mut CommonConfig

Get a mutable reference to the common configuration elements

Source

pub fn set_bandwidth(&mut self, bandwidth: u32) -> Result<(), CC1101Error>

Set the configured bandwith in KHz

Valid values are 58,67,81,101,116,135,162,203,232,270,325,406,464,541,650,812

Source

pub fn get_bandwith(&self) -> u32

Get the configured bandwidth

Source

pub fn set_carrier_sense( &mut self, carrier_sense: Option<CarrierSense>, ) -> Result<(), CC1101Error>

Sets the carrier sense threshold in dB.

For CarrierSense::Relative an increase of 6, 10 or 14 dB can be specified. This will begin RX on a sudden increase in RSSI greather than or equal to this value.

For CarrierSense::Absolute a value between -7 dB and 7 dB can be set. When RSSI exceeds magn_target +/- this value, packet RX will begin. max_lna_gain and max_dvga_gain will also require configuring to set the correct absolute RSSI value.

None disables carrier sense.

Source

pub fn get_carrier_sense(&self) -> Option<CarrierSense>

Get the configured carrier sense

Source

pub fn set_max_lna_gain(&mut self, max_lna_gain: u8) -> Result<(), CC1101Error>

Sets the amount to decrease the maximum LNA gain by approximately the specified amount in dB. Valid values are 0, 3, 6, 7, 9, 12, 15, 17

Source

pub fn get_max_lna_gain(&self) -> u8

Get the configured maximum LNA gain

Source

pub fn set_max_dvga_gain( &mut self, max_dvga_gain: u8, ) -> Result<(), CC1101Error>

Sets the amount to decrease the maximum DVGA gain by approximately the specified amount in dB. Valid values are 0, 6, 12, 18

Source

pub fn get_max_dvga_gain(&self) -> u8

Get the configured maximum DVGA gain

Source

pub fn set_magn_target(&mut self, magn_target: u8) -> Result<(), CC1101Error>

Sets the target channel filter amplitude in dB Valid values are 24, 27, 30, 33, 36, 38, 40, 42

Source

pub fn get_magn_target(&self) -> u8

Get the configured maximum DVGA gain

Source

pub fn set_packet_length(&mut self, packet_length: u32)

Set the length of packets to receive in bytes

Source

pub fn get_packet_length(&self) -> u32

Get the configured packet length

Trait Implementations§

Source§

impl Clone for RXConfig

Source§

fn clone(&self) -> RXConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RXConfig

Source§

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

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

impl Default for RXConfig

Source§

fn default() -> RXConfig

Returns the “default value” for a type. Read more
Source§

impl Display for RXConfig

Source§

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

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

impl PartialEq for RXConfig

Source§

fn eq(&self, other: &RXConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for RXConfig

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.