esp32c2/spi0/
timing_cali.rs

1#[doc = "Register `TIMING_CALI` reader"]
2pub type R = crate::R<TIMING_CALI_SPEC>;
3#[doc = "Field `TIMING_CLK_ENA` reader - The bit is used to enable timing adjust clock for all reading operations."]
4pub type TIMING_CLK_ENA_R = crate::BitReader;
5#[doc = "Field `TIMING_CALI` reader - The bit is used to enable timing auto-calibration for all reading operations."]
6pub type TIMING_CALI_R = crate::BitReader;
7#[doc = "Field `EXTRA_DUMMY_CYCLELEN` reader - add extra dummy spi clock cycle length for spi clock calibration."]
8pub type EXTRA_DUMMY_CYCLELEN_R = crate::FieldReader;
9impl R {
10    #[doc = "Bit 0 - The bit is used to enable timing adjust clock for all reading operations."]
11    #[inline(always)]
12    pub fn timing_clk_ena(&self) -> TIMING_CLK_ENA_R {
13        TIMING_CLK_ENA_R::new((self.bits & 1) != 0)
14    }
15    #[doc = "Bit 1 - The bit is used to enable timing auto-calibration for all reading operations."]
16    #[inline(always)]
17    pub fn timing_cali(&self) -> TIMING_CALI_R {
18        TIMING_CALI_R::new(((self.bits >> 1) & 1) != 0)
19    }
20    #[doc = "Bits 2:4 - add extra dummy spi clock cycle length for spi clock calibration."]
21    #[inline(always)]
22    pub fn extra_dummy_cyclelen(&self) -> EXTRA_DUMMY_CYCLELEN_R {
23        EXTRA_DUMMY_CYCLELEN_R::new(((self.bits >> 2) & 7) as u8)
24    }
25}
26#[cfg(feature = "impl-register-debug")]
27impl core::fmt::Debug for R {
28    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
29        f.debug_struct("TIMING_CALI")
30            .field("timing_clk_ena", &self.timing_clk_ena())
31            .field("timing_cali", &self.timing_cali())
32            .field("extra_dummy_cyclelen", &self.extra_dummy_cyclelen())
33            .finish()
34    }
35}
36#[doc = "SPI0 timing calibration register\n\nYou can [`read`](crate::Reg::read) this register and get [`timing_cali::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
37pub struct TIMING_CALI_SPEC;
38impl crate::RegisterSpec for TIMING_CALI_SPEC {
39    type Ux = u32;
40}
41#[doc = "`read()` method returns [`timing_cali::R`](R) reader structure"]
42impl crate::Readable for TIMING_CALI_SPEC {}
43#[doc = "`reset()` method sets TIMING_CALI to value 0"]
44impl crate::Resettable for TIMING_CALI_SPEC {
45    const RESET_VALUE: u32 = 0;
46}