efm32pg12_pac/vdac0/
opa2_timer.rs

1#[doc = "Reader of register OPA2_TIMER"]
2pub type R = crate::R<u32, super::OPA2_TIMER>;
3#[doc = "Writer for register OPA2_TIMER"]
4pub type W = crate::W<u32, super::OPA2_TIMER>;
5#[doc = "Register OPA2_TIMER `reset()`'s with value 0x0001_0700"]
6impl crate::ResetValue for super::OPA2_TIMER {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0x0001_0700
11    }
12}
13#[doc = "Reader of field `STARTUPDLY`"]
14pub type STARTUPDLY_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `STARTUPDLY`"]
16pub struct STARTUPDLY_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> STARTUPDLY_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u8) -> &'a mut W {
23        self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f);
24        self.w
25    }
26}
27#[doc = "Reader of field `WARMUPTIME`"]
28pub type WARMUPTIME_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `WARMUPTIME`"]
30pub struct WARMUPTIME_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> WARMUPTIME_W<'a> {
34    #[doc = r"Writes raw bits to the field"]
35    #[inline(always)]
36    pub unsafe fn bits(self, value: u8) -> &'a mut W {
37        self.w.bits = (self.w.bits & !(0x7f << 8)) | (((value as u32) & 0x7f) << 8);
38        self.w
39    }
40}
41#[doc = "Reader of field `SETTLETIME`"]
42pub type SETTLETIME_R = crate::R<u16, u16>;
43#[doc = "Write proxy for field `SETTLETIME`"]
44pub struct SETTLETIME_W<'a> {
45    w: &'a mut W,
46}
47impl<'a> SETTLETIME_W<'a> {
48    #[doc = r"Writes raw bits to the field"]
49    #[inline(always)]
50    pub unsafe fn bits(self, value: u16) -> &'a mut W {
51        self.w.bits = (self.w.bits & !(0x03ff << 16)) | (((value as u32) & 0x03ff) << 16);
52        self.w
53    }
54}
55impl R {
56    #[doc = "Bits 0:5 - OPAx Startup Delay Count Value"]
57    #[inline(always)]
58    pub fn startupdly(&self) -> STARTUPDLY_R {
59        STARTUPDLY_R::new((self.bits & 0x3f) as u8)
60    }
61    #[doc = "Bits 8:14 - OPAx Warmup Time Count Value"]
62    #[inline(always)]
63    pub fn warmuptime(&self) -> WARMUPTIME_R {
64        WARMUPTIME_R::new(((self.bits >> 8) & 0x7f) as u8)
65    }
66    #[doc = "Bits 16:25 - OPAx Output Settling Timeout Value"]
67    #[inline(always)]
68    pub fn settletime(&self) -> SETTLETIME_R {
69        SETTLETIME_R::new(((self.bits >> 16) & 0x03ff) as u16)
70    }
71}
72impl W {
73    #[doc = "Bits 0:5 - OPAx Startup Delay Count Value"]
74    #[inline(always)]
75    pub fn startupdly(&mut self) -> STARTUPDLY_W {
76        STARTUPDLY_W { w: self }
77    }
78    #[doc = "Bits 8:14 - OPAx Warmup Time Count Value"]
79    #[inline(always)]
80    pub fn warmuptime(&mut self) -> WARMUPTIME_W {
81        WARMUPTIME_W { w: self }
82    }
83    #[doc = "Bits 16:25 - OPAx Output Settling Timeout Value"]
84    #[inline(always)]
85    pub fn settletime(&mut self) -> SETTLETIME_W {
86        SETTLETIME_W { w: self }
87    }
88}