atsamd21j/sercom0/i2cm/
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 `SMEN` reader - Smart Mode Enable"]
6pub type SmenR = crate::BitReader;
7#[doc = "Field `SMEN` writer - Smart Mode Enable"]
8pub type SmenW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `QCEN` reader - Quick Command Enable"]
10pub type QcenR = crate::BitReader;
11#[doc = "Field `QCEN` writer - Quick Command Enable"]
12pub type QcenW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `CMD` writer - Command"]
14pub type CmdW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
15#[doc = "Field `ACKACT` reader - Acknowledge Action"]
16pub type AckactR = crate::BitReader;
17#[doc = "Field `ACKACT` writer - Acknowledge Action"]
18pub type AckactW<'a, REG> = crate::BitWriter<'a, REG>;
19impl R {
20    #[doc = "Bit 8 - Smart Mode Enable"]
21    #[inline(always)]
22    pub fn smen(&self) -> SmenR {
23        SmenR::new(((self.bits >> 8) & 1) != 0)
24    }
25    #[doc = "Bit 9 - Quick Command Enable"]
26    #[inline(always)]
27    pub fn qcen(&self) -> QcenR {
28        QcenR::new(((self.bits >> 9) & 1) != 0)
29    }
30    #[doc = "Bit 18 - Acknowledge Action"]
31    #[inline(always)]
32    pub fn ackact(&self) -> AckactR {
33        AckactR::new(((self.bits >> 18) & 1) != 0)
34    }
35}
36impl W {
37    #[doc = "Bit 8 - Smart Mode Enable"]
38    #[inline(always)]
39    #[must_use]
40    pub fn smen(&mut self) -> SmenW<CtrlbSpec> {
41        SmenW::new(self, 8)
42    }
43    #[doc = "Bit 9 - Quick Command Enable"]
44    #[inline(always)]
45    #[must_use]
46    pub fn qcen(&mut self) -> QcenW<CtrlbSpec> {
47        QcenW::new(self, 9)
48    }
49    #[doc = "Bits 16:17 - Command"]
50    #[inline(always)]
51    #[must_use]
52    pub fn cmd(&mut self) -> CmdW<CtrlbSpec> {
53        CmdW::new(self, 16)
54    }
55    #[doc = "Bit 18 - Acknowledge Action"]
56    #[inline(always)]
57    #[must_use]
58    pub fn ackact(&mut self) -> AckactW<CtrlbSpec> {
59        AckactW::new(self, 18)
60    }
61}
62#[doc = "I2CM 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)."]
63pub struct CtrlbSpec;
64impl crate::RegisterSpec for CtrlbSpec {
65    type Ux = u32;
66}
67#[doc = "`read()` method returns [`ctrlb::R`](R) reader structure"]
68impl crate::Readable for CtrlbSpec {}
69#[doc = "`write(|w| ..)` method takes [`ctrlb::W`](W) writer structure"]
70impl crate::Writable for CtrlbSpec {
71    type Safety = crate::Unsafe;
72    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
73    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
74}
75#[doc = "`reset()` method sets CTRLB to value 0"]
76impl crate::Resettable for CtrlbSpec {
77    const RESET_VALUE: u32 = 0;
78}