moondancer_pac/generated/spi0/
phy.rs

1#[doc = "Register `phy` reader"]
2pub type R = crate::R<PHY_SPEC>;
3#[doc = "Register `phy` writer"]
4pub type W = crate::W<PHY_SPEC>;
5#[doc = "Field `length` reader - length field"]
6pub type LENGTH_R = crate::FieldReader;
7#[doc = "Field `length` writer - length field"]
8pub type LENGTH_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
9#[doc = "Field `width` reader - width field"]
10pub type WIDTH_R = crate::FieldReader;
11#[doc = "Field `width` writer - width field"]
12pub type WIDTH_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `mask` reader - mask field"]
14pub type MASK_R = crate::FieldReader;
15#[doc = "Field `mask` writer - mask field"]
16pub type MASK_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17impl R {
18    #[doc = "Bits 0:5 - length field"]
19    #[inline(always)]
20    pub fn length(&self) -> LENGTH_R {
21        LENGTH_R::new((self.bits & 0x3f) as u8)
22    }
23    #[doc = "Bits 6:9 - width field"]
24    #[inline(always)]
25    pub fn width(&self) -> WIDTH_R {
26        WIDTH_R::new(((self.bits >> 6) & 0x0f) as u8)
27    }
28    #[doc = "Bits 10:17 - mask field"]
29    #[inline(always)]
30    pub fn mask(&self) -> MASK_R {
31        MASK_R::new(((self.bits >> 10) & 0xff) as u8)
32    }
33}
34impl W {
35    #[doc = "Bits 0:5 - length field"]
36    #[inline(always)]
37    pub fn length(&mut self) -> LENGTH_W<PHY_SPEC> {
38        LENGTH_W::new(self, 0)
39    }
40    #[doc = "Bits 6:9 - width field"]
41    #[inline(always)]
42    pub fn width(&mut self) -> WIDTH_W<PHY_SPEC> {
43        WIDTH_W::new(self, 6)
44    }
45    #[doc = "Bits 10:17 - mask field"]
46    #[inline(always)]
47    pub fn mask(&mut self) -> MASK_W<PHY_SPEC> {
48        MASK_W::new(self, 10)
49    }
50}
51#[doc = "PHY control register length : SPI transfer length in bits. width : SPI transfer bus width (1/2/4/8). mask : SPI DQ output enable mask.\n\nYou can [`read`](crate::Reg::read) this register and get [`phy::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`phy::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
52pub struct PHY_SPEC;
53impl crate::RegisterSpec for PHY_SPEC {
54    type Ux = u32;
55}
56#[doc = "`read()` method returns [`phy::R`](R) reader structure"]
57impl crate::Readable for PHY_SPEC {}
58#[doc = "`write(|w| ..)` method takes [`phy::W`](W) writer structure"]
59impl crate::Writable for PHY_SPEC {
60    type Safety = crate::Unsafe;
61    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
62    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
63}
64#[doc = "`reset()` method sets phy to value 0"]
65impl crate::Resettable for PHY_SPEC {
66    const RESET_VALUE: u32 = 0;
67}