mimxrt685s_pac/i3c/
scapabilities.rs

1#[doc = "Register `SCAPABILITIES` reader"]
2pub type R = crate::R<ScapabilitiesSpec>;
3#[doc = "ID 48b handler\n\nValue on reset: 0"]
4#[cfg_attr(feature = "defmt", derive(defmt::Format))]
5#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6#[repr(u8)]
7pub enum Idena {
8    #[doc = "0: APPLICATION: Application handles ID 48b"]
9    Application = 0,
10    #[doc = "1: HW: Hardware handles ID 48b"]
11    Hw = 1,
12    #[doc = "2: HW_BUT: in hardware but the I3C module instance handles ID 48b."]
13    HwBut = 2,
14    #[doc = "3: PARTNO: a part number register (PARTNO) handles ID 48b"]
15    Partno = 3,
16}
17impl From<Idena> for u8 {
18    #[inline(always)]
19    fn from(variant: Idena) -> Self {
20        variant as _
21    }
22}
23impl crate::FieldSpec for Idena {
24    type Ux = u8;
25}
26impl crate::IsEnum for Idena {}
27#[doc = "Field `IDENA` reader - ID 48b handler"]
28pub type IdenaR = crate::FieldReader<Idena>;
29impl IdenaR {
30    #[doc = "Get enumerated values variant"]
31    #[inline(always)]
32    pub const fn variant(&self) -> Idena {
33        match self.bits {
34            0 => Idena::Application,
35            1 => Idena::Hw,
36            2 => Idena::HwBut,
37            3 => Idena::Partno,
38            _ => unreachable!(),
39        }
40    }
41    #[doc = "APPLICATION: Application handles ID 48b"]
42    #[inline(always)]
43    pub fn is_application(&self) -> bool {
44        *self == Idena::Application
45    }
46    #[doc = "HW: Hardware handles ID 48b"]
47    #[inline(always)]
48    pub fn is_hw(&self) -> bool {
49        *self == Idena::Hw
50    }
51    #[doc = "HW_BUT: in hardware but the I3C module instance handles ID 48b."]
52    #[inline(always)]
53    pub fn is_hw_but(&self) -> bool {
54        *self == Idena::HwBut
55    }
56    #[doc = "PARTNO: a part number register (PARTNO) handles ID 48b"]
57    #[inline(always)]
58    pub fn is_partno(&self) -> bool {
59        *self == Idena::Partno
60    }
61}
62#[doc = "Field `IDREG` reader - ID register"]
63pub type IdregR = crate::FieldReader;
64#[doc = "Field `HDRSUPP` reader - HDR support"]
65pub type HdrsuppR = crate::FieldReader;
66#[doc = "Master\n\nValue on reset: 1"]
67#[cfg_attr(feature = "defmt", derive(defmt::Format))]
68#[derive(Clone, Copy, Debug, PartialEq, Eq)]
69pub enum Master {
70    #[doc = "0: MASTERNOTSUPPORTED: master capability is not supported."]
71    Masternotsupported = 0,
72    #[doc = "1: MASTERSUPPORTED: master capability is supported."]
73    Mastersupported = 1,
74}
75impl From<Master> for bool {
76    #[inline(always)]
77    fn from(variant: Master) -> Self {
78        variant as u8 != 0
79    }
80}
81#[doc = "Field `MASTER` reader - Master"]
82pub type MasterR = crate::BitReader<Master>;
83impl MasterR {
84    #[doc = "Get enumerated values variant"]
85    #[inline(always)]
86    pub const fn variant(&self) -> Master {
87        match self.bits {
88            false => Master::Masternotsupported,
89            true => Master::Mastersupported,
90        }
91    }
92    #[doc = "MASTERNOTSUPPORTED: master capability is not supported."]
93    #[inline(always)]
94    pub fn is_masternotsupported(&self) -> bool {
95        *self == Master::Masternotsupported
96    }
97    #[doc = "MASTERSUPPORTED: master capability is supported."]
98    #[inline(always)]
99    pub fn is_mastersupported(&self) -> bool {
100        *self == Master::Mastersupported
101    }
102}
103#[doc = "Static address\n\nValue on reset: 3"]
104#[cfg_attr(feature = "defmt", derive(defmt::Format))]
105#[derive(Clone, Copy, Debug, PartialEq, Eq)]
106#[repr(u8)]
107pub enum Saddr {
108    #[doc = "0: NO_STATIC: No static address"]
109    NoStatic = 0,
110    #[doc = "1: STATIC: Static address is fixed in hardware"]
111    Static = 1,
112    #[doc = "2: HW_CONTROL: Hardware controls the static address dynamically (for example, from the pin strap)"]
113    HwControl = 2,
114    #[doc = "3: CONFIG: SCONFIG register supplies the static address"]
115    Config = 3,
116}
117impl From<Saddr> for u8 {
118    #[inline(always)]
119    fn from(variant: Saddr) -> Self {
120        variant as _
121    }
122}
123impl crate::FieldSpec for Saddr {
124    type Ux = u8;
125}
126impl crate::IsEnum for Saddr {}
127#[doc = "Field `SADDR` reader - Static address"]
128pub type SaddrR = crate::FieldReader<Saddr>;
129impl SaddrR {
130    #[doc = "Get enumerated values variant"]
131    #[inline(always)]
132    pub const fn variant(&self) -> Saddr {
133        match self.bits {
134            0 => Saddr::NoStatic,
135            1 => Saddr::Static,
136            2 => Saddr::HwControl,
137            3 => Saddr::Config,
138            _ => unreachable!(),
139        }
140    }
141    #[doc = "NO_STATIC: No static address"]
142    #[inline(always)]
143    pub fn is_no_static(&self) -> bool {
144        *self == Saddr::NoStatic
145    }
146    #[doc = "STATIC: Static address is fixed in hardware"]
147    #[inline(always)]
148    pub fn is_static(&self) -> bool {
149        *self == Saddr::Static
150    }
151    #[doc = "HW_CONTROL: Hardware controls the static address dynamically (for example, from the pin strap)"]
152    #[inline(always)]
153    pub fn is_hw_control(&self) -> bool {
154        *self == Saddr::HwControl
155    }
156    #[doc = "CONFIG: SCONFIG register supplies the static address"]
157    #[inline(always)]
158    pub fn is_config(&self) -> bool {
159        *self == Saddr::Config
160    }
161}
162#[doc = "Field `CCCHANDLE` reader - Common Command Codes (CCC) handling"]
163pub type CcchandleR = crate::FieldReader;
164#[doc = "Field `IBI_MR_HJ` reader - In-Band Interrupts, Master Requests, Hot Join events"]
165pub type IbiMrHjR = crate::FieldReader;
166#[doc = "Time control\n\nValue on reset: 1"]
167#[cfg_attr(feature = "defmt", derive(defmt::Format))]
168#[derive(Clone, Copy, Debug, PartialEq, Eq)]
169pub enum Timectrl {
170    #[doc = "0: NO_TIME_CONTROL_TYPE: No time control is enabled"]
171    NoTimeControlType = 0,
172    #[doc = "1: ATLEAST1_TIME_CONTROL: at least one time-control type is supported"]
173    Atleast1TimeControl = 1,
174}
175impl From<Timectrl> for bool {
176    #[inline(always)]
177    fn from(variant: Timectrl) -> Self {
178        variant as u8 != 0
179    }
180}
181#[doc = "Field `TIMECTRL` reader - Time control"]
182pub type TimectrlR = crate::BitReader<Timectrl>;
183impl TimectrlR {
184    #[doc = "Get enumerated values variant"]
185    #[inline(always)]
186    pub const fn variant(&self) -> Timectrl {
187        match self.bits {
188            false => Timectrl::NoTimeControlType,
189            true => Timectrl::Atleast1TimeControl,
190        }
191    }
192    #[doc = "NO_TIME_CONTROL_TYPE: No time control is enabled"]
193    #[inline(always)]
194    pub fn is_no_time_control_type(&self) -> bool {
195        *self == Timectrl::NoTimeControlType
196    }
197    #[doc = "ATLEAST1_TIME_CONTROL: at least one time-control type is supported"]
198    #[inline(always)]
199    pub fn is_atleast1_time_control(&self) -> bool {
200        *self == Timectrl::Atleast1TimeControl
201    }
202}
203#[doc = "External FIFO\n\nValue on reset: 0"]
204#[cfg_attr(feature = "defmt", derive(defmt::Format))]
205#[derive(Clone, Copy, Debug, PartialEq, Eq)]
206#[repr(u8)]
207pub enum Extfifo {
208    #[doc = "1: STD_EXT_FIFO: standard available/free external FIFO"]
209    StdExtFifo = 1,
210}
211impl From<Extfifo> for u8 {
212    #[inline(always)]
213    fn from(variant: Extfifo) -> Self {
214        variant as _
215    }
216}
217impl crate::FieldSpec for Extfifo {
218    type Ux = u8;
219}
220impl crate::IsEnum for Extfifo {}
221#[doc = "Field `EXTFIFO` reader - External FIFO"]
222pub type ExtfifoR = crate::FieldReader<Extfifo>;
223impl ExtfifoR {
224    #[doc = "Get enumerated values variant"]
225    #[inline(always)]
226    pub const fn variant(&self) -> Option<Extfifo> {
227        match self.bits {
228            1 => Some(Extfifo::StdExtFifo),
229            _ => None,
230        }
231    }
232    #[doc = "STD_EXT_FIFO: standard available/free external FIFO"]
233    #[inline(always)]
234    pub fn is_std_ext_fifo(&self) -> bool {
235        *self == Extfifo::StdExtFifo
236    }
237}
238#[doc = "FIFO transmit\n\nValue on reset: 2"]
239#[cfg_attr(feature = "defmt", derive(defmt::Format))]
240#[derive(Clone, Copy, Debug, PartialEq, Eq)]
241#[repr(u8)]
242pub enum Fifotx {
243    #[doc = "0: FIFO_2BYTE: 2-byte TX FIFO, the default FIFO transmit value (FIFOTX)"]
244    Fifo2byte = 0,
245    #[doc = "1: FIFO_4BYTE: 4-byte TX FIFO"]
246    Fifo4byte = 1,
247    #[doc = "2: FIFO_8BYTE: 8-byte TX FIFO"]
248    Fifo8byte = 2,
249    #[doc = "3: FIFO_16BYTE: 16-byte TX FIFO"]
250    Fifo16byte = 3,
251}
252impl From<Fifotx> for u8 {
253    #[inline(always)]
254    fn from(variant: Fifotx) -> Self {
255        variant as _
256    }
257}
258impl crate::FieldSpec for Fifotx {
259    type Ux = u8;
260}
261impl crate::IsEnum for Fifotx {}
262#[doc = "Field `FIFOTX` reader - FIFO transmit"]
263pub type FifotxR = crate::FieldReader<Fifotx>;
264impl FifotxR {
265    #[doc = "Get enumerated values variant"]
266    #[inline(always)]
267    pub const fn variant(&self) -> Fifotx {
268        match self.bits {
269            0 => Fifotx::Fifo2byte,
270            1 => Fifotx::Fifo4byte,
271            2 => Fifotx::Fifo8byte,
272            3 => Fifotx::Fifo16byte,
273            _ => unreachable!(),
274        }
275    }
276    #[doc = "FIFO_2BYTE: 2-byte TX FIFO, the default FIFO transmit value (FIFOTX)"]
277    #[inline(always)]
278    pub fn is_fifo_2byte(&self) -> bool {
279        *self == Fifotx::Fifo2byte
280    }
281    #[doc = "FIFO_4BYTE: 4-byte TX FIFO"]
282    #[inline(always)]
283    pub fn is_fifo_4byte(&self) -> bool {
284        *self == Fifotx::Fifo4byte
285    }
286    #[doc = "FIFO_8BYTE: 8-byte TX FIFO"]
287    #[inline(always)]
288    pub fn is_fifo_8byte(&self) -> bool {
289        *self == Fifotx::Fifo8byte
290    }
291    #[doc = "FIFO_16BYTE: 16-byte TX FIFO"]
292    #[inline(always)]
293    pub fn is_fifo_16byte(&self) -> bool {
294        *self == Fifotx::Fifo16byte
295    }
296}
297#[doc = "FIFO receive\n\nValue on reset: 2"]
298#[cfg_attr(feature = "defmt", derive(defmt::Format))]
299#[derive(Clone, Copy, Debug, PartialEq, Eq)]
300#[repr(u8)]
301pub enum Fiforx {
302    #[doc = "0: FIFO_2BYTE: 2 (or 3)-byte RX FIFO, the default FIFO receive value (FIFORX)"]
303    Fifo2byte = 0,
304    #[doc = "1: FIFO_4BYTE: 4-byte RX FIFO"]
305    Fifo4byte = 1,
306    #[doc = "2: FIFO_8BYTE: 8-byte RX FIFO"]
307    Fifo8byte = 2,
308    #[doc = "3: FIFO_16BYTE: 16-byte RX FIFO"]
309    Fifo16byte = 3,
310}
311impl From<Fiforx> for u8 {
312    #[inline(always)]
313    fn from(variant: Fiforx) -> Self {
314        variant as _
315    }
316}
317impl crate::FieldSpec for Fiforx {
318    type Ux = u8;
319}
320impl crate::IsEnum for Fiforx {}
321#[doc = "Field `FIFORX` reader - FIFO receive"]
322pub type FiforxR = crate::FieldReader<Fiforx>;
323impl FiforxR {
324    #[doc = "Get enumerated values variant"]
325    #[inline(always)]
326    pub const fn variant(&self) -> Fiforx {
327        match self.bits {
328            0 => Fiforx::Fifo2byte,
329            1 => Fiforx::Fifo4byte,
330            2 => Fiforx::Fifo8byte,
331            3 => Fiforx::Fifo16byte,
332            _ => unreachable!(),
333        }
334    }
335    #[doc = "FIFO_2BYTE: 2 (or 3)-byte RX FIFO, the default FIFO receive value (FIFORX)"]
336    #[inline(always)]
337    pub fn is_fifo_2byte(&self) -> bool {
338        *self == Fiforx::Fifo2byte
339    }
340    #[doc = "FIFO_4BYTE: 4-byte RX FIFO"]
341    #[inline(always)]
342    pub fn is_fifo_4byte(&self) -> bool {
343        *self == Fiforx::Fifo4byte
344    }
345    #[doc = "FIFO_8BYTE: 8-byte RX FIFO"]
346    #[inline(always)]
347    pub fn is_fifo_8byte(&self) -> bool {
348        *self == Fiforx::Fifo8byte
349    }
350    #[doc = "FIFO_16BYTE: 16-byte RX FIFO"]
351    #[inline(always)]
352    pub fn is_fifo_16byte(&self) -> bool {
353        *self == Fiforx::Fifo16byte
354    }
355}
356#[doc = "INT\n\nValue on reset: 1"]
357#[cfg_attr(feature = "defmt", derive(defmt::Format))]
358#[derive(Clone, Copy, Debug, PartialEq, Eq)]
359pub enum Int {
360    #[doc = "0: Interrupts are not supported"]
361    Interruptsno = 0,
362    #[doc = "1: Interrupts are supported"]
363    Interruptsyes = 1,
364}
365impl From<Int> for bool {
366    #[inline(always)]
367    fn from(variant: Int) -> Self {
368        variant as u8 != 0
369    }
370}
371#[doc = "Field `INT` reader - INT"]
372pub type IntR = crate::BitReader<Int>;
373impl IntR {
374    #[doc = "Get enumerated values variant"]
375    #[inline(always)]
376    pub const fn variant(&self) -> Int {
377        match self.bits {
378            false => Int::Interruptsno,
379            true => Int::Interruptsyes,
380        }
381    }
382    #[doc = "Interrupts are not supported"]
383    #[inline(always)]
384    pub fn is_interruptsno(&self) -> bool {
385        *self == Int::Interruptsno
386    }
387    #[doc = "Interrupts are supported"]
388    #[inline(always)]
389    pub fn is_interruptsyes(&self) -> bool {
390        *self == Int::Interruptsyes
391    }
392}
393#[doc = "DMA\n\nValue on reset: 1"]
394#[cfg_attr(feature = "defmt", derive(defmt::Format))]
395#[derive(Clone, Copy, Debug, PartialEq, Eq)]
396pub enum Dma {
397    #[doc = "0: DMA is not supported"]
398    Dmano = 0,
399    #[doc = "1: DMA is supported"]
400    Dmayes = 1,
401}
402impl From<Dma> for bool {
403    #[inline(always)]
404    fn from(variant: Dma) -> Self {
405        variant as u8 != 0
406    }
407}
408#[doc = "Field `DMA` reader - DMA"]
409pub type DmaR = crate::BitReader<Dma>;
410impl DmaR {
411    #[doc = "Get enumerated values variant"]
412    #[inline(always)]
413    pub const fn variant(&self) -> Dma {
414        match self.bits {
415            false => Dma::Dmano,
416            true => Dma::Dmayes,
417        }
418    }
419    #[doc = "DMA is not supported"]
420    #[inline(always)]
421    pub fn is_dmano(&self) -> bool {
422        *self == Dma::Dmano
423    }
424    #[doc = "DMA is supported"]
425    #[inline(always)]
426    pub fn is_dmayes(&self) -> bool {
427        *self == Dma::Dmayes
428    }
429}
430impl R {
431    #[doc = "Bits 0:1 - ID 48b handler"]
432    #[inline(always)]
433    pub fn idena(&self) -> IdenaR {
434        IdenaR::new((self.bits & 3) as u8)
435    }
436    #[doc = "Bits 2:5 - ID register"]
437    #[inline(always)]
438    pub fn idreg(&self) -> IdregR {
439        IdregR::new(((self.bits >> 2) & 0x0f) as u8)
440    }
441    #[doc = "Bits 6:8 - HDR support"]
442    #[inline(always)]
443    pub fn hdrsupp(&self) -> HdrsuppR {
444        HdrsuppR::new(((self.bits >> 6) & 7) as u8)
445    }
446    #[doc = "Bit 9 - Master"]
447    #[inline(always)]
448    pub fn master(&self) -> MasterR {
449        MasterR::new(((self.bits >> 9) & 1) != 0)
450    }
451    #[doc = "Bits 10:11 - Static address"]
452    #[inline(always)]
453    pub fn saddr(&self) -> SaddrR {
454        SaddrR::new(((self.bits >> 10) & 3) as u8)
455    }
456    #[doc = "Bits 12:15 - Common Command Codes (CCC) handling"]
457    #[inline(always)]
458    pub fn ccchandle(&self) -> CcchandleR {
459        CcchandleR::new(((self.bits >> 12) & 0x0f) as u8)
460    }
461    #[doc = "Bits 16:20 - In-Band Interrupts, Master Requests, Hot Join events"]
462    #[inline(always)]
463    pub fn ibi_mr_hj(&self) -> IbiMrHjR {
464        IbiMrHjR::new(((self.bits >> 16) & 0x1f) as u8)
465    }
466    #[doc = "Bit 21 - Time control"]
467    #[inline(always)]
468    pub fn timectrl(&self) -> TimectrlR {
469        TimectrlR::new(((self.bits >> 21) & 1) != 0)
470    }
471    #[doc = "Bits 23:25 - External FIFO"]
472    #[inline(always)]
473    pub fn extfifo(&self) -> ExtfifoR {
474        ExtfifoR::new(((self.bits >> 23) & 7) as u8)
475    }
476    #[doc = "Bits 26:27 - FIFO transmit"]
477    #[inline(always)]
478    pub fn fifotx(&self) -> FifotxR {
479        FifotxR::new(((self.bits >> 26) & 3) as u8)
480    }
481    #[doc = "Bits 28:29 - FIFO receive"]
482    #[inline(always)]
483    pub fn fiforx(&self) -> FiforxR {
484        FiforxR::new(((self.bits >> 28) & 3) as u8)
485    }
486    #[doc = "Bit 30 - INT"]
487    #[inline(always)]
488    pub fn int(&self) -> IntR {
489        IntR::new(((self.bits >> 30) & 1) != 0)
490    }
491    #[doc = "Bit 31 - DMA"]
492    #[inline(always)]
493    pub fn dma(&self) -> DmaR {
494        DmaR::new(((self.bits >> 31) & 1) != 0)
495    }
496}
497#[cfg(feature = "debug")]
498impl core::fmt::Debug for R {
499    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
500        f.debug_struct("SCAPABILITIES")
501            .field("idena", &self.idena())
502            .field("idreg", &self.idreg())
503            .field("hdrsupp", &self.hdrsupp())
504            .field("master", &self.master())
505            .field("saddr", &self.saddr())
506            .field("ccchandle", &self.ccchandle())
507            .field("ibi_mr_hj", &self.ibi_mr_hj())
508            .field("timectrl", &self.timectrl())
509            .field("extfifo", &self.extfifo())
510            .field("fifotx", &self.fifotx())
511            .field("fiforx", &self.fiforx())
512            .field("int", &self.int())
513            .field("dma", &self.dma())
514            .finish()
515    }
516}
517#[doc = "Slave Capabilities Register\n\nYou can [`read`](crate::Reg::read) this register and get [`scapabilities::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
518pub struct ScapabilitiesSpec;
519impl crate::RegisterSpec for ScapabilitiesSpec {
520    type Ux = u32;
521}
522#[doc = "`read()` method returns [`scapabilities::R`](R) reader structure"]
523impl crate::Readable for ScapabilitiesSpec {}
524#[doc = "`reset()` method sets SCAPABILITIES to value 0xe83f_fe78"]
525impl crate::Resettable for ScapabilitiesSpec {
526    const RESET_VALUE: u32 = 0xe83f_fe78;
527}