#[repr(transparent)]pub struct Ctcr(pub u32);Expand description
Count Control Register. The CTCR selects between Timer and Counter mode, and in Counter mode selects the signal and edge(s) for counting.
Tuple Fields§
§0: u32Implementations§
Source§impl Ctcr
impl Ctcr
Sourcepub const fn ctmode(&self) -> Ctmode
pub const fn ctmode(&self) -> Ctmode
Counter/Timer Mode This field selects which rising APB bus clock edges can increment Timer’s Prescale Counter (PC), or clear PC and increment Timer Counter (TC). Timer Mode: the TC is incremented when the Prescale Counter matches the Prescale Register.
Sourcepub const fn set_ctmode(&mut self, val: Ctmode)
pub const fn set_ctmode(&mut self, val: Ctmode)
Counter/Timer Mode This field selects which rising APB bus clock edges can increment Timer’s Prescale Counter (PC), or clear PC and increment Timer Counter (TC). Timer Mode: the TC is incremented when the Prescale Counter matches the Prescale Register.
Sourcepub const fn cinsel(&self) -> Cinsel
pub const fn cinsel(&self) -> Cinsel
Count Input Select When bits 1:0 in this register are not 00, these bits select which CAP pin is sampled for clocking. Note: If Counter mode is selected for a particular CAPn input in the CTCR, the 3 bits for that input in the Capture Control Register (CCR) must be programmed as 000. However, capture and/or interrupt can be selected for the other 3 CAPn inputs in the same timer.
Sourcepub const fn set_cinsel(&mut self, val: Cinsel)
pub const fn set_cinsel(&mut self, val: Cinsel)
Count Input Select When bits 1:0 in this register are not 00, these bits select which CAP pin is sampled for clocking. Note: If Counter mode is selected for a particular CAPn input in the CTCR, the 3 bits for that input in the Capture Control Register (CCR) must be programmed as 000. However, capture and/or interrupt can be selected for the other 3 CAPn inputs in the same timer.
Sourcepub const fn encc(&self) -> bool
pub const fn encc(&self) -> bool
Setting this bit to 1 enables clearing of the timer and the prescaler when the capture-edge event specified in bits 7:5 occurs.
Sourcepub const fn set_encc(&mut self, val: bool)
pub const fn set_encc(&mut self, val: bool)
Setting this bit to 1 enables clearing of the timer and the prescaler when the capture-edge event specified in bits 7:5 occurs.