stm32-metapac

Crates

git

Versions

stm32h7s7l8

Flavors

๐Ÿ“ฃ We want to hear from you! Fill the Rust Embedded 2024 micro-survey.

Struct stm32_metapac::lptim::regs::Cfgr

#[repr(transparent)]
pub struct Cfgr(pub u32);
Expand description

LPTIM configuration register.

Tuple Fieldsยง

ยง0: u32

Implementationsยง

ยง

impl Cfgr

pub const fn cksel(&self) -> ClockSource

Clock selector The CKSEL bit selects which clock source the LPTIM uses:.

pub fn set_cksel(&mut self, val: ClockSource)

Clock selector The CKSEL bit selects which clock source the LPTIM uses:.

pub const fn ckpol(&self) -> Ckpol

Clock Polarity When the LPTIM is clocked by an external clock source, CKPOL bits is used to configure the active edge or edges used by the counter: If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 1 is active. If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 2 is active. Refer to for more details about Encoder mode sub-modes.

pub fn set_ckpol(&mut self, val: Ckpol)

Clock Polarity When the LPTIM is clocked by an external clock source, CKPOL bits is used to configure the active edge or edges used by the counter: If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 1 is active. If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 2 is active. Refer to for more details about Encoder mode sub-modes.

pub const fn ckflt(&self) -> Filter

Configurable digital filter for external clock The CKFLT value sets the number of consecutive equal samples that should be detected when a level change occurs on an external clock signal before it is considered as a valid level transition. An internal clock source must be present to use this feature.

pub fn set_ckflt(&mut self, val: Filter)

Configurable digital filter for external clock The CKFLT value sets the number of consecutive equal samples that should be detected when a level change occurs on an external clock signal before it is considered as a valid level transition. An internal clock source must be present to use this feature.

pub const fn trgflt(&self) -> Filter

Configurable digital filter for trigger The TRGFLT value sets the number of consecutive equal samples that should be detected when a level change occurs on an internal trigger before it is considered as a valid level transition. An internal clock source must be present to use this feature.

pub fn set_trgflt(&mut self, val: Filter)

Configurable digital filter for trigger The TRGFLT value sets the number of consecutive equal samples that should be detected when a level change occurs on an internal trigger before it is considered as a valid level transition. An internal clock source must be present to use this feature.

pub const fn presc(&self) -> Presc

Clock prescaler The PRESC bits configure the prescaler division factor. It can be one among the following division factors:.

pub fn set_presc(&mut self, val: Presc)

Clock prescaler The PRESC bits configure the prescaler division factor. It can be one among the following division factors:.

pub const fn trigsel(&self) -> u8

Trigger selector The TRIGSEL bits select the trigger source that serves as a trigger event for the LPTIM among the below 8 available sources: See for details.

pub fn set_trigsel(&mut self, val: u8)

Trigger selector The TRIGSEL bits select the trigger source that serves as a trigger event for the LPTIM among the below 8 available sources: See for details.

pub const fn trigen(&self) -> Trigen

Trigger enable and polarity The TRIGEN bits controls whether the LPTIM counter is started by an external trigger or not. If the external trigger option is selected, three configurations are possible for the trigger active edge:.

pub fn set_trigen(&mut self, val: Trigen)

Trigger enable and polarity The TRIGEN bits controls whether the LPTIM counter is started by an external trigger or not. If the external trigger option is selected, three configurations are possible for the trigger active edge:.

pub const fn timout(&self) -> bool

Timeout enable The TIMOUT bit controls the Timeout feature.

pub fn set_timout(&mut self, val: bool)

Timeout enable The TIMOUT bit controls the Timeout feature.

pub const fn wave(&self) -> bool

Waveform shape The WAVE bit controls the output shape.

pub fn set_wave(&mut self, val: bool)

Waveform shape The WAVE bit controls the output shape.

pub const fn wavpol(&self) -> Wavpol

Waveform shape polarity The WAVEPOL bit controls the output polarity Note: If the LPTIM implements at least one capture/compare channel, this bit is reserved. Please refer to.

pub fn set_wavpol(&mut self, val: Wavpol)

Waveform shape polarity The WAVEPOL bit controls the output polarity Note: If the LPTIM implements at least one capture/compare channel, this bit is reserved. Please refer to.

pub const fn preload(&self) -> bool

Registers update mode The PRELOAD bit controls the LPTIM_ARR, LPTIM_RCR and the LPTIM_CCRx registers update modality.

pub fn set_preload(&mut self, val: bool)

Registers update mode The PRELOAD bit controls the LPTIM_ARR, LPTIM_RCR and the LPTIM_CCRx registers update modality.

pub const fn countmode(&self) -> ClockSource

counter mode enabled The COUNTMODE bit selects which clock source is used by the LPTIM to clock the counter:.

pub fn set_countmode(&mut self, val: ClockSource)

counter mode enabled The COUNTMODE bit selects which clock source is used by the LPTIM to clock the counter:.

pub const fn enc(&self) -> bool

Encoder mode enable The ENC bit controls the Encoder mode Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to.

pub fn set_enc(&mut self, val: bool)

Encoder mode enable The ENC bit controls the Encoder mode Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to.

Trait Implementationsยง

ยง

impl Clone for Cfgr

ยง

fn clone(&self) -> Cfgr

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
ยง

impl Default for Cfgr

ยง

fn default() -> Cfgr

Returns the โ€œdefault valueโ€ for a type. Read more
ยง

impl PartialEq for Cfgr

ยง

fn eq(&self, other: &Cfgr) -> 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.
ยง

impl Copy for Cfgr

ยง

impl Eq for Cfgr

ยง

impl StructuralEq for Cfgr

ยง

impl StructuralPartialEq for Cfgr

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> 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, U> TryFrom<U> for T
where 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 T
where 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.