mimxrt685s_pac/dmic0/
use2fs.rs

1#[doc = "Register `USE2FS` reader"]
2pub type R = crate::R<Use2fsSpec>;
3#[doc = "Register `USE2FS` writer"]
4pub type W = crate::W<Use2fsSpec>;
5#[doc = "Use 2FS register\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Use2fs {
9    #[doc = "0: Use 1FS output for PCM data."]
10    Use1fs = 0,
11    #[doc = "1: Use 2FS output for PCM data."]
12    Use2fs = 1,
13}
14impl From<Use2fs> for bool {
15    #[inline(always)]
16    fn from(variant: Use2fs) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `USE2FS` reader - Use 2FS register"]
21pub type Use2fsR = crate::BitReader<Use2fs>;
22impl Use2fsR {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> Use2fs {
26        match self.bits {
27            false => Use2fs::Use1fs,
28            true => Use2fs::Use2fs,
29        }
30    }
31    #[doc = "Use 1FS output for PCM data."]
32    #[inline(always)]
33    pub fn is_use_1fs(&self) -> bool {
34        *self == Use2fs::Use1fs
35    }
36    #[doc = "Use 2FS output for PCM data."]
37    #[inline(always)]
38    pub fn is_use_2fs(&self) -> bool {
39        *self == Use2fs::Use2fs
40    }
41}
42#[doc = "Field `USE2FS` writer - Use 2FS register"]
43pub type Use2fsW<'a, REG> = crate::BitWriter<'a, REG, Use2fs>;
44impl<'a, REG> Use2fsW<'a, REG>
45where
46    REG: crate::Writable + crate::RegisterSpec,
47{
48    #[doc = "Use 1FS output for PCM data."]
49    #[inline(always)]
50    pub fn use_1fs(self) -> &'a mut crate::W<REG> {
51        self.variant(Use2fs::Use1fs)
52    }
53    #[doc = "Use 2FS output for PCM data."]
54    #[inline(always)]
55    pub fn use_2fs(self) -> &'a mut crate::W<REG> {
56        self.variant(Use2fs::Use2fs)
57    }
58}
59impl R {
60    #[doc = "Bit 0 - Use 2FS register"]
61    #[inline(always)]
62    pub fn use2fs(&self) -> Use2fsR {
63        Use2fsR::new((self.bits & 1) != 0)
64    }
65}
66#[cfg(feature = "debug")]
67impl core::fmt::Debug for R {
68    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
69        f.debug_struct("USE2FS")
70            .field("use2fs", &self.use2fs())
71            .finish()
72    }
73}
74impl W {
75    #[doc = "Bit 0 - Use 2FS register"]
76    #[inline(always)]
77    pub fn use2fs(&mut self) -> Use2fsW<Use2fsSpec> {
78        Use2fsW::new(self, 0)
79    }
80}
81#[doc = "Use 2FS register\n\nYou can [`read`](crate::Reg::read) this register and get [`use2fs::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`use2fs::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
82pub struct Use2fsSpec;
83impl crate::RegisterSpec for Use2fsSpec {
84    type Ux = u32;
85}
86#[doc = "`read()` method returns [`use2fs::R`](R) reader structure"]
87impl crate::Readable for Use2fsSpec {}
88#[doc = "`write(|w| ..)` method takes [`use2fs::W`](W) writer structure"]
89impl crate::Writable for Use2fsSpec {
90    type Safety = crate::Unsafe;
91    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
92    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
93}
94#[doc = "`reset()` method sets USE2FS to value 0"]
95impl crate::Resettable for Use2fsSpec {
96    const RESET_VALUE: u32 = 0;
97}