Struct cc1101_rust::config::RXConfig [−][src]
#[repr(C)]pub struct RXConfig { /* fields omitted */ }Expand description
Configuration values specific to receive
Implementations
pub fn new(
frequency: f32,
modulation: Modulation,
baud_rate: f32,
packet_length: u32,
deviation: Option<f32>,
sync_word: Option<u32>,
bandwidth: Option<f32>,
carrier_sense: Option<CarrierSense>,
max_lna_gain: Option<u8>,
max_dvga_gain: Option<u8>,
magn_target: Option<u8>
) -> Result<RXConfig, CC1101Error>
pub fn new(
frequency: f32,
modulation: Modulation,
baud_rate: f32,
packet_length: u32,
deviation: Option<f32>,
sync_word: Option<u32>,
bandwidth: Option<f32>,
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)?;Get the common configuration elements
Get a mutable reference to the common configuration elements
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
Get the configured bandwidth
pub fn set_carrier_sense(
&mut self,
carrier_sense: Option<CarrierSense>
) -> Result<(), CC1101Error>
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.
Get the configured carrier sense
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
Get the configured maximum LNA gain
Sets the amount to decrease the maximum DVGA gain by approximately the specified amount in dB.
Valid values are 0, 6, 12, 18
Get the configured maximum DVGA gain
Sets the target channel filter amplitude in dB
Valid values are 24, 27, 30, 33, 36, 38, 40, 42
Get the configured maximum DVGA gain
Set the length of packets to receive in bytes
Get the configured packet length
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for RXConfig
impl UnwindSafe for RXConfig
Blanket Implementations
Mutably borrows from an owned value. Read more