atsamd51g/sercom0/i2cs/
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 `GENCEN` reader - General Call Address Enable"]
6pub type GencenR = crate::BitReader;
7#[doc = "Field `GENCEN` writer - General Call Address Enable"]
8pub type GencenW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `ADDR` reader - Address Value"]
10pub type AddrR = crate::FieldReader<u16>;
11#[doc = "Field `ADDR` writer - Address Value"]
12pub type AddrW<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
13#[doc = "Field `TENBITEN` reader - Ten Bit Addressing Enable"]
14pub type TenbitenR = crate::BitReader;
15#[doc = "Field `TENBITEN` writer - Ten Bit Addressing Enable"]
16pub type TenbitenW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `ADDRMASK` reader - Address Mask"]
18pub type AddrmaskR = crate::FieldReader<u16>;
19#[doc = "Field `ADDRMASK` writer - Address Mask"]
20pub type AddrmaskW<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
21impl R {
22 #[doc = "Bit 0 - General Call Address Enable"]
23 #[inline(always)]
24 pub fn gencen(&self) -> GencenR {
25 GencenR::new((self.bits & 1) != 0)
26 }
27 #[doc = "Bits 1:10 - Address Value"]
28 #[inline(always)]
29 pub fn addr(&self) -> AddrR {
30 AddrR::new(((self.bits >> 1) & 0x03ff) as u16)
31 }
32 #[doc = "Bit 15 - Ten Bit Addressing Enable"]
33 #[inline(always)]
34 pub fn tenbiten(&self) -> TenbitenR {
35 TenbitenR::new(((self.bits >> 15) & 1) != 0)
36 }
37 #[doc = "Bits 17:26 - Address Mask"]
38 #[inline(always)]
39 pub fn addrmask(&self) -> AddrmaskR {
40 AddrmaskR::new(((self.bits >> 17) & 0x03ff) as u16)
41 }
42}
43impl W {
44 #[doc = "Bit 0 - General Call Address Enable"]
45 #[inline(always)]
46 #[must_use]
47 pub fn gencen(&mut self) -> GencenW<AddrSpec> {
48 GencenW::new(self, 0)
49 }
50 #[doc = "Bits 1:10 - Address Value"]
51 #[inline(always)]
52 #[must_use]
53 pub fn addr(&mut self) -> AddrW<AddrSpec> {
54 AddrW::new(self, 1)
55 }
56 #[doc = "Bit 15 - Ten Bit Addressing Enable"]
57 #[inline(always)]
58 #[must_use]
59 pub fn tenbiten(&mut self) -> TenbitenW<AddrSpec> {
60 TenbitenW::new(self, 15)
61 }
62 #[doc = "Bits 17:26 - Address Mask"]
63 #[inline(always)]
64 #[must_use]
65 pub fn addrmask(&mut self) -> AddrmaskW<AddrSpec> {
66 AddrmaskW::new(self, 17)
67 }
68}
69#[doc = "I2CS 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)."]
70pub struct AddrSpec;
71impl crate::RegisterSpec for AddrSpec {
72 type Ux = u32;
73}
74#[doc = "`read()` method returns [`addr::R`](R) reader structure"]
75impl crate::Readable for AddrSpec {}
76#[doc = "`write(|w| ..)` method takes [`addr::W`](W) writer structure"]
77impl crate::Writable for AddrSpec {
78 type Safety = crate::Unsafe;
79 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
80 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
81}
82#[doc = "`reset()` method sets ADDR to value 0"]
83impl crate::Resettable for AddrSpec {
84 const RESET_VALUE: u32 = 0;
85}