xmc4500/ccu40_cc40/
c1v.rs

1#[doc = "Register `C1V` reader"]
2pub type R = crate::R<C1V_SPEC>;
3#[doc = "Field `CAPTV` reader - Capture Value"]
4pub type CAPTV_R = crate::FieldReader<u16>;
5#[doc = "Field `FPCV` reader - Prescaler Value"]
6pub type FPCV_R = crate::FieldReader;
7#[doc = "Full Flag\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum FFL_A {
10    #[doc = "0: No new value was captured into the specific capture register"]
11    VALUE1 = 0,
12    #[doc = "1: A new value was captured into the specific register"]
13    VALUE2 = 1,
14}
15impl From<FFL_A> for bool {
16    #[inline(always)]
17    fn from(variant: FFL_A) -> Self {
18        variant as u8 != 0
19    }
20}
21#[doc = "Field `FFL` reader - Full Flag"]
22pub type FFL_R = crate::BitReader<FFL_A>;
23impl FFL_R {
24    #[doc = "Get enumerated values variant"]
25    #[inline(always)]
26    pub const fn variant(&self) -> FFL_A {
27        match self.bits {
28            false => FFL_A::VALUE1,
29            true => FFL_A::VALUE2,
30        }
31    }
32    #[doc = "No new value was captured into the specific capture register"]
33    #[inline(always)]
34    pub fn is_value1(&self) -> bool {
35        *self == FFL_A::VALUE1
36    }
37    #[doc = "A new value was captured into the specific register"]
38    #[inline(always)]
39    pub fn is_value2(&self) -> bool {
40        *self == FFL_A::VALUE2
41    }
42}
43impl R {
44    #[doc = "Bits 0:15 - Capture Value"]
45    #[inline(always)]
46    pub fn captv(&self) -> CAPTV_R {
47        CAPTV_R::new((self.bits & 0xffff) as u16)
48    }
49    #[doc = "Bits 16:19 - Prescaler Value"]
50    #[inline(always)]
51    pub fn fpcv(&self) -> FPCV_R {
52        FPCV_R::new(((self.bits >> 16) & 0x0f) as u8)
53    }
54    #[doc = "Bit 20 - Full Flag"]
55    #[inline(always)]
56    pub fn ffl(&self) -> FFL_R {
57        FFL_R::new(((self.bits >> 20) & 1) != 0)
58    }
59}
60#[doc = "Capture Register 1\n\nYou can [`read`](crate::Reg::read) this register and get [`c1v::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\n<div class=\"warning\">One or more dependent resources other than the current register are immediately affected by a read operation.</div>"]
61pub struct C1V_SPEC;
62impl crate::RegisterSpec for C1V_SPEC {
63    type Ux = u32;
64}
65#[doc = "`read()` method returns [`c1v::R`](R) reader structure"]
66impl crate::Readable for C1V_SPEC {}
67#[doc = "`reset()` method sets C1V to value 0"]
68impl crate::Resettable for C1V_SPEC {
69    const RESET_VALUE: u32 = 0;
70}