atsamv70j20/pmc/
pmc_focr.rs

1#[doc = "Register `PMC_FOCR` writer"]
2pub struct W(crate::W<PMC_FOCR_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<PMC_FOCR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl core::ops::DerefMut for W {
11    #[inline(always)]
12    fn deref_mut(&mut self) -> &mut Self::Target {
13        &mut self.0
14    }
15}
16impl From<crate::W<PMC_FOCR_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<PMC_FOCR_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "Field `FOCLR` writer - Fault Output Clear"]
23pub struct FOCLR_W<'a> {
24    w: &'a mut W,
25}
26impl<'a> FOCLR_W<'a> {
27    #[doc = r"Sets the field bit"]
28    #[inline(always)]
29    pub fn set_bit(self) -> &'a mut W {
30        self.bit(true)
31    }
32    #[doc = r"Clears the field bit"]
33    #[inline(always)]
34    pub fn clear_bit(self) -> &'a mut W {
35        self.bit(false)
36    }
37    #[doc = r"Writes raw bits to the field"]
38    #[inline(always)]
39    pub fn bit(self, value: bool) -> &'a mut W {
40        self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
41        self.w
42    }
43}
44impl W {
45    #[doc = "Bit 0 - Fault Output Clear"]
46    #[inline(always)]
47    pub fn foclr(&mut self) -> FOCLR_W {
48        FOCLR_W { w: self }
49    }
50    #[doc = "Writes raw bits to the register."]
51    #[inline(always)]
52    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
53        self.0.bits(bits);
54        self
55    }
56}
57#[doc = "Fault Output Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pmc_focr](index.html) module"]
58pub struct PMC_FOCR_SPEC;
59impl crate::RegisterSpec for PMC_FOCR_SPEC {
60    type Ux = u32;
61}
62#[doc = "`write(|w| ..)` method takes [pmc_focr::W](W) writer structure"]
63impl crate::Writable for PMC_FOCR_SPEC {
64    type Writer = W;
65}
66#[doc = "`reset()` method sets PMC_FOCR to value 0"]
67impl crate::Resettable for PMC_FOCR_SPEC {
68    #[inline(always)]
69    fn reset_value() -> Self::Ux {
70        0
71    }
72}