efm32pg12_pac/etm/
etmtrigger.rs1#[doc = "Reader of register ETMTRIGGER"]
2pub type R = crate::R<u32, super::ETMTRIGGER>;
3#[doc = "Writer for register ETMTRIGGER"]
4pub type W = crate::W<u32, super::ETMTRIGGER>;
5#[doc = "Register ETMTRIGGER `reset()`'s with value 0"]
6impl crate::ResetValue for super::ETMTRIGGER {
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 `ETMFCN`"]
42pub type ETMFCN_R = crate::R<u8, u8>;
43#[doc = "Write proxy for field `ETMFCN`"]
44pub struct ETMFCN_W<'a> {
45 w: &'a mut W,
46}
47impl<'a> ETMFCN_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"]
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"]
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"]
67 #[inline(always)]
68 pub fn etmfcn(&self) -> ETMFCN_R {
69 ETMFCN_R::new(((self.bits >> 14) & 0x07) as u8)
70 }
71}
72impl W {
73 #[doc = "Bits 0:6 - ETM Resource A"]
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"]
79 #[inline(always)]
80 pub fn resb(&mut self) -> RESB_W {
81 RESB_W { w: self }
82 }
83 #[doc = "Bits 14:16 - ETM Function"]
84 #[inline(always)]
85 pub fn etmfcn(&mut self) -> ETMFCN_W {
86 ETMFCN_W { w: self }
87 }
88}