mcxa_pac/pkc0/
pkc_access_err.rs

1#[doc = "Register `PKC_ACCESS_ERR` reader"]
2pub type R = crate::R<PkcAccessErrSpec>;
3#[doc = "Field `APB_NOTAV` reader - APB Error"]
4pub type ApbNotavR = crate::BitReader;
5#[doc = "Field `APB_WRGMD` reader - APB Error"]
6pub type ApbWrgmdR = crate::BitReader;
7#[doc = "Field `APB_MASTER` reader - APB Master that triggered first APB error (APB_WRGMD or APB_NOTAV)"]
8pub type ApbMasterR = crate::FieldReader;
9#[doc = "Field `AHB` reader - AHB Error"]
10pub type AhbR = crate::BitReader;
11#[doc = "Field `PKCC` reader - Error in PKC coprocessor kernel"]
12pub type PkccR = crate::BitReader;
13#[doc = "Field `FDET` reader - Error due to error detection circuitry"]
14pub type FdetR = crate::BitReader;
15#[doc = "Field `CTRL` reader - Error in PKC software control"]
16pub type CtrlR = crate::BitReader;
17#[doc = "Field `UCRC` reader - Error in layer2 CRC check."]
18pub type UcrcR = crate::BitReader;
19impl R {
20    #[doc = "Bit 0 - APB Error"]
21    #[inline(always)]
22    pub fn apb_notav(&self) -> ApbNotavR {
23        ApbNotavR::new((self.bits & 1) != 0)
24    }
25    #[doc = "Bit 1 - APB Error"]
26    #[inline(always)]
27    pub fn apb_wrgmd(&self) -> ApbWrgmdR {
28        ApbWrgmdR::new(((self.bits >> 1) & 1) != 0)
29    }
30    #[doc = "Bits 4:7 - APB Master that triggered first APB error (APB_WRGMD or APB_NOTAV)"]
31    #[inline(always)]
32    pub fn apb_master(&self) -> ApbMasterR {
33        ApbMasterR::new(((self.bits >> 4) & 0x0f) as u8)
34    }
35    #[doc = "Bit 10 - AHB Error"]
36    #[inline(always)]
37    pub fn ahb(&self) -> AhbR {
38        AhbR::new(((self.bits >> 10) & 1) != 0)
39    }
40    #[doc = "Bit 16 - Error in PKC coprocessor kernel"]
41    #[inline(always)]
42    pub fn pkcc(&self) -> PkccR {
43        PkccR::new(((self.bits >> 16) & 1) != 0)
44    }
45    #[doc = "Bit 17 - Error due to error detection circuitry"]
46    #[inline(always)]
47    pub fn fdet(&self) -> FdetR {
48        FdetR::new(((self.bits >> 17) & 1) != 0)
49    }
50    #[doc = "Bit 18 - Error in PKC software control"]
51    #[inline(always)]
52    pub fn ctrl(&self) -> CtrlR {
53        CtrlR::new(((self.bits >> 18) & 1) != 0)
54    }
55    #[doc = "Bit 19 - Error in layer2 CRC check."]
56    #[inline(always)]
57    pub fn ucrc(&self) -> UcrcR {
58        UcrcR::new(((self.bits >> 19) & 1) != 0)
59    }
60}
61#[cfg(feature = "debug")]
62impl core::fmt::Debug for R {
63    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
64        f.debug_struct("PKC_ACCESS_ERR")
65            .field("apb_notav", &self.apb_notav())
66            .field("apb_wrgmd", &self.apb_wrgmd())
67            .field("apb_master", &self.apb_master())
68            .field("ahb", &self.ahb())
69            .field("pkcc", &self.pkcc())
70            .field("fdet", &self.fdet())
71            .field("ctrl", &self.ctrl())
72            .field("ucrc", &self.ucrc())
73            .finish()
74    }
75}
76#[doc = "Access Error\n\nYou can [`read`](crate::Reg::read) this register and get [`pkc_access_err::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct PkcAccessErrSpec;
78impl crate::RegisterSpec for PkcAccessErrSpec {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`pkc_access_err::R`](R) reader structure"]
82impl crate::Readable for PkcAccessErrSpec {}
83#[doc = "`reset()` method sets PKC_ACCESS_ERR to value 0"]
84impl crate::Resettable for PkcAccessErrSpec {}