1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#[doc = "Register `QSR0` reader"]
pub type R = crate::R<Qsr0Spec>;
#[doc = "Filling Level for Queue 2\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Fill {
    #[doc = "0: There is 1 ( if EMPTY = 0) or no (if EMPTY = 1) valid entry in the queue"]
    Value1 = 0,
    #[doc = "1: There are 2 valid entries in the queue"]
    Value2 = 1,
    #[doc = "2: There are 3 valid entries in the queue"]
    Value3 = 2,
    #[doc = "7: There are 8 valid entries in the queue"]
    Value4 = 7,
}
impl From<Fill> for u8 {
    #[inline(always)]
    fn from(variant: Fill) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Fill {
    type Ux = u8;
}
#[doc = "Field `FILL` reader - Filling Level for Queue 2"]
pub type FillR = crate::FieldReader<Fill>;
impl FillR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Fill> {
        match self.bits {
            0 => Some(Fill::Value1),
            1 => Some(Fill::Value2),
            2 => Some(Fill::Value3),
            7 => Some(Fill::Value4),
            _ => None,
        }
    }
    #[doc = "There is 1 ( if EMPTY = 0) or no (if EMPTY = 1) valid entry in the queue"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Fill::Value1
    }
    #[doc = "There are 2 valid entries in the queue"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Fill::Value2
    }
    #[doc = "There are 3 valid entries in the queue"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Fill::Value3
    }
    #[doc = "There are 8 valid entries in the queue"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Fill::Value4
    }
}
#[doc = "Queue Empty\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Empty {
    #[doc = "0: There are valid entries in the queue (see FILL)"]
    Value1 = 0,
    #[doc = "1: No valid entries (queue is empty)"]
    Value2 = 1,
}
impl From<Empty> for bool {
    #[inline(always)]
    fn from(variant: Empty) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `EMPTY` reader - Queue Empty"]
pub type EmptyR = crate::BitReader<Empty>;
impl EmptyR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Empty {
        match self.bits {
            false => Empty::Value1,
            true => Empty::Value2,
        }
    }
    #[doc = "There are valid entries in the queue (see FILL)"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Empty::Value1
    }
    #[doc = "No valid entries (queue is empty)"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Empty::Value2
    }
}
#[doc = "Request Gate Level\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Reqgt {
    #[doc = "0: The gate input is low"]
    Value1 = 0,
    #[doc = "1: The gate input is high"]
    Value2 = 1,
}
impl From<Reqgt> for bool {
    #[inline(always)]
    fn from(variant: Reqgt) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `REQGT` reader - Request Gate Level"]
pub type ReqgtR = crate::BitReader<Reqgt>;
impl ReqgtR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Reqgt {
        match self.bits {
            false => Reqgt::Value1,
            true => Reqgt::Value2,
        }
    }
    #[doc = "The gate input is low"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Reqgt::Value1
    }
    #[doc = "The gate input is high"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Reqgt::Value2
    }
}
#[doc = "Event Detected\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ev {
    #[doc = "0: No trigger event"]
    Value1 = 0,
    #[doc = "1: A trigger event has been detected"]
    Value2 = 1,
}
impl From<Ev> for bool {
    #[inline(always)]
    fn from(variant: Ev) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `EV` reader - Event Detected"]
pub type EvR = crate::BitReader<Ev>;
impl EvR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ev {
        match self.bits {
            false => Ev::Value1,
            true => Ev::Value2,
        }
    }
    #[doc = "No trigger event"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Ev::Value1
    }
    #[doc = "A trigger event has been detected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Ev::Value2
    }
}
impl R {
    #[doc = "Bits 0:3 - Filling Level for Queue 2"]
    #[inline(always)]
    pub fn fill(&self) -> FillR {
        FillR::new((self.bits & 0x0f) as u8)
    }
    #[doc = "Bit 5 - Queue Empty"]
    #[inline(always)]
    pub fn empty(&self) -> EmptyR {
        EmptyR::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 7 - Request Gate Level"]
    #[inline(always)]
    pub fn reqgt(&self) -> ReqgtR {
        ReqgtR::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 8 - Event Detected"]
    #[inline(always)]
    pub fn ev(&self) -> EvR {
        EvR::new(((self.bits >> 8) & 1) != 0)
    }
}
#[doc = "Queue 0 Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`qsr0::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct Qsr0Spec;
impl crate::RegisterSpec for Qsr0Spec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`qsr0::R`](R) reader structure"]
impl crate::Readable for Qsr0Spec {}
#[doc = "`reset()` method sets QSR0 to value 0x20"]
impl crate::Resettable for Qsr0Spec {
    const RESET_VALUE: u32 = 0x20;
}