1#[doc = "Register `PARAM` reader"]
2pub type R = crate::R<ParamSpec>;
3#[doc = "Field `TRIG_NUM` reader - Trigger Number"]
4pub type TrigNumR = crate::FieldReader;
5#[doc = "Result FIFO Depth\n\nValue on reset: 8"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8#[repr(u8)]
9pub enum Fifosize {
10 #[doc = "1: Result FIFO depth = 2 dataword."]
11 Entries2 = 1,
12 #[doc = "4: Result FIFO depth = 4 datawords."]
13 Entries4 = 4,
14 #[doc = "8: Result FIFO depth = 8 datawords."]
15 Entries8 = 8,
16 #[doc = "16: Result FIFO depth = 16 datawords."]
17 Entries16 = 16,
18 #[doc = "32: Result FIFO depth = 32 datawords."]
19 Entries32 = 32,
20 #[doc = "64: Result FIFO depth = 64 datawords."]
21 Entries64 = 64,
22}
23impl From<Fifosize> for u8 {
24 #[inline(always)]
25 fn from(variant: Fifosize) -> Self {
26 variant as _
27 }
28}
29impl crate::FieldSpec for Fifosize {
30 type Ux = u8;
31}
32impl crate::IsEnum for Fifosize {}
33#[doc = "Field `FIFOSIZE` reader - Result FIFO Depth"]
34pub type FifosizeR = crate::FieldReader<Fifosize>;
35impl FifosizeR {
36 #[doc = "Get enumerated values variant"]
37 #[inline(always)]
38 pub const fn variant(&self) -> Option<Fifosize> {
39 match self.bits {
40 1 => Some(Fifosize::Entries2),
41 4 => Some(Fifosize::Entries4),
42 8 => Some(Fifosize::Entries8),
43 16 => Some(Fifosize::Entries16),
44 32 => Some(Fifosize::Entries32),
45 64 => Some(Fifosize::Entries64),
46 _ => None,
47 }
48 }
49 #[doc = "Result FIFO depth = 2 dataword."]
50 #[inline(always)]
51 pub fn is_entries_2(&self) -> bool {
52 *self == Fifosize::Entries2
53 }
54 #[doc = "Result FIFO depth = 4 datawords."]
55 #[inline(always)]
56 pub fn is_entries_4(&self) -> bool {
57 *self == Fifosize::Entries4
58 }
59 #[doc = "Result FIFO depth = 8 datawords."]
60 #[inline(always)]
61 pub fn is_entries_8(&self) -> bool {
62 *self == Fifosize::Entries8
63 }
64 #[doc = "Result FIFO depth = 16 datawords."]
65 #[inline(always)]
66 pub fn is_entries_16(&self) -> bool {
67 *self == Fifosize::Entries16
68 }
69 #[doc = "Result FIFO depth = 32 datawords."]
70 #[inline(always)]
71 pub fn is_entries_32(&self) -> bool {
72 *self == Fifosize::Entries32
73 }
74 #[doc = "Result FIFO depth = 64 datawords."]
75 #[inline(always)]
76 pub fn is_entries_64(&self) -> bool {
77 *self == Fifosize::Entries64
78 }
79}
80#[doc = "Field `CV_NUM` reader - Compare Value Number"]
81pub type CvNumR = crate::FieldReader;
82#[doc = "Field `CMD_NUM` reader - Command Buffer Number"]
83pub type CmdNumR = crate::FieldReader;
84impl R {
85 #[doc = "Bits 0:7 - Trigger Number"]
86 #[inline(always)]
87 pub fn trig_num(&self) -> TrigNumR {
88 TrigNumR::new((self.bits & 0xff) as u8)
89 }
90 #[doc = "Bits 8:15 - Result FIFO Depth"]
91 #[inline(always)]
92 pub fn fifosize(&self) -> FifosizeR {
93 FifosizeR::new(((self.bits >> 8) & 0xff) as u8)
94 }
95 #[doc = "Bits 16:23 - Compare Value Number"]
96 #[inline(always)]
97 pub fn cv_num(&self) -> CvNumR {
98 CvNumR::new(((self.bits >> 16) & 0xff) as u8)
99 }
100 #[doc = "Bits 24:31 - Command Buffer Number"]
101 #[inline(always)]
102 pub fn cmd_num(&self) -> CmdNumR {
103 CmdNumR::new(((self.bits >> 24) & 0xff) as u8)
104 }
105}
106#[cfg(feature = "debug")]
107impl core::fmt::Debug for R {
108 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
109 f.debug_struct("PARAM")
110 .field("trig_num", &self.trig_num())
111 .field("fifosize", &self.fifosize())
112 .field("cv_num", &self.cv_num())
113 .field("cmd_num", &self.cmd_num())
114 .finish()
115 }
116}
117#[doc = "Parameter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`param::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
118pub struct ParamSpec;
119impl crate::RegisterSpec for ParamSpec {
120 type Ux = u32;
121}
122#[doc = "`read()` method returns [`param::R`](R) reader structure"]
123impl crate::Readable for ParamSpec {}
124#[doc = "`reset()` method sets PARAM to value 0x0707_0804"]
125impl crate::Resettable for ParamSpec {
126 const RESET_VALUE: u32 = 0x0707_0804;
127}