esp32h2/hp_apm/m/
exception_info0.rs

1#[doc = "Register `EXCEPTION_INFO0` reader"]
2pub type R = crate::R<EXCEPTION_INFO0_SPEC>;
3#[doc = "Field `EXCEPTION_REGION` reader - Exception region"]
4pub type EXCEPTION_REGION_R = crate::FieldReader<u16>;
5#[doc = "Field `EXCEPTION_MODE` reader - Exception mode"]
6pub type EXCEPTION_MODE_R = crate::FieldReader;
7#[doc = "Field `EXCEPTION_ID` reader - Exception id information"]
8pub type EXCEPTION_ID_R = crate::FieldReader;
9impl R {
10    #[doc = "Bits 0:15 - Exception region"]
11    #[inline(always)]
12    pub fn exception_region(&self) -> EXCEPTION_REGION_R {
13        EXCEPTION_REGION_R::new((self.bits & 0xffff) as u16)
14    }
15    #[doc = "Bits 16:17 - Exception mode"]
16    #[inline(always)]
17    pub fn exception_mode(&self) -> EXCEPTION_MODE_R {
18        EXCEPTION_MODE_R::new(((self.bits >> 16) & 3) as u8)
19    }
20    #[doc = "Bits 18:22 - Exception id information"]
21    #[inline(always)]
22    pub fn exception_id(&self) -> EXCEPTION_ID_R {
23        EXCEPTION_ID_R::new(((self.bits >> 18) & 0x1f) as u8)
24    }
25}
26#[cfg(feature = "impl-register-debug")]
27impl core::fmt::Debug for R {
28    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
29        f.debug_struct("EXCEPTION_INFO0")
30            .field("exception_region", &self.exception_region())
31            .field("exception_mode", &self.exception_mode())
32            .field("exception_id", &self.exception_id())
33            .finish()
34    }
35}
36#[doc = "M0 exception_info0 register\n\nYou can [`read`](crate::Reg::read) this register and get [`exception_info0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
37pub struct EXCEPTION_INFO0_SPEC;
38impl crate::RegisterSpec for EXCEPTION_INFO0_SPEC {
39    type Ux = u32;
40}
41#[doc = "`read()` method returns [`exception_info0::R`](R) reader structure"]
42impl crate::Readable for EXCEPTION_INFO0_SPEC {}
43#[doc = "`reset()` method sets EXCEPTION_INFO0 to value 0"]
44impl crate::Resettable for EXCEPTION_INFO0_SPEC {
45    const RESET_VALUE: u32 = 0;
46}