cc2650/flash/
fwpwrite3.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7    bits: u32,
8}
9impl super::FWPWRITE3 {
10    #[doc = r" Modifies the contents of the register"]
11    #[inline]
12    pub fn modify<F>(&self, f: F)
13    where
14        for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15    {
16        let bits = self.register.get();
17        let r = R { bits: bits };
18        let mut w = W { bits: bits };
19        f(&r, &mut w);
20        self.register.set(w.bits);
21    }
22    #[doc = r" Reads the contents of the register"]
23    #[inline]
24    pub fn read(&self) -> R {
25        R { bits: self.register.get() }
26    }
27    #[doc = r" Writes to the register"]
28    #[inline]
29    pub fn write<F>(&self, f: F)
30    where
31        F: FnOnce(&mut W) -> &mut W,
32    {
33        let mut w = W::reset_value();
34        f(&mut w);
35        self.register.set(w.bits);
36    }
37    #[doc = r" Writes the reset value to the register"]
38    #[inline]
39    pub fn reset(&self) {
40        self.write(|w| w)
41    }
42}
43impl R {
44    #[doc = r" Value of the register as raw bits"]
45    #[inline]
46    pub fn bits(&self) -> u32 {
47        self.bits
48    }
49}
50impl W {
51    #[doc = r" Reset value of the register"]
52    #[inline]
53    pub fn reset_value() -> W {
54        W { bits: 0 }
55    }
56    #[doc = r" Writes raw bits to the register"]
57    #[inline]
58    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
59        self.bits = bits;
60        self
61    }
62}