nxp-pac

Crates

git

Versions

mcxa355

Flavors

Ctrl

Struct Ctrl 

Source
#[repr(transparent)]
pub struct Ctrl(pub u16);
Expand description

Control Register.

Tuple Fields§

§0: u16

Implementations§

Source§

impl Ctrl

Source

pub const fn ldok(&self) -> bool

Load Okay. Raw bit values: false (0) = Ldok0: No loading action taken. Users can write new values to buffered registers (writing into outer-set of these buffered registers).; true (1) = Ldok1: Outer-set values are ready to be loaded into inner-set and take effect. The loading time point depends on CTRL2[LDMOD].

Source

pub const fn set_ldok(&mut self, val: bool)

Load Okay. Raw bit values: false (0) = Ldok0: No loading action taken. Users can write new values to buffered registers (writing into outer-set of these buffered registers).; true (1) = Ldok1: Outer-set values are ready to be loaded into inner-set and take effect. The loading time point depends on CTRL2[LDMOD].

Source

pub const fn dmaen(&self) -> bool

DMA Enable. Raw bit values: false (0) = Dmaen0: DMA is disabled.; true (1) = Dmaen1: DMA is enabled. DMA request asserts automatically when the values in the outer-set of buffered compare registers (UCOMP0/LCOMP0;UCOMP1/LCOMP1;UCOMP2/LCOMP2;UCOMP3/LCOMP3), initial registers(UINIT/LINIT) and modulus registers (UMOD/LMOD) are loaded into the inner-set of buffer and then LDOK is cleared automatically. After the completion of this DMA transfer, LDOK is set automatically, it ensures outer-set values can be loaded into inner-set which in turn triggers DMA again.

Source

pub const fn set_dmaen(&mut self, val: bool)

DMA Enable. Raw bit values: false (0) = Dmaen0: DMA is disabled.; true (1) = Dmaen1: DMA is enabled. DMA request asserts automatically when the values in the outer-set of buffered compare registers (UCOMP0/LCOMP0;UCOMP1/LCOMP1;UCOMP2/LCOMP2;UCOMP3/LCOMP3), initial registers(UINIT/LINIT) and modulus registers (UMOD/LMOD) are loaded into the inner-set of buffer and then LDOK is cleared automatically. After the completion of this DMA transfer, LDOK is set automatically, it ensures outer-set values can be loaded into inner-set which in turn triggers DMA again.

Source

pub const fn wde(&self) -> bool

Watchdog Enable. Raw bit values: false (0) = Wde0: Disabled.; true (1) = Wde1: Enabled.

Source

pub const fn set_wde(&mut self, val: bool)

Watchdog Enable. Raw bit values: false (0) = Wde0: Disabled.; true (1) = Wde1: Enabled.

Source

pub const fn wdie(&self) -> bool

Watchdog Timeout Interrupt Enable. Raw bit values: false (0) = Wdie0: Disabled.; true (1) = Wdie1: Enabled.

Source

pub const fn set_wdie(&mut self, val: bool)

Watchdog Timeout Interrupt Enable. Raw bit values: false (0) = Wdie0: Disabled.; true (1) = Wdie1: Enabled.

Source

pub const fn wdirq(&self) -> bool

Watchdog Timeout Interrupt Request. Raw bit values: false (0) = Wdirq0: No Watchdog timeout interrupt has occurred.; true (1) = Wdirq1: Watchdog timeout interrupt has occurred.

Source

pub const fn set_wdirq(&mut self, val: bool)

Watchdog Timeout Interrupt Request. Raw bit values: false (0) = Wdirq0: No Watchdog timeout interrupt has occurred.; true (1) = Wdirq1: Watchdog timeout interrupt has occurred.

Source

pub const fn xne(&self) -> bool

Select Positive/Negative Edge of INDEX/PRESET Pulse. Raw bit values: false (0) = Xne0: Use positive edge of INDEX/PRESET pulse.; true (1) = Xne1: Use negative edge of INDEX/PRESET pulse.

Source

pub const fn set_xne(&mut self, val: bool)

Select Positive/Negative Edge of INDEX/PRESET Pulse. Raw bit values: false (0) = Xne0: Use positive edge of INDEX/PRESET pulse.; true (1) = Xne1: Use negative edge of INDEX/PRESET pulse.

Source

pub const fn xip(&self) -> bool

INDEX Triggered Initialization of Position Counters UPOS and LPOS. Raw bit values: false (0) = Xip0: INDEX pulse does not initialize the position counter.; true (1) = Xip1: INDEX pulse initializes the position counter.

Source

pub const fn set_xip(&mut self, val: bool)

INDEX Triggered Initialization of Position Counters UPOS and LPOS. Raw bit values: false (0) = Xip0: INDEX pulse does not initialize the position counter.; true (1) = Xip1: INDEX pulse initializes the position counter.

Source

pub const fn xie(&self) -> bool

INDEX/PRESET Pulse Interrupt Enable. Raw bit values: false (0) = Xie0: Disabled.; true (1) = Xie1: Enabled.

Source

pub const fn set_xie(&mut self, val: bool)

INDEX/PRESET Pulse Interrupt Enable. Raw bit values: false (0) = Xie0: Disabled.; true (1) = Xie1: Enabled.

Source

pub const fn xirq(&self) -> bool

INDEX/PRESET Pulse Interrupt Request. Raw bit values: false (0) = Xirq0: INDEX/PRESET pulse has not occurred.; true (1) = Xirq1: INDEX/PRESET pulse has occurred.

