mimxrt685s_pac/dmic0/
decreset.rs1#[doc = "Register `DECRESET` reader"]
2pub type R = crate::R<DecresetSpec>;
3#[doc = "Register `DECRESET` writer"]
4pub type W = crate::W<DecresetSpec>;
5#[doc = "no description available\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8#[repr(u8)]
9pub enum Decreset {
10 #[doc = "0: release reset to decimator"]
11 ReleaseReset = 0,
12 #[doc = "1: assert reset to decimator Note : resets are applied in pairs. So bit 0 corresponds to channels 0/1, bit1 corresponds to channels 2/3, bit2 to channel 4/5 and bit3 to channel 6/7"]
13 AssertReset = 1,
14}
15impl From<Decreset> for u8 {
16 #[inline(always)]
17 fn from(variant: Decreset) -> Self {
18 variant as _
19 }
20}
21impl crate::FieldSpec for Decreset {
22 type Ux = u8;
23}
24impl crate::IsEnum for Decreset {}
25#[doc = "Field `DECRESET` reader - no description available"]
26pub type DecresetR = crate::FieldReader<Decreset>;
27impl DecresetR {
28 #[doc = "Get enumerated values variant"]
29 #[inline(always)]
30 pub const fn variant(&self) -> Option<Decreset> {
31 match self.bits {
32 0 => Some(Decreset::ReleaseReset),
33 1 => Some(Decreset::AssertReset),
34 _ => None,
35 }
36 }
37 #[doc = "release reset to decimator"]
38 #[inline(always)]
39 pub fn is_release_reset(&self) -> bool {
40 *self == Decreset::ReleaseReset
41 }
42 #[doc = "assert reset to decimator Note : resets are applied in pairs. So bit 0 corresponds to channels 0/1, bit1 corresponds to channels 2/3, bit2 to channel 4/5 and bit3 to channel 6/7"]
43 #[inline(always)]
44 pub fn is_assert_reset(&self) -> bool {
45 *self == Decreset::AssertReset
46 }
47}
48#[doc = "Field `DECRESET` writer - no description available"]
49pub type DecresetW<'a, REG> = crate::FieldWriter<'a, REG, 8, Decreset>;
50impl<'a, REG> DecresetW<'a, REG>
51where
52 REG: crate::Writable + crate::RegisterSpec,
53 REG::Ux: From<u8>,
54{
55 #[doc = "release reset to decimator"]
56 #[inline(always)]
57 pub fn release_reset(self) -> &'a mut crate::W<REG> {
58 self.variant(Decreset::ReleaseReset)
59 }
60 #[doc = "assert reset to decimator Note : resets are applied in pairs. So bit 0 corresponds to channels 0/1, bit1 corresponds to channels 2/3, bit2 to channel 4/5 and bit3 to channel 6/7"]
61 #[inline(always)]
62 pub fn assert_reset(self) -> &'a mut crate::W<REG> {
63 self.variant(Decreset::AssertReset)
64 }
65}
66impl R {
67 #[doc = "Bits 0:7 - no description available"]
68 #[inline(always)]
69 pub fn decreset(&self) -> DecresetR {
70 DecresetR::new((self.bits & 0xff) as u8)
71 }
72}
73#[cfg(feature = "debug")]
74impl core::fmt::Debug for R {
75 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
76 f.debug_struct("DECRESET")
77 .field("decreset", &self.decreset())
78 .finish()
79 }
80}
81impl W {
82 #[doc = "Bits 0:7 - no description available"]
83 #[inline(always)]
84 pub fn decreset(&mut self) -> DecresetW<DecresetSpec> {
85 DecresetW::new(self, 0)
86 }
87}
88#[doc = "no description available\n\nYou can [`read`](crate::Reg::read) this register and get [`decreset::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`decreset::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
89pub struct DecresetSpec;
90impl crate::RegisterSpec for DecresetSpec {
91 type Ux = u32;
92}
93#[doc = "`read()` method returns [`decreset::R`](R) reader structure"]
94impl crate::Readable for DecresetSpec {}
95#[doc = "`write(|w| ..)` method takes [`decreset::W`](W) writer structure"]
96impl crate::Writable for DecresetSpec {
97 type Safety = crate::Unsafe;
98 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
99 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
100}
101#[doc = "`reset()` method sets DECRESET to value 0"]
102impl crate::Resettable for DecresetSpec {
103 const RESET_VALUE: u32 = 0;
104}