1#[doc = "Register `CV%s` reader"]
2pub type R = crate::R<CvSpec>;
3#[doc = "Register `CV%s` writer"]
4pub type W = crate::W<CvSpec>;
5#[doc = "Field `CVL` reader - Compare Value Low"]
6pub type CvlR = crate::FieldReader<u16>;
7#[doc = "Field `CVL` writer - Compare Value Low"]
8pub type CvlW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `CVH` reader - Compare Value High"]
10pub type CvhR = crate::FieldReader<u16>;
11#[doc = "Field `CVH` writer - Compare Value High"]
12pub type CvhW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
13impl R {
14 #[doc = "Bits 0:15 - Compare Value Low"]
15 #[inline(always)]
16 pub fn cvl(&self) -> CvlR {
17 CvlR::new((self.bits & 0xffff) as u16)
18 }
19 #[doc = "Bits 16:31 - Compare Value High"]
20 #[inline(always)]
21 pub fn cvh(&self) -> CvhR {
22 CvhR::new(((self.bits >> 16) & 0xffff) as u16)
23 }
24}
25#[cfg(feature = "debug")]
26impl core::fmt::Debug for R {
27 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28 f.debug_struct("CV")
29 .field("cvl", &self.cvl())
30 .field("cvh", &self.cvh())
31 .finish()
32 }
33}
34impl W {
35 #[doc = "Bits 0:15 - Compare Value Low"]
36 #[inline(always)]
37 pub fn cvl(&mut self) -> CvlW<'_, CvSpec> {
38 CvlW::new(self, 0)
39 }
40 #[doc = "Bits 16:31 - Compare Value High"]
41 #[inline(always)]
42 pub fn cvh(&mut self) -> CvhW<'_, CvSpec> {
43 CvhW::new(self, 16)
44 }
45}
46#[doc = "Compare Value Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cv::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cv::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct CvSpec;
48impl crate::RegisterSpec for CvSpec {
49 type Ux = u32;
50}
51#[doc = "`read()` method returns [`cv::R`](R) reader structure"]
52impl crate::Readable for CvSpec {}
53#[doc = "`write(|w| ..)` method takes [`cv::W`](W) writer structure"]
54impl crate::Writable for CvSpec {
55 type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets CV%s to value 0"]
58impl crate::Resettable for CvSpec {}