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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
#[doc = "Reader of register LDODPCTL"] pub type R = crate::R<u32, super::LDODPCTL>; #[doc = "Writer for register LDODPCTL"] pub type W = crate::W<u32, super::LDODPCTL>; #[doc = "Register LDODPCTL `reset()`'s with value 0"] impl crate::ResetValue for super::LDODPCTL { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0 } } #[doc = "LDO Output Voltage\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum VLDO_A { #[doc = "18: 0.90 V"] _0_90V, #[doc = "19: 0.95 V"] _0_95V, #[doc = "20: 1.00 V"] _1_00V, #[doc = "21: 1.05 V"] _1_05V, #[doc = "22: 1.10 V"] _1_10V, #[doc = "23: 1.15 V"] _1_15V, #[doc = "24: 1.20 V"] _1_20V, #[doc = "25: 1.25 V"] _1_25V, #[doc = "26: 1.30 V"] _1_30V, #[doc = "27: 1.35 V"] _1_35V, } impl From<VLDO_A> for u8 { #[inline(always)] fn from(variant: VLDO_A) -> Self { match variant { VLDO_A::_0_90V => 18, VLDO_A::_0_95V => 19, VLDO_A::_1_00V => 20, VLDO_A::_1_05V => 21, VLDO_A::_1_10V => 22, VLDO_A::_1_15V => 23, VLDO_A::_1_20V => 24, VLDO_A::_1_25V => 25, VLDO_A::_1_30V => 26, VLDO_A::_1_35V => 27, } } } #[doc = "Reader of field `VLDO`"] pub type VLDO_R = crate::R<u8, VLDO_A>; impl VLDO_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u8, VLDO_A> { use crate::Variant::*; match self.bits { 18 => Val(VLDO_A::_0_90V), 19 => Val(VLDO_A::_0_95V), 20 => Val(VLDO_A::_1_00V), 21 => Val(VLDO_A::_1_05V), 22 => Val(VLDO_A::_1_10V), 23 => Val(VLDO_A::_1_15V), 24 => Val(VLDO_A::_1_20V), 25 => Val(VLDO_A::_1_25V), 26 => Val(VLDO_A::_1_30V), 27 => Val(VLDO_A::_1_35V), i => Res(i), } } #[doc = "Checks if the value of the field is `_0_90V`"] #[inline(always)] pub fn is_0_90v(&self) -> bool { *self == VLDO_A::_0_90V } #[doc = "Checks if the value of the field is `_0_95V`"] #[inline(always)] pub fn is_0_95v(&self) -> bool { *self == VLDO_A::_0_95V } #[doc = "Checks if the value of the field is `_1_00V`"] #[inline(always)] pub fn is_1_00v(&self) -> bool { *self == VLDO_A::_1_00V } #[doc = "Checks if the value of the field is `_1_05V`"] #[inline(always)] pub fn is_1_05v(&self) -> bool { *self == VLDO_A::_1_05V } #[doc = "Checks if the value of the field is `_1_10V`"] #[inline(always)] pub fn is_1_10v(&self) -> bool { *self == VLDO_A::_1_10V } #[doc = "Checks if the value of the field is `_1_15V`"] #[inline(always)] pub fn is_1_15v(&self) -> bool { *self == VLDO_A::_1_15V } #[doc = "Checks if the value of the field is `_1_20V`"] #[inline(always)] pub fn is_1_20v(&self) -> bool { *self == VLDO_A::_1_20V } #[doc = "Checks if the value of the field is `_1_25V`"] #[inline(always)] pub fn is_1_25v(&self) -> bool { *self == VLDO_A::_1_25V } #[doc = "Checks if the value of the field is `_1_30V`"] #[inline(always)] pub fn is_1_30v(&self) -> bool { *self == VLDO_A::_1_30V } #[doc = "Checks if the value of the field is `_1_35V`"] #[inline(always)] pub fn is_1_35v(&self) -> bool { *self == VLDO_A::_1_35V } } #[doc = "Write proxy for field `VLDO`"] pub struct VLDO_W<'a> { w: &'a mut W, } impl<'a> VLDO_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VLDO_A) -> &'a mut W { unsafe { self.bits(variant.into()) } } #[doc = "0.90 V"] #[inline(always)] pub fn _0_90v(self) -> &'a mut W { self.variant(VLDO_A::_0_90V) } #[doc = "0.95 V"] #[inline(always)] pub fn _0_95v(self) -> &'a mut W { self.variant(VLDO_A::_0_95V) } #[doc = "1.00 V"] #[inline(always)] pub fn _1_00v(self) -> &'a mut W { self.variant(VLDO_A::_1_00V) } #[doc = "1.05 V"] #[inline(always)] pub fn _1_05v(self) -> &'a mut W { self.variant(VLDO_A::_1_05V) } #[doc = "1.10 V"] #[inline(always)] pub fn _1_10v(self) -> &'a mut W { self.variant(VLDO_A::_1_10V) } #[doc = "1.15 V"] #[inline(always)] pub fn _1_15v(self) -> &'a mut W { self.variant(VLDO_A::_1_15V) } #[doc = "1.20 V"] #[inline(always)] pub fn _1_20v(self) -> &'a mut W { self.variant(VLDO_A::_1_20V) } #[doc = "1.25 V"] #[inline(always)] pub fn _1_25v(self) -> &'a mut W { self.variant(VLDO_A::_1_25V) } #[doc = "1.30 V"] #[inline(always)] pub fn _1_30v(self) -> &'a mut W { self.variant(VLDO_A::_1_30V) } #[doc = "1.35 V"] #[inline(always)] pub fn _1_35v(self) -> &'a mut W { self.variant(VLDO_A::_1_35V) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); self.w } } #[doc = "Reader of field `VADJEN`"] pub type VADJEN_R = crate::R<bool, bool>; #[doc = "Write proxy for field `VADJEN`"] pub struct VADJEN_W<'a> { w: &'a mut W, } impl<'a> VADJEN_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); self.w } } impl R { #[doc = "Bits 0:7 - LDO Output Voltage"] #[inline(always)] pub fn vldo(&self) -> VLDO_R { VLDO_R::new((self.bits & 0xff) as u8) } #[doc = "Bit 31 - Voltage Adjust Enable"] #[inline(always)] pub fn vadjen(&self) -> VADJEN_R { VADJEN_R::new(((self.bits >> 31) & 0x01) != 0) } } impl W { #[doc = "Bits 0:7 - LDO Output Voltage"] #[inline(always)] pub fn vldo(&mut self) -> VLDO_W { VLDO_W { w: self } } #[doc = "Bit 31 - Voltage Adjust Enable"] #[inline(always)] pub fn vadjen(&mut self) -> VADJEN_W { VADJEN_W { w: self } } }