#[repr(transparent)]pub struct Ctrl2(pub u16);Expand description
Control 2 Register.
Tuple Fields§
§0: u16Implementations§
Source§impl Ctrl2
impl Ctrl2
Sourcepub const fn set_updhld(&mut self, val: bool)
pub const fn set_updhld(&mut self, val: bool)
Update Hold Registers.
Sourcepub const fn set_updpos(&mut self, val: bool)
pub const fn set_updpos(&mut self, val: bool)
Update Position Registers.
Sourcepub const fn opmode(&self) -> bool
pub const fn opmode(&self) -> bool
Operation Mode Select. Raw bit values: false (0) = Opmode0: Decode Mode: Input nodes INDEX/PRESET and HOME/ENABLE are assigned to function of INDEX and HOME.; true (1) = Opmode1: Count Mode: Input nodes INDEX/PRESET and HOME/ENABLE are assigned to functions of PRESET and ENABLE. In this mode: (1)only when ENABLE=1, all counters (position/position difference/revolution/watchdog) can run, when ENABLE=0, all counters (position/position difference/revolution/watchdog) can’t run. (2) the rising edge of PRESET input can initialize position/revolution/watchdog counters (position counter initialization also need referring to bit CTRL[REV]).
Sourcepub const fn set_opmode(&mut self, val: bool)
pub const fn set_opmode(&mut self, val: bool)
Operation Mode Select. Raw bit values: false (0) = Opmode0: Decode Mode: Input nodes INDEX/PRESET and HOME/ENABLE are assigned to function of INDEX and HOME.; true (1) = Opmode1: Count Mode: Input nodes INDEX/PRESET and HOME/ENABLE are assigned to functions of PRESET and ENABLE. In this mode: (1)only when ENABLE=1, all counters (position/position difference/revolution/watchdog) can run, when ENABLE=0, all counters (position/position difference/revolution/watchdog) can’t run. (2) the rising edge of PRESET input can initialize position/revolution/watchdog counters (position counter initialization also need referring to bit CTRL[REV]).
Sourcepub const fn ldmod(&self) -> bool
pub const fn ldmod(&self) -> bool
Buffered Register Load (Update) Mode Select. Raw bit values: false (0) = Ldmod0: Buffered registers are loaded and take effect immediately upon CTRL[LDOK] is set.; true (1) = Ldmod1: Buffered registers are loaded and take effect at the next roll-over or roll-under if CTRL[LDOK] is set.
Sourcepub const fn set_ldmod(&mut self, val: bool)
pub const fn set_ldmod(&mut self, val: bool)
Buffered Register Load (Update) Mode Select. Raw bit values: false (0) = Ldmod0: Buffered registers are loaded and take effect immediately upon CTRL[LDOK] is set.; true (1) = Ldmod1: Buffered registers are loaded and take effect at the next roll-over or roll-under if CTRL[LDOK] is set.
Sourcepub const fn revmod(&self) -> bool
pub const fn revmod(&self) -> bool
Revolution Counter Modulus Enable. Raw bit values: false (0) = Revmod0: Use INDEX pulse to increment/decrement revolution counter (REV).; true (1) = Revmod1: Use modulus counting roll-over/under to increment/decrement revolution counter (REV).
Sourcepub const fn set_revmod(&mut self, val: bool)
pub const fn set_revmod(&mut self, val: bool)
Revolution Counter Modulus Enable. Raw bit values: false (0) = Revmod0: Use INDEX pulse to increment/decrement revolution counter (REV).; true (1) = Revmod1: Use modulus counting roll-over/under to increment/decrement revolution counter (REV).
Sourcepub const fn outctl(&self) -> bool
pub const fn outctl(&self) -> bool
Output Control. Raw bit values: false (0) = Outctl0: POS_MATCH[x](x range is 0-3) is asserted when the Position Counter is equal to according compare value (UCOMPx/LCOMPx)(x range is 0-3), and de-asserted when the Position Counter not equal to the compare value (UCOMPx/LCOMPx)(x range is 0-3).; true (1) = Outctl1: All POS_MATCH[x](x range is 0-3) are asserted a pulse, when the UPOS, LPOS, REV, or POSD registers are read.
Sourcepub const fn set_outctl(&mut self, val: bool)
pub const fn set_outctl(&mut self, val: bool)
Output Control. Raw bit values: false (0) = Outctl0: POS_MATCH[x](x range is 0-3) is asserted when the Position Counter is equal to according compare value (UCOMPx/LCOMPx)(x range is 0-3), and de-asserted when the Position Counter not equal to the compare value (UCOMPx/LCOMPx)(x range is 0-3).; true (1) = Outctl1: All POS_MATCH[x](x range is 0-3) are asserted a pulse, when the UPOS, LPOS, REV, or POSD registers are read.
Sourcepub const fn pmen(&self) -> bool
pub const fn pmen(&self) -> bool
Period measurement function enable. Raw bit values: false (0) = Pmen0: Period measurement functions are not used. POSD is loaded to POSDH and then cleared whenever POSD, UPOS, LPOS or REV is read.; true (1) = Pmen1: Period measurement functions are used. POSD is loaded into POSDH and then cleared only when POSD is read.
Sourcepub const fn set_pmen(&mut self, val: bool)
pub const fn set_pmen(&mut self, val: bool)
Period measurement function enable. Raw bit values: false (0) = Pmen0: Period measurement functions are not used. POSD is loaded to POSDH and then cleared whenever POSD, UPOS, LPOS or REV is read.; true (1) = Pmen1: Period measurement functions are used. POSD is loaded into POSDH and then cleared only when POSD is read.
Sourcepub const fn emip(&self) -> bool
pub const fn emip(&self) -> bool
Enables/disables the position counter to be initialized by Index Event Edge Mark. Raw bit values: false (0) = Emip0: disables the position counter to be initialized by Index Event Edge Mark.; true (1) = Emip1: enables the position counter to be initialized by Index Event Edge Mark.
Sourcepub const fn set_emip(&mut self, val: bool)
pub const fn set_emip(&mut self, val: bool)
Enables/disables the position counter to be initialized by Index Event Edge Mark. Raw bit values: false (0) = Emip0: disables the position counter to be initialized by Index Event Edge Mark.; true (1) = Emip1: enables the position counter to be initialized by Index Event Edge Mark.
Sourcepub const fn initpos(&self) -> bool
pub const fn initpos(&self) -> bool
Initial Position Register. Raw bit values: false (0) = Initpos0: Don’t initialize position counter on rising edge of TRIGGER.; true (1) = Initpos1: Initialize position counter on rising edge of TRIGGER.
Sourcepub const fn set_initpos(&mut self, val: bool)
pub const fn set_initpos(&mut self, val: bool)
Initial Position Register. Raw bit values: false (0) = Initpos0: Don’t initialize position counter on rising edge of TRIGGER.; true (1) = Initpos1: Initialize position counter on rising edge of TRIGGER.
Sourcepub const fn once(&self) -> bool
pub const fn once(&self) -> bool
Count Once. Raw bit values: false (0) = Once0: Position counter counts repeatedly.; true (1) = Once1: Position counter counts until roll-over or roll-under, then stop.
Sourcepub const fn set_once(&mut self, val: bool)
pub const fn set_once(&mut self, val: bool)
Count Once. Raw bit values: false (0) = Once0: Position counter counts repeatedly.; true (1) = Once1: Position counter counts until roll-over or roll-under, then stop.