stm32-metapac

Crates

git

Versions

stm32h743zg

Flavors

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

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

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

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 StructuralPartialEq for Cfgr

Auto Trait Implementations§

§

impl Freeze for Cfgr

§

impl RefUnwindSafe for Cfgr

§

impl Send for Cfgr

§

impl Sync for Cfgr

§

impl Unpin for Cfgr

§

impl UnwindSafe for Cfgr

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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>,

source§

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>,

source§

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.