stm32f2/stm32f215/crc/
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 = "reset bit\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq)]
24pub enum RESET_AW {
25    #[doc = "1: Resets the CRC calculation unit and sets the data register to 0xFFFF FFFF"]
26    Reset = 1,
27}
28impl From<RESET_AW> for bool {
29    #[inline(always)]
30    fn from(variant: RESET_AW) -> Self {
31        variant as u8 != 0
32    }
33}
34#[doc = "Field `RESET` writer - reset bit"]
35pub type RESET_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, RESET_AW, O>;
36impl<'a, const O: u8> RESET_W<'a, O> {
37    #[doc = "Resets the CRC calculation unit and sets the data register to 0xFFFF FFFF"]
38    #[inline(always)]
39    pub fn reset(self) -> &'a mut W {
40        self.variant(RESET_AW::Reset)
41    }
42}
43impl W {
44    #[doc = "Bit 0 - reset bit"]
45    #[inline(always)]
46    pub fn reset(&mut self) -> RESET_W<0> {
47        RESET_W::new(self)
48    }
49    #[doc = "Writes raw bits to the register."]
50    #[inline(always)]
51    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
52        self.0.bits(bits);
53        self
54    }
55}
56#[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"]
57pub struct CR_SPEC;
58impl crate::RegisterSpec for CR_SPEC {
59    type Ux = u32;
60}
61#[doc = "`write(|w| ..)` method takes [cr::W](W) writer structure"]
62impl crate::Writable for CR_SPEC {
63    type Writer = W;
64}
65#[doc = "`reset()` method sets CR to value 0"]
66impl crate::Resettable for CR_SPEC {
67    #[inline(always)]
68    fn reset_value() -> Self::Ux {
69        0
70    }
71}