efm32pg12_pac/etm/
etmteevr.rs

1#[doc = "Reader of register ETMTEEVR"]
2pub type R = crate::R<u32, super::ETMTEEVR>;
3#[doc = "Writer for register ETMTEEVR"]
4pub type W = crate::W<u32, super::ETMTEEVR>;
5#[doc = "Register ETMTEEVR `reset()`'s with value 0"]
6impl crate::ResetValue for super::ETMTEEVR {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `RESA`"]
14pub type RESA_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `RESA`"]
16pub struct RESA_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> RESA_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 & !0x7f) | ((value as u32) & 0x7f);
24        self.w
25    }
26}
27#[doc = "Reader of field `RESB`"]
28pub type RESB_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `RESB`"]
30pub struct RESB_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> RESB_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 << 7)) | (((value as u32) & 0x7f) << 7);
38        self.w
39    }
40}
41#[doc = "Reader of field `ETMFCNEN`"]
42pub type ETMFCNEN_R = crate::R<u8, u8>;
43#[doc = "Write proxy for field `ETMFCNEN`"]
44pub struct ETMFCNEN_W<'a> {
45    w: &'a mut W,
46}
47impl<'a> ETMFCNEN_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 << 14)) | (((value as u32) & 0x07) << 14);
52        self.w
53    }
54}
55impl R {
56    #[doc = "Bits 0:6 - ETM Resource A Trace Enable"]
57    #[inline(always)]
58    pub fn resa(&self) -> RESA_R {
59        RESA_R::new((self.bits & 0x7f) as u8)
60    }
61    #[doc = "Bits 7:13 - ETM Resource B Trace Enable"]
62    #[inline(always)]
63    pub fn resb(&self) -> RESB_R {
64        RESB_R::new(((self.bits >> 7) & 0x7f) as u8)
65    }
66    #[doc = "Bits 14:16 - ETM Function Trace Enable"]
67    #[inline(always)]
68    pub fn etmfcnen(&self) -> ETMFCNEN_R {
69        ETMFCNEN_R::new(((self.bits >> 14) & 0x07) as u8)
70    }
71}
72impl W {
73    #[doc = "Bits 0:6 - ETM Resource A Trace Enable"]
74    #[inline(always)]
75    pub fn resa(&mut self) -> RESA_W {
76        RESA_W { w: self }
77    }
78    #[doc = "Bits 7:13 - ETM Resource B Trace Enable"]
79    #[inline(always)]
80    pub fn resb(&mut self) -> RESB_W {
81        RESB_W { w: self }
82    }
83    #[doc = "Bits 14:16 - ETM Function Trace Enable"]
84    #[inline(always)]
85    pub fn etmfcnen(&mut self) -> ETMFCNEN_W {
86        ETMFCNEN_W { w: self }
87    }
88}