Skip to main content

mcxa_pac/inputmux0/
trigfil.rs

1#[doc = "Register `TRIGFIL[%s]` reader"]
2pub type R = crate::R<TrigfilSpec>;
3#[doc = "Register `TRIGFIL[%s]` writer"]
4pub type W = crate::W<TrigfilSpec>;
5#[doc = "Field `FILT_PER` reader - Input Filter Sample Period"]
6pub type FiltPerR = crate::FieldReader;
7#[doc = "Field `FILT_PER` writer - Input Filter Sample Period"]
8pub type FiltPerW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `FILT_CNT` reader - Input Filter Sample Count"]
10pub type FiltCntR = crate::FieldReader;
11#[doc = "Field `FILT_CNT` writer - Input Filter Sample Count"]
12pub type FiltCntW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
13impl R {
14    #[doc = "Bits 0:7 - Input Filter Sample Period"]
15    #[inline(always)]
16    pub fn filt_per(&self) -> FiltPerR {
17        FiltPerR::new((self.bits & 0xff) as u8)
18    }
19    #[doc = "Bits 8:10 - Input Filter Sample Count"]
20    #[inline(always)]
21    pub fn filt_cnt(&self) -> FiltCntR {
22        FiltCntR::new(((self.bits >> 8) & 7) as u8)
23    }
24}
25#[cfg(feature = "debug")]
26impl core::fmt::Debug for R {
27    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28        f.debug_struct("TRIGFIL")
29            .field("filt_per", &self.filt_per())
30            .field("filt_cnt", &self.filt_cnt())
31            .finish()
32    }
33}
34impl W {
35    #[doc = "Bits 0:7 - Input Filter Sample Period"]
36    #[inline(always)]
37    pub fn filt_per(&mut self) -> FiltPerW<'_, TrigfilSpec> {
38        FiltPerW::new(self, 0)
39    }
40    #[doc = "Bits 8:10 - Input Filter Sample Count"]
41    #[inline(always)]
42    pub fn filt_cnt(&mut self) -> FiltCntW<'_, TrigfilSpec> {
43        FiltCntW::new(self, 8)
44    }
45}
46#[doc = "TRIGFIL control\n\nYou can [`read`](crate::Reg::read) this register and get [`trigfil::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`trigfil::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct TrigfilSpec;
48impl crate::RegisterSpec for TrigfilSpec {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`trigfil::R`](R) reader structure"]
52impl crate::Readable for TrigfilSpec {}
53#[doc = "`write(|w| ..)` method takes [`trigfil::W`](W) writer structure"]
54impl crate::Writable for TrigfilSpec {
55    type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets TRIGFIL[%s] to value 0"]
58impl crate::Resettable for TrigfilSpec {}