ht32f523x2/pdma/
ch2tsr.rs1#[doc = "Register `CH2TSR` reader"]
2pub type R = crate::R<Ch2tsrSpec>;
3#[doc = "Register `CH2TSR` writer"]
4pub type W = crate::W<Ch2tsrSpec>;
5#[doc = "Field `BLKLEN` reader - BLKLEN"]
6pub type BlklenR = crate::FieldReader<u16>;
7#[doc = "Field `BLKLEN` writer - BLKLEN"]
8pub type BlklenW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `BLKCNT` reader - BLKCNT"]
10pub type BlkcntR = crate::FieldReader<u16>;
11#[doc = "Field `BLKCNT` writer - BLKCNT"]
12pub type BlkcntW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
13impl R {
14 #[doc = "Bits 0:15 - BLKLEN"]
15 #[inline(always)]
16 pub fn blklen(&self) -> BlklenR {
17 BlklenR::new((self.bits & 0xffff) as u16)
18 }
19 #[doc = "Bits 16:31 - BLKCNT"]
20 #[inline(always)]
21 pub fn blkcnt(&self) -> BlkcntR {
22 BlkcntR::new(((self.bits >> 16) & 0xffff) as u16)
23 }
24}
25impl W {
26 #[doc = "Bits 0:15 - BLKLEN"]
27 #[inline(always)]
28 #[must_use]
29 pub fn blklen(&mut self) -> BlklenW<Ch2tsrSpec> {
30 BlklenW::new(self, 0)
31 }
32 #[doc = "Bits 16:31 - BLKCNT"]
33 #[inline(always)]
34 #[must_use]
35 pub fn blkcnt(&mut self) -> BlkcntW<Ch2tsrSpec> {
36 BlkcntW::new(self, 16)
37 }
38}
39#[doc = "CH2TSR\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ch2tsr::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 [`ch2tsr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct Ch2tsrSpec;
41impl crate::RegisterSpec for Ch2tsrSpec {
42 type Ux = u32;
43}
44#[doc = "`read()` method returns [`ch2tsr::R`](R) reader structure"]
45impl crate::Readable for Ch2tsrSpec {}
46#[doc = "`write(|w| ..)` method takes [`ch2tsr::W`](W) writer structure"]
47impl crate::Writable for Ch2tsrSpec {
48 type Safety = crate::Unsafe;
49 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
50 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
51}
52#[doc = "`reset()` method sets CH2TSR to value 0"]
53impl crate::Resettable for Ch2tsrSpec {
54 const RESET_VALUE: u32 = 0;
55}