Struct stm32wlxx_hal::subghz::TcxoMode
source · pub struct TcxoMode { /* private fields */ }
Expand description
TCXO trim and HSE32 ready timeout.
Argument of set_tcxo_mode
.
Implementations§
source§impl TcxoMode
impl TcxoMode
sourcepub const fn new() -> TcxoMode
pub const fn new() -> TcxoMode
Create a new TcxoMode
struct.
This is the same as default
, but in a const
function.
Example
use stm32wlxx_hal::subghz::TcxoMode;
const TCXO_MODE: TcxoMode = TcxoMode::new();
sourcepub const fn set_tcxo_trim(self, tcxo_trim: TcxoTrim) -> TcxoMode
pub const fn set_tcxo_trim(self, tcxo_trim: TcxoTrim) -> TcxoMode
Set the TCXO trim.
Note: To use VDDTCXO, the VDDRF supply must be
at least + 200 mV higher than the selected TcxoTrim
voltage level.
Example
use stm32wlxx_hal::subghz::{TcxoMode, TcxoTrim};
const TCXO_MODE: TcxoMode = TcxoMode::new().set_tcxo_trim(TcxoTrim::Volts1pt6);
sourcepub const fn set_timeout(self, timeout: Timeout) -> TcxoMode
pub const fn set_timeout(self, timeout: Timeout) -> TcxoMode
Set the ready timeout duration.
Example
use core::time::Duration;
use stm32wlxx_hal::subghz::{TcxoMode, Timeout};
// 15.625 ms timeout
const TIMEOUT: Timeout = Timeout::from_duration_sat(Duration::from_millis(15_625));
const TCXO_MODE: TcxoMode = TcxoMode::new().set_timeout(TIMEOUT);
sourcepub const fn as_slice(&self) -> &[u8]
pub const fn as_slice(&self) -> &[u8]
Extracts a slice containing the packet.
Example
use stm32wlxx_hal::subghz::{TcxoMode, TcxoTrim, Timeout};
const TCXO_MODE: TcxoMode = TcxoMode::new()
.set_tcxo_trim(TcxoTrim::Volts1pt7)
.set_timeout(Timeout::from_raw(0x123456));
assert_eq!(TCXO_MODE.as_slice(), &[0x97, 0x1, 0x12, 0x34, 0x56]);
Trait Implementations§
source§impl PartialEq for TcxoMode
impl PartialEq for TcxoMode
impl Copy for TcxoMode
impl Eq for TcxoMode
impl StructuralEq for TcxoMode
impl StructuralPartialEq for TcxoMode
Auto Trait Implementations§
impl RefUnwindSafe for TcxoMode
impl Send for TcxoMode
impl Sync for TcxoMode
impl Unpin for TcxoMode
impl UnwindSafe for TcxoMode
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