atsamd51p/aes/
ctrlb.rs

1#[doc = "Register `CTRLB` reader"]
2pub type R = crate::R<CtrlbSpec>;
3#[doc = "Register `CTRLB` writer"]
4pub type W = crate::W<CtrlbSpec>;
5#[doc = "Field `START` reader - Start Encryption/Decryption"]
6pub type StartR = crate::BitReader;
7#[doc = "Field `START` writer - Start Encryption/Decryption"]
8pub type StartW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `NEWMSG` reader - New message"]
10pub type NewmsgR = crate::BitReader;
11#[doc = "Field `NEWMSG` writer - New message"]
12pub type NewmsgW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `EOM` reader - End of message"]
14pub type EomR = crate::BitReader;
15#[doc = "Field `EOM` writer - End of message"]
16pub type EomW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `GFMUL` reader - GF Multiplication"]
18pub type GfmulR = crate::BitReader;
19#[doc = "Field `GFMUL` writer - GF Multiplication"]
20pub type GfmulW<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bit 0 - Start Encryption/Decryption"]
23    #[inline(always)]
24    pub fn start(&self) -> StartR {
25        StartR::new((self.bits & 1) != 0)
26    }
27    #[doc = "Bit 1 - New message"]
28    #[inline(always)]
29    pub fn newmsg(&self) -> NewmsgR {
30        NewmsgR::new(((self.bits >> 1) & 1) != 0)
31    }
32    #[doc = "Bit 2 - End of message"]
33    #[inline(always)]
34    pub fn eom(&self) -> EomR {
35        EomR::new(((self.bits >> 2) & 1) != 0)
36    }
37    #[doc = "Bit 3 - GF Multiplication"]
38    #[inline(always)]
39    pub fn gfmul(&self) -> GfmulR {
40        GfmulR::new(((self.bits >> 3) & 1) != 0)
41    }
42}
43impl W {
44    #[doc = "Bit 0 - Start Encryption/Decryption"]
45    #[inline(always)]
46    #[must_use]
47    pub fn start(&mut self) -> StartW<CtrlbSpec> {
48        StartW::new(self, 0)
49    }
50    #[doc = "Bit 1 - New message"]
51    #[inline(always)]
52    #[must_use]
53    pub fn newmsg(&mut self) -> NewmsgW<CtrlbSpec> {
54        NewmsgW::new(self, 1)
55    }
56    #[doc = "Bit 2 - End of message"]
57    #[inline(always)]
58    #[must_use]
59    pub fn eom(&mut self) -> EomW<CtrlbSpec> {
60        EomW::new(self, 2)
61    }
62    #[doc = "Bit 3 - GF Multiplication"]
63    #[inline(always)]
64    #[must_use]
65    pub fn gfmul(&mut self) -> GfmulW<CtrlbSpec> {
66        GfmulW::new(self, 3)
67    }
68}
69#[doc = "Control B\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrlb::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrlb::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
70pub struct CtrlbSpec;
71impl crate::RegisterSpec for CtrlbSpec {
72    type Ux = u8;
73}
74#[doc = "`read()` method returns [`ctrlb::R`](R) reader structure"]
75impl crate::Readable for CtrlbSpec {}
76#[doc = "`write(|w| ..)` method takes [`ctrlb::W`](W) writer structure"]
77impl crate::Writable for CtrlbSpec {
78    type Safety = crate::Unsafe;
79    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
80    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
81}
82#[doc = "`reset()` method sets CTRLB to value 0"]
83impl crate::Resettable for CtrlbSpec {
84    const RESET_VALUE: u8 = 0;
85}