py32f0/py32f002a/adc/
calfir1.rs

1///Register `CALFIR1` reader
2pub struct R(crate::R<CALFIR1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CALFIR1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CALFIR1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CALFIR1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16///Register `CALFIR1` writer
17pub struct W(crate::W<CALFIR1_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CALFIR1_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<CALFIR1_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CALFIR1_SPEC>) -> Self {
34        W(writer)
35    }
36}
37///Field `CALC4IO` reader - Calibration C4 factor input
38pub type CALC4IO_R = crate::FieldReader<u8, u8>;
39///Field `CALC4IO` writer - Calibration C4 factor input
40pub type CALC4IO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CALFIR1_SPEC, u8, u8, 8, O>;
41///Field `CALC5IO` reader - Calibration C5 factor input
42pub type CALC5IO_R = crate::FieldReader<u8, u8>;
43///Field `CALC5IO` writer - Calibration C5 factor input
44pub type CALC5IO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CALFIR1_SPEC, u8, u8, 8, O>;
45///Field `CALBIO` reader - Calibration offset factor input
46pub type CALBIO_R = crate::FieldReader<u8, u8>;
47///Field `CALBIO` writer - Calibration offset factor input
48pub type CALBIO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CALFIR1_SPEC, u8, u8, 7, O>;
49impl R {
50    ///Bits 0:7 - Calibration C4 factor input
51    #[inline(always)]
52    pub fn calc4io(&self) -> CALC4IO_R {
53        CALC4IO_R::new((self.bits & 0xff) as u8)
54    }
55    ///Bits 8:15 - Calibration C5 factor input
56    #[inline(always)]
57    pub fn calc5io(&self) -> CALC5IO_R {
58        CALC5IO_R::new(((self.bits >> 8) & 0xff) as u8)
59    }
60    ///Bits 16:22 - Calibration offset factor input
61    #[inline(always)]
62    pub fn calbio(&self) -> CALBIO_R {
63        CALBIO_R::new(((self.bits >> 16) & 0x7f) as u8)
64    }
65}
66impl W {
67    ///Bits 0:7 - Calibration C4 factor input
68    #[inline(always)]
69    #[must_use]
70    pub fn calc4io(&mut self) -> CALC4IO_W<0> {
71        CALC4IO_W::new(self)
72    }
73    ///Bits 8:15 - Calibration C5 factor input
74    #[inline(always)]
75    #[must_use]
76    pub fn calc5io(&mut self) -> CALC5IO_W<8> {
77        CALC5IO_W::new(self)
78    }
79    ///Bits 16:22 - Calibration offset factor input
80    #[inline(always)]
81    #[must_use]
82    pub fn calbio(&mut self) -> CALBIO_W<16> {
83        CALBIO_W::new(self)
84    }
85    ///Writes raw bits to the register.
86    #[inline(always)]
87    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
88        self.0.bits(bits);
89        self
90    }
91}
92/**ADC calibration factor input register 1
93
94This register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
95
96For information about available fields see [calfir1](index.html) module*/
97pub struct CALFIR1_SPEC;
98impl crate::RegisterSpec for CALFIR1_SPEC {
99    type Ux = u32;
100}
101///`read()` method returns [calfir1::R](R) reader structure
102impl crate::Readable for CALFIR1_SPEC {
103    type Reader = R;
104}
105///`write(|w| ..)` method takes [calfir1::W](W) writer structure
106impl crate::Writable for CALFIR1_SPEC {
107    type Writer = W;
108    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
109    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
110}
111///`reset()` method sets CALFIR1 to value 0
112impl crate::Resettable for CALFIR1_SPEC {
113    const RESET_VALUE: Self::Ux = 0;
114}