atsamd51g/dsu/
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 `AMOD` reader - Access Mode"]
6pub type AmodR = crate::FieldReader;
7#[doc = "Field `AMOD` writer - Access Mode"]
8pub type AmodW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `ADDR` reader - Address"]
10pub type AddrR = crate::FieldReader<u32>;
11#[doc = "Field `ADDR` writer - Address"]
12pub type AddrW<'a, REG> = crate::FieldWriter<'a, REG, 30, u32>;
13impl R {
14    #[doc = "Bits 0:1 - Access Mode"]
15    #[inline(always)]
16    pub fn amod(&self) -> AmodR {
17        AmodR::new((self.bits & 3) as u8)
18    }
19    #[doc = "Bits 2:31 - Address"]
20    #[inline(always)]
21    pub fn addr(&self) -> AddrR {
22        AddrR::new((self.bits >> 2) & 0x3fff_ffff)
23    }
24}
25impl W {
26    #[doc = "Bits 0:1 - Access Mode"]
27    #[inline(always)]
28    #[must_use]
29    pub fn amod(&mut self) -> AmodW<AddrSpec> {
30        AmodW::new(self, 0)
31    }
32    #[doc = "Bits 2:31 - Address"]
33    #[inline(always)]
34    #[must_use]
35    pub fn addr(&mut self) -> AddrW<AddrSpec> {
36        AddrW::new(self, 2)
37    }
38}
39#[doc = "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}