efm32pg12_pac/csen/
anactrl.rs1#[doc = "Reader of register ANACTRL"]
2pub type R = crate::R<u32, super::ANACTRL>;
3#[doc = "Writer for register ANACTRL"]
4pub type W = crate::W<u32, super::ANACTRL>;
5#[doc = "Register ANACTRL `reset()`'s with value 0x70"]
6impl crate::ResetValue for super::ANACTRL {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0x70
11 }
12}
13#[doc = "Reader of field `IREFPROG`"]
14pub type IREFPROG_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `IREFPROG`"]
16pub struct IREFPROG_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> IREFPROG_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 & !(0x07 << 4)) | (((value as u32) & 0x07) << 4);
24 self.w
25 }
26}
27#[doc = "Reader of field `IDACIREFS`"]
28pub type IDACIREFS_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `IDACIREFS`"]
30pub struct IDACIREFS_W<'a> {
31 w: &'a mut W,
32}
33impl<'a> IDACIREFS_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 & !(0x07 << 8)) | (((value as u32) & 0x07) << 8);
38 self.w
39 }
40}
41#[doc = "Reader of field `TRSTPROG`"]
42pub type TRSTPROG_R = crate::R<u8, u8>;
43#[doc = "Write proxy for field `TRSTPROG`"]
44pub struct TRSTPROG_W<'a> {
45 w: &'a mut W,
46}
47impl<'a> TRSTPROG_W<'a> {
48 #[doc = r"Writes raw bits to the field"]
49 #[inline(always)]
50 pub unsafe fn bits(self, value: u8) -> &'a mut W {
51 self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20);
52 self.w
53 }
54}
55impl R {
56 #[doc = "Bits 4:6 - Reference Current Control."]
57 #[inline(always)]
58 pub fn irefprog(&self) -> IREFPROG_R {
59 IREFPROG_R::new(((self.bits >> 4) & 0x07) as u8)
60 }
61 #[doc = "Bits 8:10 - Current DAC and Reference Current Scale"]
62 #[inline(always)]
63 pub fn idacirefs(&self) -> IDACIREFS_R {
64 IDACIREFS_R::new(((self.bits >> 8) & 0x07) as u8)
65 }
66 #[doc = "Bits 20:22 - Reset Timing"]
67 #[inline(always)]
68 pub fn trstprog(&self) -> TRSTPROG_R {
69 TRSTPROG_R::new(((self.bits >> 20) & 0x07) as u8)
70 }
71}
72impl W {
73 #[doc = "Bits 4:6 - Reference Current Control."]
74 #[inline(always)]
75 pub fn irefprog(&mut self) -> IREFPROG_W {
76 IREFPROG_W { w: self }
77 }
78 #[doc = "Bits 8:10 - Current DAC and Reference Current Scale"]
79 #[inline(always)]
80 pub fn idacirefs(&mut self) -> IDACIREFS_W {
81 IDACIREFS_W { w: self }
82 }
83 #[doc = "Bits 20:22 - Reset Timing"]
84 #[inline(always)]
85 pub fn trstprog(&mut self) -> TRSTPROG_W {
86 TRSTPROG_W { w: self }
87 }
88}