esp32p4/isp/
sharp_filter2.rs1#[doc = "Register `SHARP_FILTER2` reader"]
2pub type R = crate::R<SHARP_FILTER2_SPEC>;
3#[doc = "Register `SHARP_FILTER2` writer"]
4pub type W = crate::W<SHARP_FILTER2_SPEC>;
5#[doc = "Field `SHARP_FILTER_COE20` reader - this field configures usm filter coefficient"]
6pub type SHARP_FILTER_COE20_R = crate::FieldReader;
7#[doc = "Field `SHARP_FILTER_COE20` writer - this field configures usm filter coefficient"]
8pub type SHARP_FILTER_COE20_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
9#[doc = "Field `SHARP_FILTER_COE21` reader - this field configures usm filter coefficient"]
10pub type SHARP_FILTER_COE21_R = crate::FieldReader;
11#[doc = "Field `SHARP_FILTER_COE21` writer - this field configures usm filter coefficient"]
12pub type SHARP_FILTER_COE21_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
13#[doc = "Field `SHARP_FILTER_COE22` reader - this field configures usm filter coefficient"]
14pub type SHARP_FILTER_COE22_R = crate::FieldReader;
15#[doc = "Field `SHARP_FILTER_COE22` writer - this field configures usm filter coefficient"]
16pub type SHARP_FILTER_COE22_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
17impl R {
18 #[doc = "Bits 0:4 - this field configures usm filter coefficient"]
19 #[inline(always)]
20 pub fn sharp_filter_coe20(&self) -> SHARP_FILTER_COE20_R {
21 SHARP_FILTER_COE20_R::new((self.bits & 0x1f) as u8)
22 }
23 #[doc = "Bits 5:9 - this field configures usm filter coefficient"]
24 #[inline(always)]
25 pub fn sharp_filter_coe21(&self) -> SHARP_FILTER_COE21_R {
26 SHARP_FILTER_COE21_R::new(((self.bits >> 5) & 0x1f) as u8)
27 }
28 #[doc = "Bits 10:14 - this field configures usm filter coefficient"]
29 #[inline(always)]
30 pub fn sharp_filter_coe22(&self) -> SHARP_FILTER_COE22_R {
31 SHARP_FILTER_COE22_R::new(((self.bits >> 10) & 0x1f) as u8)
32 }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37 f.debug_struct("SHARP_FILTER2")
38 .field(
39 "sharp_filter_coe20",
40 &format_args!("{}", self.sharp_filter_coe20().bits()),
41 )
42 .field(
43 "sharp_filter_coe21",
44 &format_args!("{}", self.sharp_filter_coe21().bits()),
45 )
46 .field(
47 "sharp_filter_coe22",
48 &format_args!("{}", self.sharp_filter_coe22().bits()),
49 )
50 .finish()
51 }
52}
53#[cfg(feature = "impl-register-debug")]
54impl core::fmt::Debug for crate::generic::Reg<SHARP_FILTER2_SPEC> {
55 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
56 core::fmt::Debug::fmt(&self.read(), f)
57 }
58}
59impl W {
60 #[doc = "Bits 0:4 - this field configures usm filter coefficient"]
61 #[inline(always)]
62 #[must_use]
63 pub fn sharp_filter_coe20(&mut self) -> SHARP_FILTER_COE20_W<SHARP_FILTER2_SPEC> {
64 SHARP_FILTER_COE20_W::new(self, 0)
65 }
66 #[doc = "Bits 5:9 - this field configures usm filter coefficient"]
67 #[inline(always)]
68 #[must_use]
69 pub fn sharp_filter_coe21(&mut self) -> SHARP_FILTER_COE21_W<SHARP_FILTER2_SPEC> {
70 SHARP_FILTER_COE21_W::new(self, 5)
71 }
72 #[doc = "Bits 10:14 - this field configures usm filter coefficient"]
73 #[inline(always)]
74 #[must_use]
75 pub fn sharp_filter_coe22(&mut self) -> SHARP_FILTER_COE22_W<SHARP_FILTER2_SPEC> {
76 SHARP_FILTER_COE22_W::new(self, 10)
77 }
78}
79#[doc = "sharp usm config register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sharp_filter2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sharp_filter2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
80pub struct SHARP_FILTER2_SPEC;
81impl crate::RegisterSpec for SHARP_FILTER2_SPEC {
82 type Ux = u32;
83}
84#[doc = "`read()` method returns [`sharp_filter2::R`](R) reader structure"]
85impl crate::Readable for SHARP_FILTER2_SPEC {}
86#[doc = "`write(|w| ..)` method takes [`sharp_filter2::W`](W) writer structure"]
87impl crate::Writable for SHARP_FILTER2_SPEC {
88 type Safety = crate::Unsafe;
89 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
90 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
91}
92#[doc = "`reset()` method sets SHARP_FILTER2 to value 0x0441"]
93impl crate::Resettable for SHARP_FILTER2_SPEC {
94 const RESET_VALUE: u32 = 0x0441;
95}