Source

pub const fn set_xirq(&mut self, val: bool)

INDEX/PRESET Pulse Interrupt Request. Raw bit values: false (0) = Xirq0: INDEX/PRESET pulse has not occurred.; true (1) = Xirq1: INDEX/PRESET pulse has occurred.

Source

pub const fn ph1(&self) -> bool

Enable Single Phase Mode. Raw bit values: false (0) = Ph10: Standard quadrature decoder, where PHASEA and PHASEB represent a two-phase quadrature signal.; true (1) = Ph11: Single phase mode, bypass the quadrature decoder, refer to CTRL2[CMODE] description.

Source

pub const fn set_ph1(&mut self, val: bool)

Enable Single Phase Mode. Raw bit values: false (0) = Ph10: Standard quadrature decoder, where PHASEA and PHASEB represent a two-phase quadrature signal.; true (1) = Ph11: Single phase mode, bypass the quadrature decoder, refer to CTRL2[CMODE] description.

Source

pub const fn rev(&self) -> bool

Enable Reverse Direction Counting. Raw bit values: false (0) = Rev0: Count normally and the position counter initialization uses upper/lower initialization register UINIT/LINIT.; true (1) = Rev1: Count in the reverse direction and the position counter initialization uses upper/lower modulus register UMOD/LMOD.

Source

pub const fn set_rev(&mut self, val: bool)

Enable Reverse Direction Counting. Raw bit values: false (0) = Rev0: Count normally and the position counter initialization uses upper/lower initialization register UINIT/LINIT.; true (1) = Rev1: Count in the reverse direction and the position counter initialization uses upper/lower modulus register UMOD/LMOD.

Source

pub const fn swip(&self) -> bool

Software-Triggered Initialization of Position Counters UPOS and LPOS. Raw bit values: false (0) = Swip0: No action.; true (1) = Swip1: Initialize position counter.

Source

pub const fn set_swip(&mut self, val: bool)

Software-Triggered Initialization of Position Counters UPOS and LPOS. Raw bit values: false (0) = Swip0: No action.; true (1) = Swip1: Initialize position counter.

Source

pub const fn hne(&self) -> bool

Use Negative Edge of HOME/ENABLE Input. Raw bit values: false (0) = Hne0: When CTRL[OPMODE] = 0,use HOME positive edge to trigger initialization of position counters. When CTRL[OPMODE] = 1,use ENABLE high level to enable POS/POSD/WDG/REV counters.; true (1) = Hne1: When CTRL[OPMODE] = 0,use HOME negative edge to trigger initialization of position counters. When CTRL[OPMODE] = 1,use ENABLE low level to enable POS/POSD/WDG/REV counters.

Source

pub const fn set_hne(&mut self, val: bool)

Use Negative Edge of HOME/ENABLE Input. Raw bit values: false (0) = Hne0: When CTRL[OPMODE] = 0,use HOME positive edge to trigger initialization of position counters. When CTRL[OPMODE] = 1,use ENABLE high level to enable POS/POSD/WDG/REV counters.; true (1) = Hne1: When CTRL[OPMODE] = 0,use HOME negative edge to trigger initialization of position counters. When CTRL[OPMODE] = 1,use ENABLE low level to enable POS/POSD/WDG/REV counters.

Source

pub const fn hip(&self) -> bool

Enable HOME to Initialize Position Counter UPOS/LPOS. Raw bit values: false (0) = Hip0: No action.; true (1) = Hip1: HOME signal initializes the position counter.

Source

pub const fn set_hip(&mut self, val: bool)

Enable HOME to Initialize Position Counter UPOS/LPOS. Raw bit values: false (0) = Hip0: No action.; true (1) = Hip1: HOME signal initializes the position counter.

Source

pub const fn hie(&self) -> bool

HOME/ENABLE Interrupt Enable. Raw bit values: false (0) = Hie0: Disabled.; true (1) = Hie1: Enabled.

Source

pub const fn set_hie(&mut self, val: bool)

HOME/ENABLE Interrupt Enable. Raw bit values: false (0) = Hie0: Disabled.; true (1) = Hie1: Enabled.

Source

pub const fn hirq(&self) -> bool

HOME/ENABLE Signal Transition Interrupt Request. Raw bit values: false (0) = Hirq0: No transition on the HOME/ENABLE signal has occurred.; true (1) = Hirq1: A transition on the HOME/ENABLE signal has occurred.

Source

pub const fn set_hirq(&mut self, val: bool)

HOME/ENABLE Signal Transition Interrupt Request. Raw bit values: false (0) = Hirq0: No transition on the HOME/ENABLE signal has occurred.; true (1) = Hirq1: A transition on the HOME/ENABLE signal has occurred.

Trait Implementations§

Source§

impl Clone for Ctrl

Source§

fn clone(&self) -> Ctrl

Returns a duplicate 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 Default for Ctrl

Source§

fn default() -> Ctrl

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

impl PartialEq for Ctrl

Source§

fn eq(&self, other: &Ctrl) -> 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.
Source§

impl Copy for Ctrl

Source§

impl Eq for Ctrl

Source§

impl StructuralPartialEq for Ctrl

Auto Trait Implementations§

§

impl Freeze for Ctrl

§

impl RefUnwindSafe for Ctrl

§

impl Send for Ctrl

§

impl Sync for Ctrl

§

impl Unpin for Ctrl

§

impl UnwindSafe for Ctrl

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, dest: *mut u8)

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