1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
#[doc = r" Value read from the register"] pub struct R { bits: u32, } impl super::RFCMODEHWOPT { #[doc = r" Reads the contents of the register"] #[inline] pub fn read(&self) -> R { R { bits: self.register.get() } } } #[doc = r" Value of the field"] pub struct RESERVED8R { bits: u32, } impl RESERVED8R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u32 { self.bits } } #[doc = "Possible values of the field `AVAIL`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum AVAILR { #[doc = "Mode 7 permitted"] MODE7, #[doc = "Mode 6 permitted"] MODE6, #[doc = "Mode 5 permitted"] MODE5, #[doc = "Mode 4 permitted"] MODE4, #[doc = "Mode 3 permitted"] MODE3, #[doc = "Mode 2 permitted"] MODE2, #[doc = "Mode 1 permitted"] MODE1, #[doc = "Mode 0 permitted"] MODE0, #[doc = r" Reserved"] _Reserved(u8), } impl AVAILR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { AVAILR::MODE7 => 128, AVAILR::MODE6 => 64, AVAILR::MODE5 => 32, AVAILR::MODE4 => 16, AVAILR::MODE3 => 8, AVAILR::MODE2 => 4, AVAILR::MODE1 => 2, AVAILR::MODE0 => 1, AVAILR::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> AVAILR { match value { 128 => AVAILR::MODE7, 64 => AVAILR::MODE6, 32 => AVAILR::MODE5, 16 => AVAILR::MODE4, 8 => AVAILR::MODE3, 4 => AVAILR::MODE2, 2 => AVAILR::MODE1, 1 => AVAILR::MODE0, i => AVAILR::_Reserved(i), } } #[doc = "Checks if the value of the field is `MODE7`"] #[inline] pub fn is_mode7(&self) -> bool { *self == AVAILR::MODE7 } #[doc = "Checks if the value of the field is `MODE6`"] #[inline] pub fn is_mode6(&self) -> bool { *self == AVAILR::MODE6 } #[doc = "Checks if the value of the field is `MODE5`"] #[inline] pub fn is_mode5(&self) -> bool { *self == AVAILR::MODE5 } #[doc = "Checks if the value of the field is `MODE4`"] #[inline] pub fn is_mode4(&self) -> bool { *self == AVAILR::MODE4 } #[doc = "Checks if the value of the field is `MODE3`"] #[inline] pub fn is_mode3(&self) -> bool { *self == AVAILR::MODE3 } #[doc = "Checks if the value of the field is `MODE2`"] #[inline] pub fn is_mode2(&self) -> bool { *self == AVAILR::MODE2 } #[doc = "Checks if the value of the field is `MODE1`"] #[inline] pub fn is_mode1(&self) -> bool { *self == AVAILR::MODE1 } #[doc = "Checks if the value of the field is `MODE0`"] #[inline] pub fn is_mode0(&self) -> bool { *self == AVAILR::MODE0 } } impl R { #[doc = r" Value of the register as raw bits"] #[inline] pub fn bits(&self) -> u32 { self.bits } #[doc = "Bits 8:31 - Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."] #[inline] pub fn reserved8(&self) -> RESERVED8R { let bits = { const MASK: u32 = 16777215; const OFFSET: u8 = 8; ((self.bits >> OFFSET) & MASK as u32) as u32 }; RESERVED8R { bits } } #[doc = "Bits 0:7 - Permitted RFC modes. More than one mode can be permitted."] #[inline] pub fn avail(&self) -> AVAILR { AVAILR::_from({ const MASK: u8 = 255; const OFFSET: u8 = 0; ((self.bits >> OFFSET) & MASK as u32) as u8 }) } }