pub struct TcxoMode { /* private fields */ }
Expand description

TCXO trim and HSE32 ready timeout.

Argument of set_tcxo_mode.

Implementations§

source§

impl TcxoMode

source

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();
source

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);
source

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);
source

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 Clone for TcxoMode

source§

fn clone(&self) -> TcxoMode

Returns a copy 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 TcxoMode

source§

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

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

impl Default for TcxoMode

source§

fn default() -> Self

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

impl PartialEq for TcxoMode

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for TcxoMode

source§

impl Eq for TcxoMode

source§

impl StructuralEq for TcxoMode

source§

impl StructuralPartialEq for TcxoMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.