atsamd51g/system_control/
hfsr.rs
1#[doc = "Register `HFSR` reader"]
2pub type R = crate::R<HfsrSpec>;
3#[doc = "Register `HFSR` writer"]
4pub type W = crate::W<HfsrSpec>;
5#[doc = "Field `VECTTBL` reader - BusFault on a Vector Table read during exception processing"]
6pub type VecttblR = crate::BitReader;
7#[doc = "Field `VECTTBL` writer - BusFault on a Vector Table read during exception processing"]
8pub type VecttblW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `FORCED` reader - Forced Hard Fault"]
10pub type ForcedR = crate::BitReader;
11#[doc = "Field `FORCED` writer - Forced Hard Fault"]
12pub type ForcedW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `DEBUGEVT` reader - Debug: always write 0"]
14pub type DebugevtR = crate::BitReader;
15#[doc = "Field `DEBUGEVT` writer - Debug: always write 0"]
16pub type DebugevtW<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18 #[doc = "Bit 1 - BusFault on a Vector Table read during exception processing"]
19 #[inline(always)]
20 pub fn vecttbl(&self) -> VecttblR {
21 VecttblR::new(((self.bits >> 1) & 1) != 0)
22 }
23 #[doc = "Bit 30 - Forced Hard Fault"]
24 #[inline(always)]
25 pub fn forced(&self) -> ForcedR {
26 ForcedR::new(((self.bits >> 30) & 1) != 0)
27 }
28 #[doc = "Bit 31 - Debug: always write 0"]
29 #[inline(always)]
30 pub fn debugevt(&self) -> DebugevtR {
31 DebugevtR::new(((self.bits >> 31) & 1) != 0)
32 }
33}
34impl W {
35 #[doc = "Bit 1 - BusFault on a Vector Table read during exception processing"]
36 #[inline(always)]
37 #[must_use]
38 pub fn vecttbl(&mut self) -> VecttblW<HfsrSpec> {
39 VecttblW::new(self, 1)
40 }
41 #[doc = "Bit 30 - Forced Hard Fault"]
42 #[inline(always)]
43 #[must_use]
44 pub fn forced(&mut self) -> ForcedW<HfsrSpec> {
45 ForcedW::new(self, 30)
46 }
47 #[doc = "Bit 31 - Debug: always write 0"]
48 #[inline(always)]
49 #[must_use]
50 pub fn debugevt(&mut self) -> DebugevtW<HfsrSpec> {
51 DebugevtW::new(self, 31)
52 }
53}
54#[doc = "HardFault Status Register\n\nYou can [`read`](crate::Reg::read) this register and get [`hfsr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`hfsr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct HfsrSpec;
56impl crate::RegisterSpec for HfsrSpec {
57 type Ux = u32;
58}
59#[doc = "`read()` method returns [`hfsr::R`](R) reader structure"]
60impl crate::Readable for HfsrSpec {}
61#[doc = "`write(|w| ..)` method takes [`hfsr::W`](W) writer structure"]
62impl crate::Writable for HfsrSpec {
63 type Safety = crate::Unsafe;
64 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
65 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
66}
67#[doc = "`reset()` method sets HFSR to value 0"]
68impl crate::Resettable for HfsrSpec {
69 const RESET_VALUE: u32 = 0;
70}