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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
#[doc = "Reader of register OPTIONS"]
pub type R = crate::R<u32, super::OPTIONS>;
#[doc = "Writer for register OPTIONS"]
pub type W = crate::W<u32, super::OPTIONS>;
#[doc = "Register OPTIONS `reset()`'s with value 0"]
impl crate::ResetValue for super::OPTIONS {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "Reader of field `FIRST_LNME_FIFO_DEPTH`"]
pub type FIRST_LNME_FIFO_DEPTH_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `FIRST_LNME_FIFO_DEPTH`"]
pub struct FIRST_LNME_FIFO_DEPTH_W<'a> {
    w: &'a mut W,
}
impl<'a> FIRST_LNME_FIFO_DEPTH_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24);
        self.w
    }
}
#[doc = "Reader of field `Reserved1`"]
pub type RESERVED1_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `Reserved1`"]
pub struct RESERVED1_W<'a> {
    w: &'a mut W,
}
impl<'a> RESERVED1_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22);
        self.w
    }
}
#[doc = "Reader of field `FIRST_LNME_NR_OF_PES`"]
pub type FIRST_LNME_NR_OF_PES_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `FIRST_LNME_NR_OF_PES`"]
pub struct FIRST_LNME_NR_OF_PES_W<'a> {
    w: &'a mut W,
}
impl<'a> FIRST_LNME_NR_OF_PES_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x3f << 16)) | (((value as u32) & 0x3f) << 16);
        self.w
    }
}
#[doc = "Reader of field `Reserved2`"]
pub type RESERVED2_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `Reserved2`"]
pub struct RESERVED2_W<'a> {
    w: &'a mut W,
}
impl<'a> RESERVED2_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 13)) | (((value as u32) & 0x07) << 13);
        self.w
    }
}
#[doc = "Reader of field `MMM3A`"]
pub type MMM3A_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `MMM3A`"]
pub struct MMM3A_W<'a> {
    w: &'a mut W,
}
impl<'a> MMM3A_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
        self.w
    }
}
#[doc = "Reader of field `INT_MASKING`"]
pub type INT_MASKING_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `INT_MASKING`"]
pub struct INT_MASKING_W<'a> {
    w: &'a mut W,
}
impl<'a> INT_MASKING_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
        self.w
    }
}
#[doc = "Reader of field `PROTECTION_OPTION`"]
pub type PROTECTION_OPTION_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `PROTECTION_OPTION`"]
pub struct PROTECTION_OPTION_W<'a> {
    w: &'a mut W,
}
impl<'a> PROTECTION_OPTION_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8);
        self.w
    }
}
#[doc = "Reader of field `PROGRAM_RAM`"]
pub type PROGRAM_RAM_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `PROGRAM_RAM`"]
pub struct PROGRAM_RAM_W<'a> {
    w: &'a mut W,
}
impl<'a> PROGRAM_RAM_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
        self.w
    }
}
#[doc = "Reader of field `SEQUENCER_CONFIGURATION`"]
pub type SEQUENCER_CONFIGURATION_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `SEQUENCER_CONFIGURATION`"]
pub struct SEQUENCER_CONFIGURATION_W<'a> {
    w: &'a mut W,
}
impl<'a> SEQUENCER_CONFIGURATION_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 5)) | (((value as u32) & 0x03) << 5);
        self.w
    }
}
#[doc = "Reader of field `LNME_CONFIGURATION`"]
pub type LNME_CONFIGURATION_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `LNME_CONFIGURATION`"]
pub struct LNME_CONFIGURATION_W<'a> {
    w: &'a mut W,
}
impl<'a> LNME_CONFIGURATION_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 2)) | (((value as u32) & 0x07) << 2);
        self.w
    }
}
#[doc = "Reader of field `PKCP_CONFIGURATION`"]
pub type PKCP_CONFIGURATION_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `PKCP_CONFIGURATION`"]
pub struct PKCP_CONFIGURATION_W<'a> {
    w: &'a mut W,
}
impl<'a> PKCP_CONFIGURATION_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03);
        self.w
    }
}
impl R {
    #[doc = "Bits 24:31 - 31:24\\] Number of words in the first LNME's FIFO RAM Should be ignored if LNME configuration is 0. The contents of this field indicate the actual depth as selected by the LNME FIFO RAM size strap input, fifo_size_sel. Note: Reset value is undefined"]
    #[inline(always)]
    pub fn first_lnme_fifo_depth(&self) -> FIRST_LNME_FIFO_DEPTH_R {
        FIRST_LNME_FIFO_DEPTH_R::new(((self.bits >> 24) & 0xff) as u8)
    }
    #[doc = "Bits 22:23 - 23:22\\] Ignore on read"]
    #[inline(always)]
    pub fn reserved1(&self) -> RESERVED1_R {
        RESERVED1_R::new(((self.bits >> 22) & 0x03) as u8)
    }
    #[doc = "Bits 16:21 - 21:16\\] Number of processing elements in the pipeline of the first LNME Should be ignored if LNME configuration is 0. Note: Reset value is undefined."]
    #[inline(always)]
    pub fn first_lnme_nr_of_pes(&self) -> FIRST_LNME_NR_OF_PES_R {
        FIRST_LNME_NR_OF_PES_R::new(((self.bits >> 16) & 0x3f) as u8)
    }
    #[doc = "Bits 13:15 - 15:13\\] Ignore on read"]
    #[inline(always)]
    pub fn reserved2(&self) -> RESERVED2_R {
        RESERVED2_R::new(((self.bits >> 13) & 0x07) as u8)
    }
    #[doc = "Bit 12 - 12:12\\] Reserved for a future functional extension to the LNME Always 0b"]
    #[inline(always)]
    pub fn mmm3a(&self) -> MMM3A_R {
        MMM3A_R::new(((self.bits >> 12) & 0x01) != 0)
    }
    #[doc = "Bit 11 - 11:11\\] Value 0b indicates that the main interrupt output (bit \\[1\\] of the interrupts output bus) is the direct complement of the run bit in the PKA_CONTROL register, value 1b indicates that interrupt masking logic is present for this output. Note: Reset value is undefined"]
    #[inline(always)]
    pub fn int_masking(&self) -> INT_MASKING_R {
        INT_MASKING_R::new(((self.bits >> 11) & 0x01) != 0)
    }
    #[doc = "Bits 8:10 - 10:8\\] Value 0 indicates no additional protection against side channel attacks, value 1 indicates the SCAP option, value 3 indicates the PROT option; other values are reserved. Note: Reset value is undefined"]
    #[inline(always)]
    pub fn protection_option(&self) -> PROTECTION_OPTION_R {
        PROTECTION_OPTION_R::new(((self.bits >> 8) & 0x07) as u8)
    }
    #[doc = "Bit 7 - 7:7\\] Value 1b indicates sequencer program storage in RAM, value 0b in ROM. Note: Reset value is undefined"]
    #[inline(always)]
    pub fn program_ram(&self) -> PROGRAM_RAM_R {
        PROGRAM_RAM_R::new(((self.bits >> 7) & 0x01) != 0)
    }
    #[doc = "Bits 5:6 - 6:5\\] Value 1 indicates a standard sequencer; other values are reserved."]
    #[inline(always)]
    pub fn sequencer_configuration(&self) -> SEQUENCER_CONFIGURATION_R {
        SEQUENCER_CONFIGURATION_R::new(((self.bits >> 5) & 0x03) as u8)
    }
    #[doc = "Bits 2:4 - 4:2\\] Value 0 indicates NO LNME, value 1 indicates one standard LNME (with alpha = 32, beta = 8); other values reserved. Note: Reset value is undefined"]
    #[inline(always)]
    pub fn lnme_configuration(&self) -> LNME_CONFIGURATION_R {
        LNME_CONFIGURATION_R::new(((self.bits >> 2) & 0x07) as u8)
    }
    #[doc = "Bits 0:1 - 1:0\\] Value 1 indicates a PKCP with a 16x16 multiplier, value 2 indicates a PKCP with a 32x32 multiplier, other values reserved. Note: Reset value is undefined."]
    #[inline(always)]
    pub fn pkcp_configuration(&self) -> PKCP_CONFIGURATION_R {
        PKCP_CONFIGURATION_R::new((self.bits & 0x03) as u8)
    }
}
impl W {
    #[doc = "Bits 24:31 - 31:24\\] Number of words in the first LNME's FIFO RAM Should be ignored if LNME configuration is 0. The contents of this field indicate the actual depth as selected by the LNME FIFO RAM size strap input, fifo_size_sel. Note: Reset value is undefined"]
    #[inline(always)]
    pub fn first_lnme_fifo_depth(&mut self) -> FIRST_LNME_FIFO_DEPTH_W {
        FIRST_LNME_FIFO_DEPTH_W { w: self }
    }
    #[doc = "Bits 22:23 - 23:22\\] Ignore on read"]
    #[inline(always)]
    pub fn reserved1(&mut self) -> RESERVED1_W {
        RESERVED1_W { w: self }
    }
    #[doc = "Bits 16:21 - 21:16\\] Number of processing elements in the pipeline of the first LNME Should be ignored if LNME configuration is 0. Note: Reset value is undefined."]
    #[inline(always)]
    pub fn first_lnme_nr_of_pes(&mut self) -> FIRST_LNME_NR_OF_PES_W {
        FIRST_LNME_NR_OF_PES_W { w: self }
    }
    #[doc = "Bits 13:15 - 15:13\\] Ignore on read"]
    #[inline(always)]
    pub fn reserved2(&mut self) -> RESERVED2_W {
        RESERVED2_W { w: self }
    }
    #[doc = "Bit 12 - 12:12\\] Reserved for a future functional extension to the LNME Always 0b"]
    #[inline(always)]
    pub fn mmm3a(&mut self) -> MMM3A_W {
        MMM3A_W { w: self }
    }
    #[doc = "Bit 11 - 11:11\\] Value 0b indicates that the main interrupt output (bit \\[1\\] of the interrupts output bus) is the direct complement of the run bit in the PKA_CONTROL register, value 1b indicates that interrupt masking logic is present for this output. Note: Reset value is undefined"]
    #[inline(always)]
    pub fn int_masking(&mut self) -> INT_MASKING_W {
        INT_MASKING_W { w: self }
    }
    #[doc = "Bits 8:10 - 10:8\\] Value 0 indicates no additional protection against side channel attacks, value 1 indicates the SCAP option, value 3 indicates the PROT option; other values are reserved. Note: Reset value is undefined"]
    #[inline(always)]
    pub fn protection_option(&mut self) -> PROTECTION_OPTION_W {
        PROTECTION_OPTION_W { w: self }
    }
    #[doc = "Bit 7 - 7:7\\] Value 1b indicates sequencer program storage in RAM, value 0b in ROM. Note: Reset value is undefined"]
    #[inline(always)]
    pub fn program_ram(&mut self) -> PROGRAM_RAM_W {
        PROGRAM_RAM_W { w: self }
    }
    #[doc = "Bits 5:6 - 6:5\\] Value 1 indicates a standard sequencer; other values are reserved."]
    #[inline(always)]
    pub fn sequencer_configuration(&mut self) -> SEQUENCER_CONFIGURATION_W {
        SEQUENCER_CONFIGURATION_W { w: self }
    }
    #[doc = "Bits 2:4 - 4:2\\] Value 0 indicates NO LNME, value 1 indicates one standard LNME (with alpha = 32, beta = 8); other values reserved. Note: Reset value is undefined"]
    #[inline(always)]
    pub fn lnme_configuration(&mut self) -> LNME_CONFIGURATION_W {
        LNME_CONFIGURATION_W { w: self }
    }
    #[doc = "Bits 0:1 - 1:0\\] Value 1 indicates a PKCP with a 16x16 multiplier, value 2 indicates a PKCP with a 32x32 multiplier, other values reserved. Note: Reset value is undefined."]
    #[inline(always)]
    pub fn pkcp_configuration(&mut self) -> PKCP_CONFIGURATION_W {
        PKCP_CONFIGURATION_W { w: self }
    }
}