cc2650/event/
udmach20bsel.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5impl super::UDMACH20BSEL {
6    #[doc = r" Reads the contents of the register"]
7    #[inline]
8    pub fn read(&self) -> R {
9        R { bits: self.register.get() }
10    }
11}
12#[doc = "Possible values of the field `EV`"]
13#[derive(Clone, Copy, Debug, PartialEq)]
14pub enum EVR {
15    #[doc = "Always inactive"]
16    NONE,
17    #[doc = r" Reserved"]
18    _Reserved(u32),
19}
20impl EVR {
21    #[doc = r" Value of the field as raw bits"]
22    #[inline]
23    pub fn bits(&self) -> u32 {
24        match *self {
25            EVR::NONE => 0,
26            EVR::_Reserved(bits) => bits,
27        }
28    }
29    #[allow(missing_docs)]
30    #[doc(hidden)]
31    #[inline]
32    pub fn _from(value: u32) -> EVR {
33        match value {
34            0 => EVR::NONE,
35            i => EVR::_Reserved(i),
36        }
37    }
38    #[doc = "Checks if the value of the field is `NONE`"]
39    #[inline]
40    pub fn is_none(&self) -> bool {
41        *self == EVR::NONE
42    }
43}
44impl R {
45    #[doc = r" Value of the register as raw bits"]
46    #[inline]
47    pub fn bits(&self) -> u32 {
48        self.bits
49    }
50    #[doc = "Bits 0:31 - Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
51    #[inline]
52    pub fn ev(&self) -> EVR {
53        EVR::_from({
54            const MASK: u32 = 4294967295;
55            const OFFSET: u8 = 0;
56            ((self.bits >> OFFSET) & MASK as u32) as u32
57        })
58    }
59}