Skip to main content

rsl10_pac/sysctrl/
sysctrl_lpdsp32_debug_cfg.rs

1#[doc = "Reader of register SYSCTRL_LPDSP32_DEBUG_CFG"]
2pub type R = crate::R<u32, super::SYSCTRL_LPDSP32_DEBUG_CFG>;
3#[doc = "Writer for register SYSCTRL_LPDSP32_DEBUG_CFG"]
4pub type W = crate::W<u32, super::SYSCTRL_LPDSP32_DEBUG_CFG>;
5#[doc = "Register SYSCTRL_LPDSP32_DEBUG_CFG `reset()`'s with value 0"]
6impl crate::ResetValue for super::SYSCTRL_LPDSP32_DEBUG_CFG {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "LPDSP32 exit powerdown mode configuration when halted\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15pub enum LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_A {
16    #[doc = "0: LPDSP32 exit powerdown when halted disabled"]
17    LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_DISABLED = 0,
18    #[doc = "1: LPDSP32 exit powerdown when halted enabled"]
19    LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_ENABLED = 1,
20}
21impl From<LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_A> for bool {
22    #[inline(always)]
23    fn from(variant: LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_A) -> Self {
24        variant as u8 != 0
25    }
26}
27#[doc = "Reader of field `LPDSP32_EXIT_POWERDOWN_WHEN_HALTED`"]
28pub type LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_R =
29    crate::R<bool, LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_A>;
30impl LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_R {
31    #[doc = r"Get enumerated values variant"]
32    #[inline(always)]
33    pub fn variant(&self) -> LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_A {
34        match self.bits {
35            false => {
36                LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_A::LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_DISABLED
37            }
38            true => {
39                LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_A::LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_ENABLED
40            }
41        }
42    }
43    #[doc = "Checks if the value of the field is `LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_DISABLED`"]
44    #[inline(always)]
45    pub fn is_lpdsp32_exit_powerdown_when_halted_disabled(&self) -> bool {
46        *self == LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_A::LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_DISABLED
47    }
48    #[doc = "Checks if the value of the field is `LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_ENABLED`"]
49    #[inline(always)]
50    pub fn is_lpdsp32_exit_powerdown_when_halted_enabled(&self) -> bool {
51        *self == LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_A::LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_ENABLED
52    }
53}
54#[doc = "Write proxy for field `LPDSP32_EXIT_POWERDOWN_WHEN_HALTED`"]
55pub struct LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_W<'a> {
56    w: &'a mut W,
57}
58impl<'a> LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_W<'a> {
59    #[doc = r"Writes `variant` to the field"]
60    #[inline(always)]
61    pub fn variant(self, variant: LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_A) -> &'a mut W {
62        {
63            self.bit(variant.into())
64        }
65    }
66    #[doc = "LPDSP32 exit powerdown when halted disabled"]
67    #[inline(always)]
68    pub fn lpdsp32_exit_powerdown_when_halted_disabled(self) -> &'a mut W {
69        self.variant(
70            LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_A::LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_DISABLED,
71        )
72    }
73    #[doc = "LPDSP32 exit powerdown when halted enabled"]
74    #[inline(always)]
75    pub fn lpdsp32_exit_powerdown_when_halted_enabled(self) -> &'a mut W {
76        self.variant(
77            LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_A::LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_ENABLED,
78        )
79    }
80    #[doc = r"Sets the field bit"]
81    #[inline(always)]
82    pub fn set_bit(self) -> &'a mut W {
83        self.bit(true)
84    }
85    #[doc = r"Clears the field bit"]
86    #[inline(always)]
87    pub fn clear_bit(self) -> &'a mut W {
88        self.bit(false)
89    }
90    #[doc = r"Writes raw bits to the field"]
91    #[inline(always)]
92    pub fn bit(self, value: bool) -> &'a mut W {
93        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
94        self.w
95    }
96}
97#[doc = "LPDSP32 debug port enable\n\nValue on reset: 0"]
98#[derive(Clone, Copy, Debug, PartialEq)]
99pub enum LPDSP32_DEBUG_ENABLE_A {
100    #[doc = "0: LPDSP32 debug port disabled"]
101    LPDSP32_DEBUG_DISABLED = 0,
102    #[doc = "1: LPDSP32 debug port enabled"]
103    LPDSP32_DEBUG_ENABLED = 1,
104}
105impl From<LPDSP32_DEBUG_ENABLE_A> for bool {
106    #[inline(always)]
107    fn from(variant: LPDSP32_DEBUG_ENABLE_A) -> Self {
108        variant as u8 != 0
109    }
110}
111#[doc = "Reader of field `LPDSP32_DEBUG_ENABLE`"]
112pub type LPDSP32_DEBUG_ENABLE_R = crate::R<bool, LPDSP32_DEBUG_ENABLE_A>;
113impl LPDSP32_DEBUG_ENABLE_R {
114    #[doc = r"Get enumerated values variant"]
115    #[inline(always)]
116    pub fn variant(&self) -> LPDSP32_DEBUG_ENABLE_A {
117        match self.bits {
118            false => LPDSP32_DEBUG_ENABLE_A::LPDSP32_DEBUG_DISABLED,
119            true => LPDSP32_DEBUG_ENABLE_A::LPDSP32_DEBUG_ENABLED,
120        }
121    }
122    #[doc = "Checks if the value of the field is `LPDSP32_DEBUG_DISABLED`"]
123    #[inline(always)]
124    pub fn is_lpdsp32_debug_disabled(&self) -> bool {
125        *self == LPDSP32_DEBUG_ENABLE_A::LPDSP32_DEBUG_DISABLED
126    }
127    #[doc = "Checks if the value of the field is `LPDSP32_DEBUG_ENABLED`"]
128    #[inline(always)]
129    pub fn is_lpdsp32_debug_enabled(&self) -> bool {
130        *self == LPDSP32_DEBUG_ENABLE_A::LPDSP32_DEBUG_ENABLED
131    }
132}
133#[doc = "Write proxy for field `LPDSP32_DEBUG_ENABLE`"]
134pub struct LPDSP32_DEBUG_ENABLE_W<'a> {
135    w: &'a mut W,
136}
137impl<'a> LPDSP32_DEBUG_ENABLE_W<'a> {
138    #[doc = r"Writes `variant` to the field"]
139    #[inline(always)]
140    pub fn variant(self, variant: LPDSP32_DEBUG_ENABLE_A) -> &'a mut W {
141        {
142            self.bit(variant.into())
143        }
144    }
145    #[doc = "LPDSP32 debug port disabled"]
146    #[inline(always)]
147    pub fn lpdsp32_debug_disabled(self) -> &'a mut W {
148        self.variant(LPDSP32_DEBUG_ENABLE_A::LPDSP32_DEBUG_DISABLED)
149    }
150    #[doc = "LPDSP32 debug port enabled"]
151    #[inline(always)]
152    pub fn lpdsp32_debug_enabled(self) -> &'a mut W {
153        self.variant(LPDSP32_DEBUG_ENABLE_A::LPDSP32_DEBUG_ENABLED)
154    }
155    #[doc = r"Sets the field bit"]
156    #[inline(always)]
157    pub fn set_bit(self) -> &'a mut W {
158        self.bit(true)
159    }
160    #[doc = r"Clears the field bit"]
161    #[inline(always)]
162    pub fn clear_bit(self) -> &'a mut W {
163        self.bit(false)
164    }
165    #[doc = r"Writes raw bits to the field"]
166    #[inline(always)]
167    pub fn bit(self, value: bool) -> &'a mut W {
168        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
169        self.w
170    }
171}
172impl R {
173    #[doc = "Bit 1 - LPDSP32 exit powerdown mode configuration when halted"]
174    #[inline(always)]
175    pub fn lpdsp32_exit_powerdown_when_halted(&self) -> LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_R {
176        LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_R::new(((self.bits >> 1) & 0x01) != 0)
177    }
178    #[doc = "Bit 0 - LPDSP32 debug port enable"]
179    #[inline(always)]
180    pub fn lpdsp32_debug_enable(&self) -> LPDSP32_DEBUG_ENABLE_R {
181        LPDSP32_DEBUG_ENABLE_R::new((self.bits & 0x01) != 0)
182    }
183}
184impl W {
185    #[doc = "Bit 1 - LPDSP32 exit powerdown mode configuration when halted"]
186    #[inline(always)]
187    pub fn lpdsp32_exit_powerdown_when_halted(&mut self) -> LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_W {
188        LPDSP32_EXIT_POWERDOWN_WHEN_HALTED_W { w: self }
189    }
190    #[doc = "Bit 0 - LPDSP32 debug port enable"]
191    #[inline(always)]
192    pub fn lpdsp32_debug_enable(&mut self) -> LPDSP32_DEBUG_ENABLE_W {
193        LPDSP32_DEBUG_ENABLE_W { w: self }
194    }
195}