efm32pg12_pac/etm/
etmtsevr.rs1#[doc = "Reader of register ETMTSEVR"]
2pub type R = crate::R<u32, super::ETMTSEVR>;
3#[doc = "Writer for register ETMTSEVR"]
4pub type W = crate::W<u32, super::ETMTSEVR>;
5#[doc = "Register ETMTSEVR `reset()`'s with value 0"]
6impl crate::ResetValue for super::ETMTSEVR {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Reader of field `RESAEVT`"]
14pub type RESAEVT_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `RESAEVT`"]
16pub struct RESAEVT_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> RESAEVT_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 `RESBEVT`"]
28pub type RESBEVT_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `RESBEVT`"]
30pub struct RESBEVT_W<'a> {
31 w: &'a mut W,
32}
33impl<'a> RESBEVT_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 `ETMFCNEVT`"]
42pub type ETMFCNEVT_R = crate::R<u8, u8>;
43#[doc = "Write proxy for field `ETMFCNEVT`"]
44pub struct ETMFCNEVT_W<'a> {
45 w: &'a mut W,
46}
47impl<'a> ETMFCNEVT_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 Event"]
57 #[inline(always)]
58 pub fn resaevt(&self) -> RESAEVT_R {
59 RESAEVT_R::new((self.bits & 0x7f) as u8)
60 }
61 #[doc = "Bits 7:13 - ETM Resource B Event"]
62 #[inline(always)]
63 pub fn resbevt(&self) -> RESBEVT_R {
64 RESBEVT_R::new(((self.bits >> 7) & 0x7f) as u8)
65 }
66 #[doc = "Bits 14:16 - ETM Function Event"]
67 #[inline(always)]
68 pub fn etmfcnevt(&self) -> ETMFCNEVT_R {
69 ETMFCNEVT_R::new(((self.bits >> 14) & 0x07) as u8)
70 }
71}
72impl W {
73 #[doc = "Bits 0:6 - ETM Resource A Event"]
74 #[inline(always)]
75 pub fn resaevt(&mut self) -> RESAEVT_W {
76 RESAEVT_W { w: self }
77 }
78 #[doc = "Bits 7:13 - ETM Resource B Event"]
79 #[inline(always)]
80 pub fn resbevt(&mut self) -> RESBEVT_W {
81 RESBEVT_W { w: self }
82 }
83 #[doc = "Bits 14:16 - ETM Function Event"]
84 #[inline(always)]
85 pub fn etmfcnevt(&mut self) -> ETMFCNEVT_W {
86 ETMFCNEVT_W { w: self }
87 }
88}