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
#[doc = "Register `AHBRXBUF4CR0` reader"]
pub struct R(crate::R<AHBRXBUF4CR0_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<AHBRXBUF4CR0_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<AHBRXBUF4CR0_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<AHBRXBUF4CR0_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `AHBRXBUF4CR0` writer"]
pub struct W(crate::W<AHBRXBUF4CR0_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<AHBRXBUF4CR0_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<AHBRXBUF4CR0_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<AHBRXBUF4CR0_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `BUFSZ` reader - AHB RX Buffer Size in 64 bits."]
pub type BUFSZ_R = crate::FieldReader<u8, u8>;
#[doc = "Field `BUFSZ` writer - AHB RX Buffer Size in 64 bits."]
pub type BUFSZ_W<'a, const O: u8> = crate::FieldWriter<'a, u32, AHBRXBUF4CR0_SPEC, u8, u8, 8, O>;
#[doc = "Field `MSTRID` reader - This AHB RX Buffer is assigned according to AHB Master with ID (MSTR_ID)."]
pub type MSTRID_R = crate::FieldReader<u8, u8>;
#[doc = "Field `MSTRID` writer - This AHB RX Buffer is assigned according to AHB Master with ID (MSTR_ID)."]
pub type MSTRID_W<'a, const O: u8> = crate::FieldWriter<'a, u32, AHBRXBUF4CR0_SPEC, u8, u8, 4, O>;
#[doc = "Field `PRIORITY` reader - This priority for AHB Master Read which this AHB RX Buffer is assigned. 7 is the highest priority, 0 the lowest."]
pub type PRIORITY_R = crate::FieldReader<u8, u8>;
#[doc = "Field `PRIORITY` writer - This priority for AHB Master Read which this AHB RX Buffer is assigned. 7 is the highest priority, 0 the lowest."]
pub type PRIORITY_W<'a, const O: u8> = crate::FieldWriter<'a, u32, AHBRXBUF4CR0_SPEC, u8, u8, 3, O>;
#[doc = "Field `PREFETCHEN` reader - AHB Read Prefetch Enable for current AHB RX Buffer corresponding Master."]
pub type PREFETCHEN_R = crate::BitReader<PREFETCHEN_A>;
#[doc = "AHB Read Prefetch Enable for current AHB RX Buffer corresponding Master.\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PREFETCHEN_A {
    #[doc = "0: No prefetch"]
    VALUE0 = 0,
    #[doc = "1: Prefetch enable"]
    VALUE1 = 1,
}
impl From<PREFETCHEN_A> for bool {
    #[inline(always)]
    fn from(variant: PREFETCHEN_A) -> Self {
        variant as u8 != 0
    }
}
impl PREFETCHEN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PREFETCHEN_A {
        match self.bits {
            false => PREFETCHEN_A::VALUE0,
            true => PREFETCHEN_A::VALUE1,
        }
    }
    #[doc = "Checks if the value of the field is `VALUE0`"]
    #[inline(always)]
    pub fn is_value0(&self) -> bool {
        *self == PREFETCHEN_A::VALUE0
    }
    #[doc = "Checks if the value of the field is `VALUE1`"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == PREFETCHEN_A::VALUE1
    }
}
#[doc = "Field `PREFETCHEN` writer - AHB Read Prefetch Enable for current AHB RX Buffer corresponding Master."]
pub type PREFETCHEN_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, AHBRXBUF4CR0_SPEC, PREFETCHEN_A, O>;
impl<'a, const O: u8> PREFETCHEN_W<'a, O> {
    #[doc = "No prefetch"]
    #[inline(always)]
    pub fn value0(self) -> &'a mut W {
        self.variant(PREFETCHEN_A::VALUE0)
    }
    #[doc = "Prefetch enable"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut W {
        self.variant(PREFETCHEN_A::VALUE1)
    }
}
impl R {
    #[doc = "Bits 0:7 - AHB RX Buffer Size in 64 bits."]
    #[inline(always)]
    pub fn bufsz(&self) -> BUFSZ_R {
        BUFSZ_R::new((self.bits & 0xff) as u8)
    }
    #[doc = "Bits 16:19 - This AHB RX Buffer is assigned according to AHB Master with ID (MSTR_ID)."]
    #[inline(always)]
    pub fn mstrid(&self) -> MSTRID_R {
        MSTRID_R::new(((self.bits >> 16) & 0x0f) as u8)
    }
    #[doc = "Bits 24:26 - This priority for AHB Master Read which this AHB RX Buffer is assigned. 7 is the highest priority, 0 the lowest."]
    #[inline(always)]
    pub fn priority(&self) -> PRIORITY_R {
        PRIORITY_R::new(((self.bits >> 24) & 7) as u8)
    }
    #[doc = "Bit 31 - AHB Read Prefetch Enable for current AHB RX Buffer corresponding Master."]
    #[inline(always)]
    pub fn prefetchen(&self) -> PREFETCHEN_R {
        PREFETCHEN_R::new(((self.bits >> 31) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:7 - AHB RX Buffer Size in 64 bits."]
    #[inline(always)]
    #[must_use]
    pub fn bufsz(&mut self) -> BUFSZ_W<0> {
        BUFSZ_W::new(self)
    }
    #[doc = "Bits 16:19 - This AHB RX Buffer is assigned according to AHB Master with ID (MSTR_ID)."]
    #[inline(always)]
    #[must_use]
    pub fn mstrid(&mut self) -> MSTRID_W<16> {
        MSTRID_W::new(self)
    }
    #[doc = "Bits 24:26 - This priority for AHB Master Read which this AHB RX Buffer is assigned. 7 is the highest priority, 0 the lowest."]
    #[inline(always)]
    #[must_use]
    pub fn priority(&mut self) -> PRIORITY_W<24> {
        PRIORITY_W::new(self)
    }
    #[doc = "Bit 31 - AHB Read Prefetch Enable for current AHB RX Buffer corresponding Master."]
    #[inline(always)]
    #[must_use]
    pub fn prefetchen(&mut self) -> PREFETCHEN_W<31> {
        PREFETCHEN_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "AHB RX Buffer 4 Control Register 0\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 [ahbrxbuf4cr0](index.html) module"]
pub struct AHBRXBUF4CR0_SPEC;
impl crate::RegisterSpec for AHBRXBUF4CR0_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [ahbrxbuf4cr0::R](R) reader structure"]
impl crate::Readable for AHBRXBUF4CR0_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [ahbrxbuf4cr0::W](W) writer structure"]
impl crate::Writable for AHBRXBUF4CR0_SPEC {
    type Writer = W;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets AHBRXBUF4CR0 to value 0x8004_0010"]
impl crate::Resettable for AHBRXBUF4CR0_SPEC {
    const RESET_VALUE: Self::Ux = 0x8004_0010;
}