ra6m2/mmf/
mmsfr.rs

1#[doc = "Register `MMSFR` reader"]
2pub struct R(crate::R<MMSFR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MMSFR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MMSFR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MMSFR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `MMSFR` writer"]
17pub struct W(crate::W<MMSFR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<MMSFR_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<MMSFR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<MMSFR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `MEMMIRADDR` reader - Specifies the memory mirror address.NOTE: A value cannot be set in the low-order 7 bits. These bits are fixed to 0."]
38pub type MEMMIRADDR_R = crate::FieldReader<u16, u16>;
39#[doc = "Field `MEMMIRADDR` writer - Specifies the memory mirror address.NOTE: A value cannot be set in the low-order 7 bits. These bits are fixed to 0."]
40pub type MEMMIRADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MMSFR_SPEC, u16, u16, 16, O>;
41#[doc = "MMSFR Key Code\n\nValue on reset: 0"]
42#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43#[repr(u8)]
44pub enum KEY_AW {
45    #[doc = "219: Writing to the MEMMIRADDR bits are valid, when the KEY bits are written 0xDB."]
46    _0X_DB = 219,
47}
48impl From<KEY_AW> for u8 {
49    #[inline(always)]
50    fn from(variant: KEY_AW) -> Self {
51        variant as _
52    }
53}
54#[doc = "Field `KEY` writer - MMSFR Key Code"]
55pub type KEY_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MMSFR_SPEC, u8, KEY_AW, 8, O>;
56impl<'a, const O: u8> KEY_W<'a, O> {
57    #[doc = "Writing to the MEMMIRADDR bits are valid, when the KEY bits are written 0xDB."]
58    #[inline(always)]
59    pub fn _0x_db(self) -> &'a mut W {
60        self.variant(KEY_AW::_0X_DB)
61    }
62}
63impl R {
64    #[doc = "Bits 7:22 - Specifies the memory mirror address.NOTE: A value cannot be set in the low-order 7 bits. These bits are fixed to 0."]
65    #[inline(always)]
66    pub fn memmiraddr(&self) -> MEMMIRADDR_R {
67        MEMMIRADDR_R::new(((self.bits >> 7) & 0xffff) as u16)
68    }
69}
70impl W {
71    #[doc = "Bits 7:22 - Specifies the memory mirror address.NOTE: A value cannot be set in the low-order 7 bits. These bits are fixed to 0."]
72    #[inline(always)]
73    #[must_use]
74    pub fn memmiraddr(&mut self) -> MEMMIRADDR_W<7> {
75        MEMMIRADDR_W::new(self)
76    }
77    #[doc = "Bits 24:31 - MMSFR Key Code"]
78    #[inline(always)]
79    #[must_use]
80    pub fn key(&mut self) -> KEY_W<24> {
81        KEY_W::new(self)
82    }
83    #[doc = "Writes raw bits to the register."]
84    #[inline(always)]
85    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
86        self.0.bits(bits);
87        self
88    }
89}
90#[doc = "MemMirror Special Function Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mmsfr](index.html) module"]
91pub struct MMSFR_SPEC;
92impl crate::RegisterSpec for MMSFR_SPEC {
93    type Ux = u32;
94}
95#[doc = "`read()` method returns [mmsfr::R](R) reader structure"]
96impl crate::Readable for MMSFR_SPEC {
97    type Reader = R;
98}
99#[doc = "`write(|w| ..)` method takes [mmsfr::W](W) writer structure"]
100impl crate::Writable for MMSFR_SPEC {
101    type Writer = W;
102    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
103    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
104}
105#[doc = "`reset()` method sets MMSFR to value 0"]
106impl crate::Resettable for MMSFR_SPEC {
107    const RESET_VALUE: Self::Ux = 0;
108}