1#[doc = "Register `NQTHCTL` reader"]
2pub struct R(crate::R<NQTHCTL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<NQTHCTL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<NQTHCTL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<NQTHCTL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `NQTHCTL` writer"]
17pub struct W(crate::W<NQTHCTL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<NQTHCTL_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<NQTHCTL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<NQTHCTL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `CMDQTH` reader - Normal Command Ready Queue Threshold"]
38pub type CMDQTH_R = crate::FieldReader<u8, CMDQTH_A>;
39#[doc = "Normal Command Ready Queue Threshold\n\nValue on reset: 1"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum CMDQTH_A {
43 #[doc = "0: Interrupt is issued when Command Queue is completely empty."]
44 _0X00 = 0,
45}
46impl From<CMDQTH_A> for u8 {
47 #[inline(always)]
48 fn from(variant: CMDQTH_A) -> Self {
49 variant as _
50 }
51}
52impl CMDQTH_R {
53 #[doc = "Get enumerated values variant"]
54 #[inline(always)]
55 pub fn variant(&self) -> Option<CMDQTH_A> {
56 match self.bits {
57 0 => Some(CMDQTH_A::_0X00),
58 _ => None,
59 }
60 }
61 #[doc = "Checks if the value of the field is `_0X00`"]
62 #[inline(always)]
63 pub fn is_0x00(&self) -> bool {
64 *self == CMDQTH_A::_0X00
65 }
66}
67#[doc = "Field `CMDQTH` writer - Normal Command Ready Queue Threshold"]
68pub type CMDQTH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NQTHCTL_SPEC, u8, CMDQTH_A, 8, O>;
69impl<'a, const O: u8> CMDQTH_W<'a, O> {
70 #[doc = "Interrupt is issued when Command Queue is completely empty."]
71 #[inline(always)]
72 pub fn _0x00(self) -> &'a mut W {
73 self.variant(CMDQTH_A::_0X00)
74 }
75}
76#[doc = "Field `RSPQTH` reader - Normal Response Queue Threshold"]
77pub type RSPQTH_R = crate::FieldReader<u8, RSPQTH_A>;
78#[doc = "Normal Response Queue Threshold\n\nValue on reset: 1"]
79#[derive(Clone, Copy, Debug, PartialEq, Eq)]
80#[repr(u8)]
81pub enum RSPQTH_A {
82 #[doc = "0: Interrupt is issued when Response Queue contains 1 entry (DWORD)."]
83 _0X00 = 0,
84}
85impl From<RSPQTH_A> for u8 {
86 #[inline(always)]
87 fn from(variant: RSPQTH_A) -> Self {
88 variant as _
89 }
90}
91impl RSPQTH_R {
92 #[doc = "Get enumerated values variant"]
93 #[inline(always)]
94 pub fn variant(&self) -> Option<RSPQTH_A> {
95 match self.bits {
96 0 => Some(RSPQTH_A::_0X00),
97 _ => None,
98 }
99 }
100 #[doc = "Checks if the value of the field is `_0X00`"]
101 #[inline(always)]
102 pub fn is_0x00(&self) -> bool {
103 *self == RSPQTH_A::_0X00
104 }
105}
106#[doc = "Field `RSPQTH` writer - Normal Response Queue Threshold"]
107pub type RSPQTH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NQTHCTL_SPEC, u8, RSPQTH_A, 8, O>;
108impl<'a, const O: u8> RSPQTH_W<'a, O> {
109 #[doc = "Interrupt is issued when Response Queue contains 1 entry (DWORD)."]
110 #[inline(always)]
111 pub fn _0x00(self) -> &'a mut W {
112 self.variant(RSPQTH_A::_0X00)
113 }
114}
115#[doc = "Field `IBIDSSZ` reader - Normal IBI Data Segment Size"]
116pub type IBIDSSZ_R = crate::FieldReader<u8, u8>;
117#[doc = "Field `IBIDSSZ` writer - Normal IBI Data Segment Size"]
118pub type IBIDSSZ_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NQTHCTL_SPEC, u8, u8, 8, O>;
119#[doc = "Field `IBIQTH` reader - Normal IBI Queue Threshold"]
120pub type IBIQTH_R = crate::FieldReader<u8, IBIQTH_A>;
121#[doc = "Normal IBI Queue Threshold\n\nValue on reset: 1"]
122#[derive(Clone, Copy, Debug, PartialEq, Eq)]
123#[repr(u8)]
124pub enum IBIQTH_A {
125 #[doc = "0: I3C Protocol mode (Master): Interrupt is generated when the Outstanding IBI Status count is 1 or more. I3C Protocol mode (Slave): Interrupt is issued when IBI Data Buffer is completely empty."]
126 _0X00 = 0,
127}
128impl From<IBIQTH_A> for u8 {
129 #[inline(always)]
130 fn from(variant: IBIQTH_A) -> Self {
131 variant as _
132 }
133}
134impl IBIQTH_R {
135 #[doc = "Get enumerated values variant"]
136 #[inline(always)]
137 pub fn variant(&self) -> Option<IBIQTH_A> {
138 match self.bits {
139 0 => Some(IBIQTH_A::_0X00),
140 _ => None,
141 }
142 }
143 #[doc = "Checks if the value of the field is `_0X00`"]
144 #[inline(always)]
145 pub fn is_0x00(&self) -> bool {
146 *self == IBIQTH_A::_0X00
147 }
148}
149#[doc = "Field `IBIQTH` writer - Normal IBI Queue Threshold"]
150pub type IBIQTH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NQTHCTL_SPEC, u8, IBIQTH_A, 8, O>;
151impl<'a, const O: u8> IBIQTH_W<'a, O> {
152 #[doc = "I3C Protocol mode (Master): Interrupt is generated when the Outstanding IBI Status count is 1 or more. I3C Protocol mode (Slave): Interrupt is issued when IBI Data Buffer is completely empty."]
153 #[inline(always)]
154 pub fn _0x00(self) -> &'a mut W {
155 self.variant(IBIQTH_A::_0X00)
156 }
157}
158impl R {
159 #[doc = "Bits 0:7 - Normal Command Ready Queue Threshold"]
160 #[inline(always)]
161 pub fn cmdqth(&self) -> CMDQTH_R {
162 CMDQTH_R::new((self.bits & 0xff) as u8)
163 }
164 #[doc = "Bits 8:15 - Normal Response Queue Threshold"]
165 #[inline(always)]
166 pub fn rspqth(&self) -> RSPQTH_R {
167 RSPQTH_R::new(((self.bits >> 8) & 0xff) as u8)
168 }
169 #[doc = "Bits 16:23 - Normal IBI Data Segment Size"]
170 #[inline(always)]
171 pub fn ibidssz(&self) -> IBIDSSZ_R {
172 IBIDSSZ_R::new(((self.bits >> 16) & 0xff) as u8)
173 }
174 #[doc = "Bits 24:31 - Normal IBI Queue Threshold"]
175 #[inline(always)]
176 pub fn ibiqth(&self) -> IBIQTH_R {
177 IBIQTH_R::new(((self.bits >> 24) & 0xff) as u8)
178 }
179}
180impl W {
181 #[doc = "Bits 0:7 - Normal Command Ready Queue Threshold"]
182 #[inline(always)]
183 #[must_use]
184 pub fn cmdqth(&mut self) -> CMDQTH_W<0> {
185 CMDQTH_W::new(self)
186 }
187 #[doc = "Bits 8:15 - Normal Response Queue Threshold"]
188 #[inline(always)]
189 #[must_use]
190 pub fn rspqth(&mut self) -> RSPQTH_W<8> {
191 RSPQTH_W::new(self)
192 }
193 #[doc = "Bits 16:23 - Normal IBI Data Segment Size"]
194 #[inline(always)]
195 #[must_use]
196 pub fn ibidssz(&mut self) -> IBIDSSZ_W<16> {
197 IBIDSSZ_W::new(self)
198 }
199 #[doc = "Bits 24:31 - Normal IBI Queue Threshold"]
200 #[inline(always)]
201 #[must_use]
202 pub fn ibiqth(&mut self) -> IBIQTH_W<24> {
203 IBIQTH_W::new(self)
204 }
205 #[doc = "Writes raw bits to the register."]
206 #[inline(always)]
207 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
208 self.0.bits(bits);
209 self
210 }
211}
212#[doc = "Normal Queue Threshold Control Register\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 [nqthctl](index.html) module"]
213pub struct NQTHCTL_SPEC;
214impl crate::RegisterSpec for NQTHCTL_SPEC {
215 type Ux = u32;
216}
217#[doc = "`read()` method returns [nqthctl::R](R) reader structure"]
218impl crate::Readable for NQTHCTL_SPEC {
219 type Reader = R;
220}
221#[doc = "`write(|w| ..)` method takes [nqthctl::W](W) writer structure"]
222impl crate::Writable for NQTHCTL_SPEC {
223 type Writer = W;
224 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
225 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
226}
227#[doc = "`reset()` method sets NQTHCTL to value 0x0101_0101"]
228impl crate::Resettable for NQTHCTL_SPEC {
229 const RESET_VALUE: Self::Ux = 0x0101_0101;
230}