atsamd21j/sercom0/spi/
addr.rs

1#[doc = "Register `ADDR` reader"]
2pub type R = crate::R<AddrSpec>;
3#[doc = "Register `ADDR` writer"]
4pub type W = crate::W<AddrSpec>;
5#[doc = "Field `ADDR` reader - Address Value"]
6pub type AddrR = crate::FieldReader;
7#[doc = "Field `ADDR` writer - Address Value"]
8pub type AddrW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `ADDRMASK` reader - Address Mask"]
10pub type AddrmaskR = crate::FieldReader;
11#[doc = "Field `ADDRMASK` writer - Address Mask"]
12pub type AddrmaskW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13impl R {
14    #[doc = "Bits 0:7 - Address Value"]
15    #[inline(always)]
16    pub fn addr(&self) -> AddrR {
17        AddrR::new((self.bits & 0xff) as u8)
18    }
19    #[doc = "Bits 16:23 - Address Mask"]
20    #[inline(always)]
21    pub fn addrmask(&self) -> AddrmaskR {
22        AddrmaskR::new(((self.bits >> 16) & 0xff) as u8)
23    }
24}
25impl W {
26    #[doc = "Bits 0:7 - Address Value"]
27    #[inline(always)]
28    #[must_use]
29    pub fn addr(&mut self) -> AddrW<AddrSpec> {
30        AddrW::new(self, 0)
31    }
32    #[doc = "Bits 16:23 - Address Mask"]
33    #[inline(always)]
34    #[must_use]
35    pub fn addrmask(&mut self) -> AddrmaskW<AddrSpec> {
36        AddrmaskW::new(self, 16)
37    }
38}
39#[doc = "SPI Address\n\nYou can [`read`](crate::Reg::read) this register and get [`addr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`addr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct AddrSpec;
41impl crate::RegisterSpec for AddrSpec {
42    type Ux = u32;
43}
44#[doc = "`read()` method returns [`addr::R`](R) reader structure"]
45impl crate::Readable for AddrSpec {}
46#[doc = "`write(|w| ..)` method takes [`addr::W`](W) writer structure"]
47impl crate::Writable for AddrSpec {
48    type Safety = crate::Unsafe;
49    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
50    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
51}
52#[doc = "`reset()` method sets ADDR to value 0"]
53impl crate::Resettable for AddrSpec {
54    const RESET_VALUE: u32 = 0;
55}