atsam4lc4a_pac/twim0/
cr.rs

1#[doc = "Register `CR` writer"]
2pub struct W(crate::W<CR_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<CR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl core::ops::DerefMut for W {
11    #[inline(always)]
12    fn deref_mut(&mut self) -> &mut Self::Target {
13        &mut self.0
14    }
15}
16impl From<crate::W<CR_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<CR_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "Field `MEN` writer - Master Enable"]
23pub type MEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
24#[doc = "Field `MDIS` writer - Master Disable"]
25pub type MDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
26#[doc = "Field `SMEN` writer - SMBus Enable"]
27pub type SMEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
28#[doc = "Field `SMDIS` writer - SMBus Disable"]
29pub type SMDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
30#[doc = "Field `SWRST` writer - Software Reset"]
31pub type SWRST_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
32#[doc = "Field `STOP` writer - Stop the current transfer"]
33pub type STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
34impl W {
35    #[doc = "Bit 0 - Master Enable"]
36    #[inline(always)]
37    #[must_use]
38    pub fn men(&mut self) -> MEN_W<0> {
39        MEN_W::new(self)
40    }
41    #[doc = "Bit 1 - Master Disable"]
42    #[inline(always)]
43    #[must_use]
44    pub fn mdis(&mut self) -> MDIS_W<1> {
45        MDIS_W::new(self)
46    }
47    #[doc = "Bit 4 - SMBus Enable"]
48    #[inline(always)]
49    #[must_use]
50    pub fn smen(&mut self) -> SMEN_W<4> {
51        SMEN_W::new(self)
52    }
53    #[doc = "Bit 5 - SMBus Disable"]
54    #[inline(always)]
55    #[must_use]
56    pub fn smdis(&mut self) -> SMDIS_W<5> {
57        SMDIS_W::new(self)
58    }
59    #[doc = "Bit 7 - Software Reset"]
60    #[inline(always)]
61    #[must_use]
62    pub fn swrst(&mut self) -> SWRST_W<7> {
63        SWRST_W::new(self)
64    }
65    #[doc = "Bit 8 - Stop the current transfer"]
66    #[inline(always)]
67    #[must_use]
68    pub fn stop(&mut self) -> STOP_W<8> {
69        STOP_W::new(self)
70    }
71    #[doc = "Writes raw bits to the register."]
72    #[inline(always)]
73    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
74        self.0.bits(bits);
75        self
76    }
77}
78#[doc = "Control Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr](index.html) module"]
79pub struct CR_SPEC;
80impl crate::RegisterSpec for CR_SPEC {
81    type Ux = u32;
82}
83#[doc = "`write(|w| ..)` method takes [cr::W](W) writer structure"]
84impl crate::Writable for CR_SPEC {
85    type Writer = W;
86    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
87    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
88}
89#[doc = "`reset()` method sets CR to value 0"]
90impl crate::Resettable for CR_SPEC {
91    const RESET_VALUE: Self::Ux = 0;
92}