#[repr(transparent)]pub struct Ctrl(pub u16);Expand description
Control Register.
Tuple Fields§
§0: u16Implementations§
Source§impl Ctrl
impl Ctrl
Sourcepub const fn ldok(&self) -> bool
pub const fn ldok(&self) -> bool
Load buffered compare/init/modulus values according to LDMOD. Do not write the outer buffers while LDOK=1. 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].
Sourcepub const fn set_ldok(&mut self, val: bool)
pub const fn set_ldok(&mut self, val: bool)
Load buffered compare/init/modulus values according to LDMOD. Do not write the outer buffers while LDOK=1. 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].
Sourcepub const fn dmaen(&self) -> bool
pub const fn dmaen(&self) -> bool
Sticky DMA enable. Once set, writing zero cannot clear it. 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.
Sourcepub const fn set_dmaen(&mut self, val: bool)
pub const fn set_dmaen(&mut self, val: bool)
Sticky DMA enable. Once set, writing zero cannot clear it. 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.
Sourcepub const fn wde(&self) -> bool
pub const fn wde(&self) -> bool
Watchdog Enable. Raw bit values: false (0) = Wde0: Disabled.; true (1) = Wde1: Enabled.
Sourcepub const fn set_wde(&mut self, val: bool)
pub const fn set_wde(&mut self, val: bool)
Watchdog Enable. Raw bit values: false (0) = Wde0: Disabled.; true (1) = Wde1: Enabled.
Sourcepub const fn wdie(&self) -> bool
pub const fn wdie(&self) -> bool
Watchdog Timeout Interrupt Enable. Raw bit values: false (0) = Wdie0: Disabled.; true (1) = Wdie1: Enabled.
Sourcepub const fn set_wdie(&mut self, val: bool)
pub const fn set_wdie(&mut self, val: bool)
Watchdog Timeout Interrupt Enable. Raw bit values: false (0) = Wdie0: Disabled.; true (1) = Wdie1: Enabled.
Sourcepub const fn wdirq(&self) -> bool
pub const fn wdirq(&self) -> bool
Watchdog Timeout Interrupt Request. Write one to clear; zero does not acknowledge the flag. Raw bit values: false (0) = Wdirq0: No Watchdog timeout interrupt has occurred.; true (1) = Wdirq1: Watchdog timeout interrupt has occurred.
Sourcepub const fn set_wdirq(&mut self, val: bool)
pub const fn set_wdirq(&mut self, val: bool)
Watchdog Timeout Interrupt Request. Write one to clear; zero does not acknowledge the flag. Raw bit values: false (0) = Wdirq0: No Watchdog timeout interrupt has occurred.; true (1) = Wdirq1: Watchdog timeout interrupt has occurred.
Sourcepub const fn xne(&self) -> bool
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.
Sourcepub const fn set_xne(&mut self, val: bool)
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.
Sourcepub const fn xip(&self) -> bool
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.
Sourcepub const fn set_xip(&mut self, val: bool)
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.
Sourcepub const fn xie(&self) -> bool
pub const fn xie(&self) -> bool
INDEX/PRESET Pulse Interrupt Enable. Raw bit values: false (0) = Xie0: Disabled.; true (1) = Xie1: Enabled.
Sourcepub const fn set_xie(&mut self, val: bool)
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.
Sourcepub const fn xirq(&self) -> bool
pub const fn xirq(&self) -> bool
INDEX/PRESET Pulse Interrupt Request. Write one to clear; zero does not acknowledge the flag. Raw bit values: false (0) = Xirq0: INDEX/PRESET pulse has not occurred.; true (1) = Xirq1: INDEX/PRESET pulse has occurred.
Sourcepub const fn set_xirq(&mut self, val: bool)
pub const fn set_xirq(&mut self, val: bool)
INDEX/PRESET Pulse Interrupt Request. Write one to clear; zero does not acknowledge the flag. Raw bit values: false (0) = Xirq0: INDEX/PRESET pulse has not occurred.; true (1) = Xirq1: INDEX/PRESET pulse has occurred.
Sourcepub const fn ph1(&self) -> bool
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.
Sourcepub const fn set_ph1(&mut self, val: bool)
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.
Sourcepub const fn rev(&self) -> bool
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.
Sourcepub const fn set_rev(&mut self, val: bool)
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.
Sourcepub const fn swip(&self) -> bool
pub const fn swip(&self) -> bool
Software-Triggered Initialization of Position Counters UPOS and LPOS. Command reads as zero. Raw bit values: false (0) = Swip0: No action.; true (1) = Swip1: Initialize position counter.
Sourcepub const fn set_swip(&mut self, val: bool)
pub const fn set_swip(&mut self, val: bool)
Software-Triggered Initialization of Position Counters UPOS and LPOS. Command reads as zero. Raw bit values: false (0) = Swip0: No action.; true (1) = Swip1: Initialize position counter.
Sourcepub const fn hne(&self) -> bool
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.
Sourcepub const fn set_hne(&mut self, val: bool)
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.
Sourcepub const fn hip(&self) -> bool
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.
Sourcepub const fn set_hip(&mut self, val: bool)
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.
Sourcepub const fn hie(&self) -> bool
pub const fn hie(&self) -> bool
HOME/ENABLE Interrupt Enable. Raw bit values: false (0) = Hie0: Disabled.; true (1) = Hie1: Enabled.
Sourcepub const fn set_hie(&mut self, val: bool)
pub const fn set_hie(&mut self, val: bool)
HOME/ENABLE Interrupt Enable. Raw bit values: false (0) = Hie0: Disabled.; true (1) = Hie1: Enabled.
Sourcepub const fn hirq(&self) -> bool
pub const fn hirq(&self) -> bool
HOME/ENABLE Signal Transition Interrupt Request. Write one to clear; zero does not acknowledge the flag. 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.
Sourcepub const fn set_hirq(&mut self, val: bool)
pub const fn set_hirq(&mut self, val: bool)
HOME/ENABLE Signal Transition Interrupt Request. Write one to clear; zero does not acknowledge the flag. 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.