stm32g4_staging/stm32g474/hrtim_master/
icr.rs1pub type W = crate::W<ICRrs>;
3#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum CMP1CW {
9 Clear = 1,
11}
12impl From<CMP1CW> for bool {
13 #[inline(always)]
14 fn from(variant: CMP1CW) -> Self {
15 variant as u8 != 0
16 }
17}
18pub type CMPC_W<'a, REG> = crate::BitWriter1C<'a, REG, CMP1CW>;
20impl<'a, REG> CMPC_W<'a, REG>
21where
22 REG: crate::Writable + crate::RegisterSpec,
23{
24 #[inline(always)]
26 pub fn clear(self) -> &'a mut crate::W<REG> {
27 self.variant(CMP1CW::Clear)
28 }
29}
30pub use CMPC_W as REPC_W;
32pub use CMPC_W as SYNCC_W;
34pub use CMPC_W as UPDC_W;
36impl core::fmt::Debug for crate::generic::Reg<ICRrs> {
37 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
38 write!(f, "(not readable)")
39 }
40}
41impl W {
42 #[inline(always)]
46 pub fn cmpc(&mut self, n: u8) -> CMPC_W<ICRrs> {
47 #[allow(clippy::no_effect)] [(); 4][n as usize];
48 CMPC_W::new(self, n)
49 }
50 #[inline(always)]
52 pub fn cmp1c(&mut self) -> CMPC_W<ICRrs> {
53 CMPC_W::new(self, 0)
54 }
55 #[inline(always)]
57 pub fn cmp2c(&mut self) -> CMPC_W<ICRrs> {
58 CMPC_W::new(self, 1)
59 }
60 #[inline(always)]
62 pub fn cmp3c(&mut self) -> CMPC_W<ICRrs> {
63 CMPC_W::new(self, 2)
64 }
65 #[inline(always)]
67 pub fn cmp4c(&mut self) -> CMPC_W<ICRrs> {
68 CMPC_W::new(self, 3)
69 }
70 #[inline(always)]
72 pub fn repc(&mut self) -> REPC_W<ICRrs> {
73 REPC_W::new(self, 4)
74 }
75 #[inline(always)]
77 pub fn syncc(&mut self) -> SYNCC_W<ICRrs> {
78 SYNCC_W::new(self, 5)
79 }
80 #[inline(always)]
82 pub fn updc(&mut self) -> UPDC_W<ICRrs> {
83 UPDC_W::new(self, 6)
84 }
85}
86pub struct ICRrs;
92impl crate::RegisterSpec for ICRrs {
93 type Ux = u32;
94}
95impl crate::Writable for ICRrs {
97 type Safety = crate::Unsafe;
98 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x7f;
99}
100impl crate::Resettable for ICRrs {}