Skip to main content

atsamd11c14a/rtc/mode0/
readreq.rs

1#[doc = "Reader of register READREQ"]
2pub type R = crate::R<u16, super::READREQ>;
3#[doc = "Writer for register READREQ"]
4pub type W = crate::W<u16, super::READREQ>;
5#[doc = "Register READREQ `reset()`'s with value 0x10"]
6impl crate::ResetValue for super::READREQ {
7    type Type = u16;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0x10
11    }
12}
13#[doc = "Reader of field `ADDR`"]
14pub type ADDR_R = crate::R<u8, u8>;
15#[doc = "Reader of field `RCONT`"]
16pub type RCONT_R = crate::R<bool, bool>;
17#[doc = "Write proxy for field `RCONT`"]
18pub struct RCONT_W<'a> {
19    w: &'a mut W,
20}
21impl<'a> RCONT_W<'a> {
22    #[doc = r"Sets the field bit"]
23    #[inline(always)]
24    pub fn set_bit(self) -> &'a mut W {
25        self.bit(true)
26    }
27    #[doc = r"Clears the field bit"]
28    #[inline(always)]
29    pub fn clear_bit(self) -> &'a mut W {
30        self.bit(false)
31    }
32    #[doc = r"Writes raw bits to the field"]
33    #[inline(always)]
34    pub fn bit(self, value: bool) -> &'a mut W {
35        self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u16) & 0x01) << 14);
36        self.w
37    }
38}
39#[doc = "Write proxy for field `RREQ`"]
40pub struct RREQ_W<'a> {
41    w: &'a mut W,
42}
43impl<'a> RREQ_W<'a> {
44    #[doc = r"Sets the field bit"]
45    #[inline(always)]
46    pub fn set_bit(self) -> &'a mut W {
47        self.bit(true)
48    }
49    #[doc = r"Clears the field bit"]
50    #[inline(always)]
51    pub fn clear_bit(self) -> &'a mut W {
52        self.bit(false)
53    }
54    #[doc = r"Writes raw bits to the field"]
55    #[inline(always)]
56    pub fn bit(self, value: bool) -> &'a mut W {
57        self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u16) & 0x01) << 15);
58        self.w
59    }
60}
61impl R {
62    #[doc = "Bits 0:5 - Address"]
63    #[inline(always)]
64    pub fn addr(&self) -> ADDR_R {
65        ADDR_R::new((self.bits & 0x3f) as u8)
66    }
67    #[doc = "Bit 14 - Read Continuously"]
68    #[inline(always)]
69    pub fn rcont(&self) -> RCONT_R {
70        RCONT_R::new(((self.bits >> 14) & 0x01) != 0)
71    }
72}
73impl W {
74    #[doc = "Bit 14 - Read Continuously"]
75    #[inline(always)]
76    pub fn rcont(&mut self) -> RCONT_W {
77        RCONT_W { w: self }
78    }
79    #[doc = "Bit 15 - Read Request"]
80    #[inline(always)]
81    pub fn rreq(&mut self) -> RREQ_W {
82        RREQ_W { w: self }
83    }
84}