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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
#[doc = "Register `twi_drv_ctrl` reader"]
pub struct R(crate::R<TWI_DRV_CTRL_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<TWI_DRV_CTRL_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<TWI_DRV_CTRL_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<TWI_DRV_CTRL_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `twi_drv_ctrl` writer"]
pub struct W(crate::W<TWI_DRV_CTRL_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<TWI_DRV_CTRL_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<TWI_DRV_CTRL_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<TWI_DRV_CTRL_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `twi_drv_en` reader - "]
pub type TWI_DRV_EN_R = crate::BitReader<TWI_DRV_EN_A>;
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TWI_DRV_EN_A {
    #[doc = "0: `0`"]
    DISABLE = 0,
    #[doc = "1: `1`"]
    ENABLE = 1,
}
impl From<TWI_DRV_EN_A> for bool {
    #[inline(always)]
    fn from(variant: TWI_DRV_EN_A) -> Self {
        variant as u8 != 0
    }
}
impl TWI_DRV_EN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TWI_DRV_EN_A {
        match self.bits {
            false => TWI_DRV_EN_A::DISABLE,
            true => TWI_DRV_EN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == TWI_DRV_EN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == TWI_DRV_EN_A::ENABLE
    }
}
#[doc = "Field `twi_drv_en` writer - "]
pub type TWI_DRV_EN_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, TWI_DRV_CTRL_SPEC, TWI_DRV_EN_A, O>;
impl<'a, const O: u8> TWI_DRV_EN_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(TWI_DRV_EN_A::DISABLE)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(TWI_DRV_EN_A::ENABLE)
    }
}
#[doc = "Field `soft_reset` reader - Software reset"]
pub type SOFT_RESET_R = crate::BitReader<SOFT_RESET_A>;
#[doc = "Software reset\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SOFT_RESET_A {
    #[doc = "0: `0`"]
    NORMAL = 0,
    #[doc = "1: `1`"]
    RESET = 1,
}
impl From<SOFT_RESET_A> for bool {
    #[inline(always)]
    fn from(variant: SOFT_RESET_A) -> Self {
        variant as u8 != 0
    }
}
impl SOFT_RESET_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SOFT_RESET_A {
        match self.bits {
            false => SOFT_RESET_A::NORMAL,
            true => SOFT_RESET_A::RESET,
        }
    }
    #[doc = "Checks if the value of the field is `NORMAL`"]
    #[inline(always)]
    pub fn is_normal(&self) -> bool {
        *self == SOFT_RESET_A::NORMAL
    }
    #[doc = "Checks if the value of the field is `RESET`"]
    #[inline(always)]
    pub fn is_reset(&self) -> bool {
        *self == SOFT_RESET_A::RESET
    }
}
#[doc = "Field `soft_reset` writer - Software reset"]
pub type SOFT_RESET_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, TWI_DRV_CTRL_SPEC, SOFT_RESET_A, O>;
impl<'a, const O: u8> SOFT_RESET_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn normal(self) -> &'a mut W {
        self.variant(SOFT_RESET_A::NORMAL)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn reset(self) -> &'a mut W {
        self.variant(SOFT_RESET_A::RESET)
    }
}
#[doc = "Field `timeout_n` reader - Timeout number"]
pub type TIMEOUT_N_R = crate::FieldReader<u8, u8>;
#[doc = "Field `timeout_n` writer - Timeout number"]
pub type TIMEOUT_N_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, TWI_DRV_CTRL_SPEC, u8, u8, 8, O>;
#[doc = "Field `twi_sta` reader - TWI status"]
pub type TWI_STA_R = crate::FieldReader<u8, TWI_STA_A>;
#[doc = "TWI status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TWI_STA_A {
    #[doc = "0: bus error"]
    BE = 0,
    #[doc = "8: START condition transmitted"]
    SCT = 8,
    #[doc = "16: Repeated START condition transmitted"]
    RSCT = 16,
    #[doc = "24: Address + Write bit transmitted, ACK received"]
    AWBT_AR = 24,
    #[doc = "32: Address + Write bit transmitted, ACK not received"]
    AWBT_ANR = 32,
    #[doc = "40: Data byte transmitted in master mode, ACK received"]
    DBTM_AR = 40,
    #[doc = "48: Data byte transmitted in master mode, ACK not received"]
    DBTM_ANR = 48,
    #[doc = "56: Arbitration lost in address or data byte"]
    AL_A_DB = 56,
    #[doc = "64: Address + Read bit transmitted, ACK received"]
    ARBT_AR = 64,
    #[doc = "72: Address + Read bit transmitted, ACK not received"]
    ARBT_ANR = 72,
    #[doc = "80: Data byte received in master mode, ACK received"]
    DBRM_AR = 80,
    #[doc = "88: Data byte received in master mode, ACK not received"]
    DBRM_ANR = 88,
    #[doc = "1: Timeout when sending the 9th SCL clock"]
    T_S9SC = 1,
}
impl From<TWI_STA_A> for u8 {
    #[inline(always)]
    fn from(variant: TWI_STA_A) -> Self {
        variant as _
    }
}
impl TWI_STA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<TWI_STA_A> {
        match self.bits {
            0 => Some(TWI_STA_A::BE),
            8 => Some(TWI_STA_A::SCT),
            16 => Some(TWI_STA_A::RSCT),
            24 => Some(TWI_STA_A::AWBT_AR),
            32 => Some(TWI_STA_A::AWBT_ANR),
            40 => Some(TWI_STA_A::DBTM_AR),
            48 => Some(TWI_STA_A::DBTM_ANR),
            56 => Some(TWI_STA_A::AL_A_DB),
            64 => Some(TWI_STA_A::ARBT_AR),
            72 => Some(TWI_STA_A::ARBT_ANR),
            80 => Some(TWI_STA_A::DBRM_AR),
            88 => Some(TWI_STA_A::DBRM_ANR),
            1 => Some(TWI_STA_A::T_S9SC),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `BE`"]
    #[inline(always)]
    pub fn is_be(&self) -> bool {
        *self == TWI_STA_A::BE
    }
    #[doc = "Checks if the value of the field is `SCT`"]
    #[inline(always)]
    pub fn is_sct(&self) -> bool {
        *self == TWI_STA_A::SCT
    }
    #[doc = "Checks if the value of the field is `RSCT`"]
    #[inline(always)]
    pub fn is_rsct(&self) -> bool {
        *self == TWI_STA_A::RSCT
    }
    #[doc = "Checks if the value of the field is `AWBT_AR`"]
    #[inline(always)]
    pub fn is_awbt_ar(&self) -> bool {
        *self == TWI_STA_A::AWBT_AR
    }
    #[doc = "Checks if the value of the field is `AWBT_ANR`"]
    #[inline(always)]
    pub fn is_awbt_anr(&self) -> bool {
        *self == TWI_STA_A::AWBT_ANR
    }
    #[doc = "Checks if the value of the field is `DBTM_AR`"]
    #[inline(always)]
    pub fn is_dbtm_ar(&self) -> bool {
        *self == TWI_STA_A::DBTM_AR
    }
    #[doc = "Checks if the value of the field is `DBTM_ANR`"]
    #[inline(always)]
    pub fn is_dbtm_anr(&self) -> bool {
        *self == TWI_STA_A::DBTM_ANR
    }
    #[doc = "Checks if the value of the field is `AL_A_DB`"]
    #[inline(always)]
    pub fn is_al_a_db(&self) -> bool {
        *self == TWI_STA_A::AL_A_DB
    }
    #[doc = "Checks if the value of the field is `ARBT_AR`"]
    #[inline(always)]
    pub fn is_arbt_ar(&self) -> bool {
        *self == TWI_STA_A::ARBT_AR
    }
    #[doc = "Checks if the value of the field is `ARBT_ANR`"]
    #[inline(always)]
    pub fn is_arbt_anr(&self) -> bool {
        *self == TWI_STA_A::ARBT_ANR
    }
    #[doc = "Checks if the value of the field is `DBRM_AR`"]
    #[inline(always)]
    pub fn is_dbrm_ar(&self) -> bool {
        *self == TWI_STA_A::DBRM_AR
    }
    #[doc = "Checks if the value of the field is `DBRM_ANR`"]
    #[inline(always)]
    pub fn is_dbrm_anr(&self) -> bool {
        *self == TWI_STA_A::DBRM_ANR
    }
    #[doc = "Checks if the value of the field is `T_S9SC`"]
    #[inline(always)]
    pub fn is_t_s9sc(&self) -> bool {
        *self == TWI_STA_A::T_S9SC
    }
}
#[doc = "Field `tran_result` reader - Transition result"]
pub type TRAN_RESULT_R = crate::FieldReader<u8, TRAN_RESULT_A>;
#[doc = "Transition result\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TRAN_RESULT_A {
    #[doc = "0: `0`"]
    OK = 0,
    #[doc = "1: `1`"]
    FAIL = 1,
}
impl From<TRAN_RESULT_A> for u8 {
    #[inline(always)]
    fn from(variant: TRAN_RESULT_A) -> Self {
        variant as _
    }
}
impl TRAN_RESULT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<TRAN_RESULT_A> {
        match self.bits {
            0 => Some(TRAN_RESULT_A::OK),
            1 => Some(TRAN_RESULT_A::FAIL),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `OK`"]
    #[inline(always)]
    pub fn is_ok(&self) -> bool {
        *self == TRAN_RESULT_A::OK
    }
    #[doc = "Checks if the value of the field is `FAIL`"]
    #[inline(always)]
    pub fn is_fail(&self) -> bool {
        *self == TRAN_RESULT_A::FAIL
    }
}
#[doc = "Field `tran_result` writer - Transition result"]
pub type TRAN_RESULT_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, TWI_DRV_CTRL_SPEC, u8, TRAN_RESULT_A, 4, O>;
impl<'a, const O: u8> TRAN_RESULT_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn ok(self) -> &'a mut W {
        self.variant(TRAN_RESULT_A::OK)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn fail(self) -> &'a mut W {
        self.variant(TRAN_RESULT_A::FAIL)
    }
}
#[doc = "Field `read_tran_mode` reader - Read transition mode"]
pub type READ_TRAN_MODE_R = crate::BitReader<READ_TRAN_MODE_A>;
#[doc = "Read transition mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum READ_TRAN_MODE_A {
    #[doc = "0: `0`"]
    SEND = 0,
    #[doc = "1: `1`"]
    NOT_SEND = 1,
}
impl From<READ_TRAN_MODE_A> for bool {
    #[inline(always)]
    fn from(variant: READ_TRAN_MODE_A) -> Self {
        variant as u8 != 0
    }
}
impl READ_TRAN_MODE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> READ_TRAN_MODE_A {
        match self.bits {
            false => READ_TRAN_MODE_A::SEND,
            true => READ_TRAN_MODE_A::NOT_SEND,
        }
    }
    #[doc = "Checks if the value of the field is `SEND`"]
    #[inline(always)]
    pub fn is_send(&self) -> bool {
        *self == READ_TRAN_MODE_A::SEND
    }
    #[doc = "Checks if the value of the field is `NOT_SEND`"]
    #[inline(always)]
    pub fn is_not_send(&self) -> bool {
        *self == READ_TRAN_MODE_A::NOT_SEND
    }
}
#[doc = "Field `read_tran_mode` writer - Read transition mode"]
pub type READ_TRAN_MODE_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, TWI_DRV_CTRL_SPEC, READ_TRAN_MODE_A, O>;
impl<'a, const O: u8> READ_TRAN_MODE_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn send(self) -> &'a mut W {
        self.variant(READ_TRAN_MODE_A::SEND)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn not_send(self) -> &'a mut W {
        self.variant(READ_TRAN_MODE_A::NOT_SEND)
    }
}
#[doc = "Field `restart_mode` reader - Restart mode"]
pub type RESTART_MODE_R = crate::BitReader<RESTART_MODE_A>;
#[doc = "Restart mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RESTART_MODE_A {
    #[doc = "0: `0`"]
    RESTART = 0,
    #[doc = "1: `1`"]
    STOP_RESTART = 1,
}
impl From<RESTART_MODE_A> for bool {
    #[inline(always)]
    fn from(variant: RESTART_MODE_A) -> Self {
        variant as u8 != 0
    }
}
impl RESTART_MODE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RESTART_MODE_A {
        match self.bits {
            false => RESTART_MODE_A::RESTART,
            true => RESTART_MODE_A::STOP_RESTART,
        }
    }
    #[doc = "Checks if the value of the field is `RESTART`"]
    #[inline(always)]
    pub fn is_restart(&self) -> bool {
        *self == RESTART_MODE_A::RESTART
    }
    #[doc = "Checks if the value of the field is `STOP_RESTART`"]
    #[inline(always)]
    pub fn is_stop_restart(&self) -> bool {
        *self == RESTART_MODE_A::STOP_RESTART
    }
}
#[doc = "Field `restart_mode` writer - Restart mode"]
pub type RESTART_MODE_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, TWI_DRV_CTRL_SPEC, RESTART_MODE_A, O>;
impl<'a, const O: u8> RESTART_MODE_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn restart(self) -> &'a mut W {
        self.variant(RESTART_MODE_A::RESTART)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn stop_restart(self) -> &'a mut W {
        self.variant(RESTART_MODE_A::STOP_RESTART)
    }
}
#[doc = "Field `start_tran` reader - Start transmission"]
pub type START_TRAN_R = crate::BitReader<START_TRAN_A>;
#[doc = "Start transmission\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum START_TRAN_A {
    #[doc = "0: `0`"]
    IDLE = 0,
    #[doc = "1: `1`"]
    START = 1,
}
impl From<START_TRAN_A> for bool {
    #[inline(always)]
    fn from(variant: START_TRAN_A) -> Self {
        variant as u8 != 0
    }
}
impl START_TRAN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> START_TRAN_A {
        match self.bits {
            false => START_TRAN_A::IDLE,
            true => START_TRAN_A::START,
        }
    }
    #[doc = "Checks if the value of the field is `IDLE`"]
    #[inline(always)]
    pub fn is_idle(&self) -> bool {
        *self == START_TRAN_A::IDLE
    }
    #[doc = "Checks if the value of the field is `START`"]
    #[inline(always)]
    pub fn is_start(&self) -> bool {
        *self == START_TRAN_A::START
    }
}
#[doc = "Field `start_tran` writer - Start transmission"]
pub type START_TRAN_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, TWI_DRV_CTRL_SPEC, START_TRAN_A, O>;
impl<'a, const O: u8> START_TRAN_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn idle(self) -> &'a mut W {
        self.variant(START_TRAN_A::IDLE)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn start(self) -> &'a mut W {
        self.variant(START_TRAN_A::START)
    }
}
impl R {
    #[doc = "Bit 0"]
    #[inline(always)]
    pub fn twi_drv_en(&self) -> TWI_DRV_EN_R {
        TWI_DRV_EN_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Software reset"]
    #[inline(always)]
    pub fn soft_reset(&self) -> SOFT_RESET_R {
        SOFT_RESET_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bits 8:15 - Timeout number"]
    #[inline(always)]
    pub fn timeout_n(&self) -> TIMEOUT_N_R {
        TIMEOUT_N_R::new(((self.bits >> 8) & 0xff) as u8)
    }
    #[doc = "Bits 16:23 - TWI status"]
    #[inline(always)]
    pub fn twi_sta(&self) -> TWI_STA_R {
        TWI_STA_R::new(((self.bits >> 16) & 0xff) as u8)
    }
    #[doc = "Bits 24:27 - Transition result"]
    #[inline(always)]
    pub fn tran_result(&self) -> TRAN_RESULT_R {
        TRAN_RESULT_R::new(((self.bits >> 24) & 0x0f) as u8)
    }
    #[doc = "Bit 28 - Read transition mode"]
    #[inline(always)]
    pub fn read_tran_mode(&self) -> READ_TRAN_MODE_R {
        READ_TRAN_MODE_R::new(((self.bits >> 28) & 1) != 0)
    }
    #[doc = "Bit 29 - Restart mode"]
    #[inline(always)]
    pub fn restart_mode(&self) -> RESTART_MODE_R {
        RESTART_MODE_R::new(((self.bits >> 29) & 1) != 0)
    }
    #[doc = "Bit 31 - Start transmission"]
    #[inline(always)]
    pub fn start_tran(&self) -> START_TRAN_R {
        START_TRAN_R::new(((self.bits >> 31) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0"]
    #[inline(always)]
    #[must_use]
    pub fn twi_drv_en(&mut self) -> TWI_DRV_EN_W<0> {
        TWI_DRV_EN_W::new(self)
    }
    #[doc = "Bit 1 - Software reset"]
    #[inline(always)]
    #[must_use]
    pub fn soft_reset(&mut self) -> SOFT_RESET_W<1> {
        SOFT_RESET_W::new(self)
    }
    #[doc = "Bits 8:15 - Timeout number"]
    #[inline(always)]
    #[must_use]
    pub fn timeout_n(&mut self) -> TIMEOUT_N_W<8> {
        TIMEOUT_N_W::new(self)
    }
    #[doc = "Bits 24:27 - Transition result"]
    #[inline(always)]
    #[must_use]
    pub fn tran_result(&mut self) -> TRAN_RESULT_W<24> {
        TRAN_RESULT_W::new(self)
    }
    #[doc = "Bit 28 - Read transition mode"]
    #[inline(always)]
    #[must_use]
    pub fn read_tran_mode(&mut self) -> READ_TRAN_MODE_W<28> {
        READ_TRAN_MODE_W::new(self)
    }
    #[doc = "Bit 29 - Restart mode"]
    #[inline(always)]
    #[must_use]
    pub fn restart_mode(&mut self) -> RESTART_MODE_W<29> {
        RESTART_MODE_W::new(self)
    }
    #[doc = "Bit 31 - Start transmission"]
    #[inline(always)]
    #[must_use]
    pub fn start_tran(&mut self) -> START_TRAN_W<31> {
        START_TRAN_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 = "TWI_DRV Control Register\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 [twi_drv_ctrl](index.html) module"]
pub struct TWI_DRV_CTRL_SPEC;
impl crate::RegisterSpec for TWI_DRV_CTRL_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [twi_drv_ctrl::R](R) reader structure"]
impl crate::Readable for TWI_DRV_CTRL_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [twi_drv_ctrl::W](W) writer structure"]
impl crate::Writable for TWI_DRV_CTRL_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 twi_drv_ctrl to value 0"]
impl crate::Resettable for TWI_DRV_CTRL_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}