eos_s3/wdt/
wdogitop.rs

1#[doc = "Register `WDOGITOP` writer"]
2pub struct W(crate::W<WDOGITOP_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<WDOGITOP_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<WDOGITOP_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<WDOGITOP_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "Watchdog Integration Test Output Set Register When the WDOGITOP Register is in integration test mode, the values in this register directly drive the enabled interrupt output and reset output.\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq)]
24#[repr(u8)]
25pub enum WDOGITOP_AW {
26    #[doc = "0: Select integration Test with WDOCRES value"]
27    WDOCRES = 0,
28    #[doc = "1: Select integration Test with WDOGINT value"]
29    WDOGINT = 1,
30}
31impl From<WDOGITOP_AW> for u8 {
32    #[inline(always)]
33    fn from(variant: WDOGITOP_AW) -> Self {
34        variant as _
35    }
36}
37#[doc = "Field `WDOGITOP` writer - Watchdog Integration Test Output Set Register When the WDOGITOP Register is in integration test mode, the values in this register directly drive the enabled interrupt output and reset output."]
38pub struct WDOGITOP_W<'a> {
39    w: &'a mut W,
40}
41impl<'a> WDOGITOP_W<'a> {
42    #[doc = r"Writes `variant` to the field"]
43    #[inline(always)]
44    pub fn variant(self, variant: WDOGITOP_AW) -> &'a mut W {
45        unsafe { self.bits(variant.into()) }
46    }
47    #[doc = "Select integration Test with WDOCRES value"]
48    #[inline(always)]
49    pub fn wdocres(self) -> &'a mut W {
50        self.variant(WDOGITOP_AW::WDOCRES)
51    }
52    #[doc = "Select integration Test with WDOGINT value"]
53    #[inline(always)]
54    pub fn wdogint(self) -> &'a mut W {
55        self.variant(WDOGITOP_AW::WDOGINT)
56    }
57    #[doc = r"Writes raw bits to the field"]
58    #[inline(always)]
59    pub unsafe fn bits(self, value: u8) -> &'a mut W {
60        self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03);
61        self.w
62    }
63}
64impl W {
65    #[doc = "Bits 0:1 - Watchdog Integration Test Output Set Register When the WDOGITOP Register is in integration test mode, the values in this register directly drive the enabled interrupt output and reset output."]
66    #[inline(always)]
67    pub fn wdogitop(&mut self) -> WDOGITOP_W {
68        WDOGITOP_W { w: self }
69    }
70    #[doc = "Writes raw bits to the register."]
71    #[inline(always)]
72    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
73        self.0.bits(bits);
74        self
75    }
76}
77#[doc = "Watchdog Integration Test Output Set Register When the WDOGITOP Register is in integration test mode, the values in this register directly drive the enabled interrupt output and reset output.\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 [wdogitop](index.html) module"]
78pub struct WDOGITOP_SPEC;
79impl crate::RegisterSpec for WDOGITOP_SPEC {
80    type Ux = u32;
81}
82#[doc = "`write(|w| ..)` method takes [wdogitop::W](W) writer structure"]
83impl crate::Writable for WDOGITOP_SPEC {
84    type Writer = W;
85}
86#[doc = "`reset()` method sets WDOGITOP to value 0"]
87impl crate::Resettable for WDOGITOP_SPEC {
88    #[inline(always)]
89    fn reset_value() -> Self::Ux {
90        0
91    }
92}