Struct stm32wlxx_hal::subghz::BitSync
source · pub struct BitSync { /* private fields */ }
Expand description
Bit synchronization.
This must be cleared to 0x00
(the reset value) when using packet types
other than LoRa.
Argument of set_bit_sync
.
Implementations§
source§impl BitSync
impl BitSync
sourcepub const fn from_raw(raw: u8) -> Self
pub const fn from_raw(raw: u8) -> Self
Create a new BitSync
structure from a raw value.
Reserved bits will be masked.
sourcepub const fn set_simple_bit_sync_en(self, en: bool) -> BitSync
pub const fn set_simple_bit_sync_en(self, en: bool) -> BitSync
LoRa simple bit synchronization enable.
Example
Enable simple bit synchronization.
use stm32wlxx_hal::subghz::BitSync;
const BIT_SYNC: BitSync = BitSync::RESET.set_simple_bit_sync_en(true);
sourcepub const fn simple_bit_sync_en(&self) -> bool
pub const fn simple_bit_sync_en(&self) -> bool
Returns true
if simple bit synchronization is enabled.
Example
use stm32wlxx_hal::subghz::BitSync;
let bs: BitSync = BitSync::RESET;
assert_eq!(bs.simple_bit_sync_en(), false);
let bs: BitSync = bs.set_simple_bit_sync_en(true);
assert_eq!(bs.simple_bit_sync_en(), true);
let bs: BitSync = bs.set_simple_bit_sync_en(false);
assert_eq!(bs.simple_bit_sync_en(), false);
sourcepub const fn set_rx_data_inv(self, inv: bool) -> BitSync
pub const fn set_rx_data_inv(self, inv: bool) -> BitSync
LoRa RX data inversion.
Example
Invert receive data.
use stm32wlxx_hal::subghz::BitSync;
const BIT_SYNC: BitSync = BitSync::RESET.set_rx_data_inv(true);
sourcepub const fn rx_data_inv(&self) -> bool
pub const fn rx_data_inv(&self) -> bool
Returns true
if LoRa RX data is inverted.
Example
use stm32wlxx_hal::subghz::BitSync;
let bs: BitSync = BitSync::RESET;
assert_eq!(bs.rx_data_inv(), false);
let bs: BitSync = bs.set_rx_data_inv(true);
assert_eq!(bs.rx_data_inv(), true);
let bs: BitSync = bs.set_rx_data_inv(false);
assert_eq!(bs.rx_data_inv(), false);
sourcepub const fn set_norm_bit_sync_en(self, en: bool) -> BitSync
pub const fn set_norm_bit_sync_en(self, en: bool) -> BitSync
LoRa normal bit synchronization enable.
Example
Enable normal bit synchronization.
use stm32wlxx_hal::subghz::BitSync;
const BIT_SYNC: BitSync = BitSync::RESET.set_norm_bit_sync_en(true);
sourcepub const fn norm_bit_sync_en(&self) -> bool
pub const fn norm_bit_sync_en(&self) -> bool
Returns true
if normal bit synchronization is enabled.
Example
use stm32wlxx_hal::subghz::BitSync;
let bs: BitSync = BitSync::RESET;
assert_eq!(bs.norm_bit_sync_en(), false);
let bs: BitSync = bs.set_norm_bit_sync_en(true);
assert_eq!(bs.norm_bit_sync_en(), true);
let bs: BitSync = bs.set_norm_bit_sync_en(false);
assert_eq!(bs.norm_bit_sync_en(), false);
Trait Implementations§
source§impl PartialEq for BitSync
impl PartialEq for BitSync
impl Copy for BitSync
impl Eq for BitSync
impl StructuralEq for BitSync
impl StructuralPartialEq for BitSync
Auto Trait Implementations§
impl RefUnwindSafe for BitSync
impl Send for BitSync
impl Sync for BitSync
impl Unpin for BitSync
impl UnwindSafe for BitSync
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more