d1_pac/spi0/
spi_samp_dl.rs

1#[doc = "Register `spi_samp_dl` reader"]
2pub type R = crate::R<SPI_SAMP_DL_SPEC>;
3#[doc = "Register `spi_samp_dl` writer"]
4pub type W = crate::W<SPI_SAMP_DL_SPEC>;
5#[doc = "Field `samp_dl_sw` reader - Sample Delay Software"]
6pub type SAMP_DL_SW_R = crate::FieldReader;
7#[doc = "Field `samp_dl_sw` writer - Sample Delay Software"]
8pub type SAMP_DL_SW_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
9#[doc = "Field `samp_dl_sw_en` reader - Sample Delay Software Enable"]
10pub type SAMP_DL_SW_EN_R = crate::BitReader;
11#[doc = "Field `samp_dl_sw_en` writer - Sample Delay Software Enable"]
12pub type SAMP_DL_SW_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `samp_dl` reader - Sample Delay"]
14pub type SAMP_DL_R = crate::FieldReader;
15#[doc = "Field `samp_dl_cal_done` reader - Sample Delay Calibration Dont"]
16pub type SAMP_DL_CAL_DONE_R = crate::BitReader;
17#[doc = "Field `samp_dl_cal_start` reader - Sample Delay Calibration Start"]
18pub type SAMP_DL_CAL_START_R = crate::BitReader;
19#[doc = "Field `samp_dl_cal_start` writer - Sample Delay Calibration Start"]
20pub type SAMP_DL_CAL_START_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bits 0:5 - Sample Delay Software"]
23    #[inline(always)]
24    pub fn samp_dl_sw(&self) -> SAMP_DL_SW_R {
25        SAMP_DL_SW_R::new((self.bits & 0x3f) as u8)
26    }
27    #[doc = "Bit 7 - Sample Delay Software Enable"]
28    #[inline(always)]
29    pub fn samp_dl_sw_en(&self) -> SAMP_DL_SW_EN_R {
30        SAMP_DL_SW_EN_R::new(((self.bits >> 7) & 1) != 0)
31    }
32    #[doc = "Bits 8:13 - Sample Delay"]
33    #[inline(always)]
34    pub fn samp_dl(&self) -> SAMP_DL_R {
35        SAMP_DL_R::new(((self.bits >> 8) & 0x3f) as u8)
36    }
37    #[doc = "Bit 14 - Sample Delay Calibration Dont"]
38    #[inline(always)]
39    pub fn samp_dl_cal_done(&self) -> SAMP_DL_CAL_DONE_R {
40        SAMP_DL_CAL_DONE_R::new(((self.bits >> 14) & 1) != 0)
41    }
42    #[doc = "Bit 15 - Sample Delay Calibration Start"]
43    #[inline(always)]
44    pub fn samp_dl_cal_start(&self) -> SAMP_DL_CAL_START_R {
45        SAMP_DL_CAL_START_R::new(((self.bits >> 15) & 1) != 0)
46    }
47}
48impl W {
49    #[doc = "Bits 0:5 - Sample Delay Software"]
50    #[inline(always)]
51    #[must_use]
52    pub fn samp_dl_sw(&mut self) -> SAMP_DL_SW_W<SPI_SAMP_DL_SPEC> {
53        SAMP_DL_SW_W::new(self, 0)
54    }
55    #[doc = "Bit 7 - Sample Delay Software Enable"]
56    #[inline(always)]
57    #[must_use]
58    pub fn samp_dl_sw_en(&mut self) -> SAMP_DL_SW_EN_W<SPI_SAMP_DL_SPEC> {
59        SAMP_DL_SW_EN_W::new(self, 7)
60    }
61    #[doc = "Bit 15 - Sample Delay Calibration Start"]
62    #[inline(always)]
63    #[must_use]
64    pub fn samp_dl_cal_start(&mut self) -> SAMP_DL_CAL_START_W<SPI_SAMP_DL_SPEC> {
65        SAMP_DL_CAL_START_W::new(self, 15)
66    }
67    #[doc = r" Writes raw bits to the register."]
68    #[doc = r""]
69    #[doc = r" # Safety"]
70    #[doc = r""]
71    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
72    #[inline(always)]
73    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
74        self.bits = bits;
75        self
76    }
77}
78#[doc = "SPI Sample Delay Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`spi_samp_dl::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 [`spi_samp_dl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
79pub struct SPI_SAMP_DL_SPEC;
80impl crate::RegisterSpec for SPI_SAMP_DL_SPEC {
81    type Ux = u32;
82}
83#[doc = "`read()` method returns [`spi_samp_dl::R`](R) reader structure"]
84impl crate::Readable for SPI_SAMP_DL_SPEC {}
85#[doc = "`write(|w| ..)` method takes [`spi_samp_dl::W`](W) writer structure"]
86impl crate::Writable for SPI_SAMP_DL_SPEC {
87    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
88    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
89}
90#[doc = "`reset()` method sets spi_samp_dl to value 0"]
91impl crate::Resettable for SPI_SAMP_DL_SPEC {
92    const RESET_VALUE: Self::Ux = 0;
93}