atsamd11d/rtc/mode2/
readreq.rs

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