efm32pg12_pac/crypto0/
seqctrlb.rs

1#[doc = "Reader of register SEQCTRLB"]
2pub type R = crate::R<u32, super::SEQCTRLB>;
3#[doc = "Writer for register SEQCTRLB"]
4pub type W = crate::W<u32, super::SEQCTRLB>;
5#[doc = "Register SEQCTRLB `reset()`'s with value 0"]
6impl crate::ResetValue for super::SEQCTRLB {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `LENGTHB`"]
14pub type LENGTHB_R = crate::R<u16, u16>;
15#[doc = "Write proxy for field `LENGTHB`"]
16pub struct LENGTHB_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> LENGTHB_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u16) -> &'a mut W {
23        self.w.bits = (self.w.bits & !0x3fff) | ((value as u32) & 0x3fff);
24        self.w
25    }
26}
27#[doc = "Reader of field `DMA0PRESB`"]
28pub type DMA0PRESB_R = crate::R<bool, bool>;
29#[doc = "Write proxy for field `DMA0PRESB`"]
30pub struct DMA0PRESB_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> DMA0PRESB_W<'a> {
34    #[doc = r"Sets the field bit"]
35    #[inline(always)]
36    pub fn set_bit(self) -> &'a mut W {
37        self.bit(true)
38    }
39    #[doc = r"Clears the field bit"]
40    #[inline(always)]
41    pub fn clear_bit(self) -> &'a mut W {
42        self.bit(false)
43    }
44    #[doc = r"Writes raw bits to the field"]
45    #[inline(always)]
46    pub fn bit(self, value: bool) -> &'a mut W {
47        self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28);
48        self.w
49    }
50}
51#[doc = "Reader of field `DMA1PRESB`"]
52pub type DMA1PRESB_R = crate::R<bool, bool>;
53#[doc = "Write proxy for field `DMA1PRESB`"]
54pub struct DMA1PRESB_W<'a> {
55    w: &'a mut W,
56}
57impl<'a> DMA1PRESB_W<'a> {
58    #[doc = r"Sets the field bit"]
59    #[inline(always)]
60    pub fn set_bit(self) -> &'a mut W {
61        self.bit(true)
62    }
63    #[doc = r"Clears the field bit"]
64    #[inline(always)]
65    pub fn clear_bit(self) -> &'a mut W {
66        self.bit(false)
67    }
68    #[doc = r"Writes raw bits to the field"]
69    #[inline(always)]
70    pub fn bit(self, value: bool) -> &'a mut W {
71        self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29);
72        self.w
73    }
74}
75impl R {
76    #[doc = "Bits 0:13 - Buffer Length B in Bytes"]
77    #[inline(always)]
78    pub fn lengthb(&self) -> LENGTHB_R {
79        LENGTHB_R::new((self.bits & 0x3fff) as u16)
80    }
81    #[doc = "Bit 28 - DMA0 Preserve B"]
82    #[inline(always)]
83    pub fn dma0presb(&self) -> DMA0PRESB_R {
84        DMA0PRESB_R::new(((self.bits >> 28) & 0x01) != 0)
85    }
86    #[doc = "Bit 29 - DMA1 Preserve B"]
87    #[inline(always)]
88    pub fn dma1presb(&self) -> DMA1PRESB_R {
89        DMA1PRESB_R::new(((self.bits >> 29) & 0x01) != 0)
90    }
91}
92impl W {
93    #[doc = "Bits 0:13 - Buffer Length B in Bytes"]
94    #[inline(always)]
95    pub fn lengthb(&mut self) -> LENGTHB_W {
96        LENGTHB_W { w: self }
97    }
98    #[doc = "Bit 28 - DMA0 Preserve B"]
99    #[inline(always)]
100    pub fn dma0presb(&mut self) -> DMA0PRESB_W {
101        DMA0PRESB_W { w: self }
102    }
103    #[doc = "Bit 29 - DMA1 Preserve B"]
104    #[inline(always)]
105    pub fn dma1presb(&mut self) -> DMA1PRESB_W {
106        DMA1PRESB_W { w: self }
107    }
108}