atsamd51j/icm/
uasr.rs
1#[doc = "Register `UASR` reader"]
2pub type R = crate::R<UasrSpec>;
3#[doc = "Undefined Register Access Trace\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5#[repr(u8)]
6pub enum Uratselect {
7 #[doc = "0: Unspecified structure member set to one detected when the descriptor is loaded"]
8 UnspecStructMember = 0,
9 #[doc = "1: CFG modified during active monitoring"]
10 CfgModified = 1,
11 #[doc = "2: DSCR modified during active monitoring"]
12 DscrModified = 2,
13 #[doc = "3: HASH modified during active monitoring"]
14 HashModified = 3,
15 #[doc = "4: Write-only register read access"]
16 ReadAccess = 4,
17}
18impl From<Uratselect> for u8 {
19 #[inline(always)]
20 fn from(variant: Uratselect) -> Self {
21 variant as _
22 }
23}
24impl crate::FieldSpec for Uratselect {
25 type Ux = u8;
26}
27impl crate::IsEnum for Uratselect {}
28#[doc = "Field `URAT` reader - Undefined Register Access Trace"]
29pub type UratR = crate::FieldReader<Uratselect>;
30impl UratR {
31 #[doc = "Get enumerated values variant"]
32 #[inline(always)]
33 pub const fn variant(&self) -> Option<Uratselect> {
34 match self.bits {
35 0 => Some(Uratselect::UnspecStructMember),
36 1 => Some(Uratselect::CfgModified),
37 2 => Some(Uratselect::DscrModified),
38 3 => Some(Uratselect::HashModified),
39 4 => Some(Uratselect::ReadAccess),
40 _ => None,
41 }
42 }
43 #[doc = "Unspecified structure member set to one detected when the descriptor is loaded"]
44 #[inline(always)]
45 pub fn is_unspec_struct_member(&self) -> bool {
46 *self == Uratselect::UnspecStructMember
47 }
48 #[doc = "CFG modified during active monitoring"]
49 #[inline(always)]
50 pub fn is_cfg_modified(&self) -> bool {
51 *self == Uratselect::CfgModified
52 }
53 #[doc = "DSCR modified during active monitoring"]
54 #[inline(always)]
55 pub fn is_dscr_modified(&self) -> bool {
56 *self == Uratselect::DscrModified
57 }
58 #[doc = "HASH modified during active monitoring"]
59 #[inline(always)]
60 pub fn is_hash_modified(&self) -> bool {
61 *self == Uratselect::HashModified
62 }
63 #[doc = "Write-only register read access"]
64 #[inline(always)]
65 pub fn is_read_access(&self) -> bool {
66 *self == Uratselect::ReadAccess
67 }
68}
69impl R {
70 #[doc = "Bits 0:2 - Undefined Register Access Trace"]
71 #[inline(always)]
72 pub fn urat(&self) -> UratR {
73 UratR::new((self.bits & 7) as u8)
74 }
75}
76#[doc = "Undefined Access Status\n\nYou can [`read`](crate::Reg::read) this register and get [`uasr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct UasrSpec;
78impl crate::RegisterSpec for UasrSpec {
79 type Ux = u32;
80}
81#[doc = "`read()` method returns [`uasr::R`](R) reader structure"]
82impl crate::Readable for UasrSpec {}
83#[doc = "`reset()` method sets UASR to value 0"]
84impl crate::Resettable for UasrSpec {
85 const RESET_VALUE: u32 = 0;
86}