bl616_pac/i2c/
period_data.rs1#[doc = "Register `period_data` reader"]
2pub struct R(crate::R<PERIOD_DATA_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PERIOD_DATA_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PERIOD_DATA_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PERIOD_DATA_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `period_data` writer"]
17pub struct W(crate::W<PERIOD_DATA_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<PERIOD_DATA_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<PERIOD_DATA_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<PERIOD_DATA_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `phase[0-3]` reader - Length of data condition phase %s"]
38pub type PHASE_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `phase[0-3]` writer - Length of data condition phase %s"]
40pub type PHASE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PERIOD_DATA_SPEC, u8, u8, 8, O>;
41impl R {
42 #[doc = "Length of data condition phase [0-3]"]
43 #[inline(always)]
44 pub unsafe fn phase(&self, n: u8) -> PHASE_R {
45 PHASE_R::new(((self.bits >> (n * 8)) & 0xff) as u8)
46 }
47 #[doc = "Bits 0:7 - Length of data condition phase 0"]
48 #[inline(always)]
49 pub fn phase0(&self) -> PHASE_R {
50 PHASE_R::new((self.bits & 0xff) as u8)
51 }
52 #[doc = "Bits 8:15 - Length of data condition phase 1"]
53 #[inline(always)]
54 pub fn phase1(&self) -> PHASE_R {
55 PHASE_R::new(((self.bits >> 8) & 0xff) as u8)
56 }
57 #[doc = "Bits 16:23 - Length of data condition phase 2"]
58 #[inline(always)]
59 pub fn phase2(&self) -> PHASE_R {
60 PHASE_R::new(((self.bits >> 16) & 0xff) as u8)
61 }
62 #[doc = "Bits 24:31 - Length of data condition phase 3"]
63 #[inline(always)]
64 pub fn phase3(&self) -> PHASE_R {
65 PHASE_R::new(((self.bits >> 24) & 0xff) as u8)
66 }
67}
68impl W {
69 #[doc = "Length of data condition phase [0-3]"]
70 #[inline(always)]
71 #[must_use]
72 pub unsafe fn phase<const O: u8>(&mut self) -> PHASE_W<O> {
73 PHASE_W::new(self)
74 }
75 #[doc = "Bits 0:7 - Length of data condition phase 0"]
76 #[inline(always)]
77 #[must_use]
78 pub fn phase0(&mut self) -> PHASE_W<0> {
79 PHASE_W::new(self)
80 }
81 #[doc = "Bits 8:15 - Length of data condition phase 1"]
82 #[inline(always)]
83 #[must_use]
84 pub fn phase1(&mut self) -> PHASE_W<8> {
85 PHASE_W::new(self)
86 }
87 #[doc = "Bits 16:23 - Length of data condition phase 2"]
88 #[inline(always)]
89 #[must_use]
90 pub fn phase2(&mut self) -> PHASE_W<16> {
91 PHASE_W::new(self)
92 }
93 #[doc = "Bits 24:31 - Length of data condition phase 3"]
94 #[inline(always)]
95 #[must_use]
96 pub fn phase3(&mut self) -> PHASE_W<24> {
97 PHASE_W::new(self)
98 }
99 #[doc = "Writes raw bits to the register."]
100 #[inline(always)]
101 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
102 self.0.bits(bits);
103 self
104 }
105}
106#[doc = "Duration of data phase\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [period_data](index.html) module"]
107pub struct PERIOD_DATA_SPEC;
108impl crate::RegisterSpec for PERIOD_DATA_SPEC {
109 type Ux = u32;
110}
111#[doc = "`read()` method returns [period_data::R](R) reader structure"]
112impl crate::Readable for PERIOD_DATA_SPEC {
113 type Reader = R;
114}
115#[doc = "`write(|w| ..)` method takes [period_data::W](W) writer structure"]
116impl crate::Writable for PERIOD_DATA_SPEC {
117 type Writer = W;
118 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
119 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
120}
121#[doc = "`reset()` method sets period_data to value 0x0f0f_0f0f"]
122impl crate::Resettable for PERIOD_DATA_SPEC {
123 const RESET_VALUE: Self::Ux = 0x0f0f_0f0f;
124}