ht32f523x2/mctm0/
chbrkctr.rs1#[doc = "Register `CHBRKCTR` reader"]
2pub type R = crate::R<ChbrkctrSpec>;
3#[doc = "Register `CHBRKCTR` writer"]
4pub type W = crate::W<ChbrkctrSpec>;
5#[doc = "Field `BKE0` reader - BKE0"]
6pub type Bke0R = crate::BitReader;
7#[doc = "Field `BKE0` writer - BKE0"]
8pub type Bke0W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `BKP0` reader - BKP0"]
10pub type Bkp0R = crate::BitReader;
11#[doc = "Field `BKP0` writer - BKP0"]
12pub type Bkp0W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `CHMOE` reader - CHMOE"]
14pub type ChmoeR = crate::BitReader;
15#[doc = "Field `CHMOE` writer - CHMOE"]
16pub type ChmoeW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `CHAOE` reader - CHAOE"]
18pub type ChaoeR = crate::BitReader;
19#[doc = "Field `CHAOE` writer - CHAOE"]
20pub type ChaoeW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `BKF0` reader - BKF0"]
22pub type Bkf0R = crate::FieldReader;
23#[doc = "Field `BKF0` writer - BKF0"]
24pub type Bkf0W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
25#[doc = "Field `LOCKLV` reader - LOCKLV"]
26pub type LocklvR = crate::FieldReader;
27#[doc = "Field `LOCKLV` writer - LOCKLV"]
28pub type LocklvW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
29#[doc = "Field `GFSEL0` reader - GFSEL0"]
30pub type Gfsel0R = crate::BitReader;
31#[doc = "Field `GFSEL0` writer - GFSEL0"]
32pub type Gfsel0W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `CHOSSI` reader - CHOSSI"]
34pub type ChossiR = crate::BitReader;
35#[doc = "Field `CHOSSI` writer - CHOSSI"]
36pub type ChossiW<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `CHOSSR` reader - CHOSSR"]
38pub type ChossrR = crate::BitReader;
39#[doc = "Field `CHOSSR` writer - CHOSSR"]
40pub type ChossrW<'a, REG> = crate::BitWriter<'a, REG>;
41#[doc = "Field `CHDTG` reader - CHDTG"]
42pub type ChdtgR = crate::FieldReader;
43#[doc = "Field `CHDTG` writer - CHDTG"]
44pub type ChdtgW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
45impl R {
46 #[doc = "Bit 0 - BKE0"]
47 #[inline(always)]
48 pub fn bke0(&self) -> Bke0R {
49 Bke0R::new((self.bits & 1) != 0)
50 }
51 #[doc = "Bit 1 - BKP0"]
52 #[inline(always)]
53 pub fn bkp0(&self) -> Bkp0R {
54 Bkp0R::new(((self.bits >> 1) & 1) != 0)
55 }
56 #[doc = "Bit 4 - CHMOE"]
57 #[inline(always)]
58 pub fn chmoe(&self) -> ChmoeR {
59 ChmoeR::new(((self.bits >> 4) & 1) != 0)
60 }
61 #[doc = "Bit 5 - CHAOE"]
62 #[inline(always)]
63 pub fn chaoe(&self) -> ChaoeR {
64 ChaoeR::new(((self.bits >> 5) & 1) != 0)
65 }
66 #[doc = "Bits 8:11 - BKF0"]
67 #[inline(always)]
68 pub fn bkf0(&self) -> Bkf0R {
69 Bkf0R::new(((self.bits >> 8) & 0x0f) as u8)
70 }
71 #[doc = "Bits 16:17 - LOCKLV"]
72 #[inline(always)]
73 pub fn locklv(&self) -> LocklvR {
74 LocklvR::new(((self.bits >> 16) & 3) as u8)
75 }
76 #[doc = "Bit 18 - GFSEL0"]
77 #[inline(always)]
78 pub fn gfsel0(&self) -> Gfsel0R {
79 Gfsel0R::new(((self.bits >> 18) & 1) != 0)
80 }
81 #[doc = "Bit 20 - CHOSSI"]
82 #[inline(always)]
83 pub fn chossi(&self) -> ChossiR {
84 ChossiR::new(((self.bits >> 20) & 1) != 0)
85 }
86 #[doc = "Bit 21 - CHOSSR"]
87 #[inline(always)]
88 pub fn chossr(&self) -> ChossrR {
89 ChossrR::new(((self.bits >> 21) & 1) != 0)
90 }
91 #[doc = "Bits 24:31 - CHDTG"]
92 #[inline(always)]
93 pub fn chdtg(&self) -> ChdtgR {
94 ChdtgR::new(((self.bits >> 24) & 0xff) as u8)
95 }
96}
97impl W {
98 #[doc = "Bit 0 - BKE0"]
99 #[inline(always)]
100 #[must_use]
101 pub fn bke0(&mut self) -> Bke0W<ChbrkctrSpec> {
102 Bke0W::new(self, 0)
103 }
104 #[doc = "Bit 1 - BKP0"]
105 #[inline(always)]
106 #[must_use]
107 pub fn bkp0(&mut self) -> Bkp0W<ChbrkctrSpec> {
108 Bkp0W::new(self, 1)
109 }
110 #[doc = "Bit 4 - CHMOE"]
111 #[inline(always)]
112 #[must_use]
113 pub fn chmoe(&mut self) -> ChmoeW<ChbrkctrSpec> {
114 ChmoeW::new(self, 4)
115 }
116 #[doc = "Bit 5 - CHAOE"]
117 #[inline(always)]
118 #[must_use]
119 pub fn chaoe(&mut self) -> ChaoeW<ChbrkctrSpec> {
120 ChaoeW::new(self, 5)
121 }
122 #[doc = "Bits 8:11 - BKF0"]
123 #[inline(always)]
124 #[must_use]
125 pub fn bkf0(&mut self) -> Bkf0W<ChbrkctrSpec> {
126 Bkf0W::new(self, 8)
127 }
128 #[doc = "Bits 16:17 - LOCKLV"]
129 #[inline(always)]
130 #[must_use]
131 pub fn locklv(&mut self) -> LocklvW<ChbrkctrSpec> {
132 LocklvW::new(self, 16)
133 }
134 #[doc = "Bit 18 - GFSEL0"]
135 #[inline(always)]
136 #[must_use]
137 pub fn gfsel0(&mut self) -> Gfsel0W<ChbrkctrSpec> {
138 Gfsel0W::new(self, 18)
139 }
140 #[doc = "Bit 20 - CHOSSI"]
141 #[inline(always)]
142 #[must_use]
143 pub fn chossi(&mut self) -> ChossiW<ChbrkctrSpec> {
144 ChossiW::new(self, 20)
145 }
146 #[doc = "Bit 21 - CHOSSR"]
147 #[inline(always)]
148 #[must_use]
149 pub fn chossr(&mut self) -> ChossrW<ChbrkctrSpec> {
150 ChossrW::new(self, 21)
151 }
152 #[doc = "Bits 24:31 - CHDTG"]
153 #[inline(always)]
154 #[must_use]
155 pub fn chdtg(&mut self) -> ChdtgW<ChbrkctrSpec> {
156 ChdtgW::new(self, 24)
157 }
158}
159#[doc = "CHBRKCTR\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`chbrkctr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`chbrkctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
160pub struct ChbrkctrSpec;
161impl crate::RegisterSpec for ChbrkctrSpec {
162 type Ux = u32;
163}
164#[doc = "`read()` method returns [`chbrkctr::R`](R) reader structure"]
165impl crate::Readable for ChbrkctrSpec {}
166#[doc = "`write(|w| ..)` method takes [`chbrkctr::W`](W) writer structure"]
167impl crate::Writable for ChbrkctrSpec {
168 type Safety = crate::Unsafe;
169 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
170 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
171}
172#[doc = "`reset()` method sets CHBRKCTR to value 0"]
173impl crate::Resettable for ChbrkctrSpec {
174 const RESET_VALUE: u32 = 0;
175}