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 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
#[doc = "Reader of register FCR"] pub type R = crate::R<u32, super::FCR>; #[doc = "Writer for register FCR"] pub type W = crate::W<u32, super::FCR>; #[doc = "Register FCR `reset()`'s with value 0x21"] impl crate::ResetValue for super::FCR { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0x21 } } #[doc = "FIFO error interrupt enable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FEIE_A { #[doc = "0: FE interrupt disabled"] DISABLED = 0, #[doc = "1: FE interrupt enabled"] ENABLED = 1, } impl From<FEIE_A> for bool { #[inline(always)] fn from(variant: FEIE_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `FEIE`"] pub type FEIE_R = crate::R<bool, FEIE_A>; impl FEIE_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FEIE_A { match self.bits { false => FEIE_A::DISABLED, true => FEIE_A::ENABLED, } } #[doc = "Checks if the value of the field is `DISABLED`"] #[inline(always)] pub fn is_disabled(&self) -> bool { *self == FEIE_A::DISABLED } #[doc = "Checks if the value of the field is `ENABLED`"] #[inline(always)] pub fn is_enabled(&self) -> bool { *self == FEIE_A::ENABLED } } #[doc = "Write proxy for field `FEIE`"] pub struct FEIE_W<'a> { w: &'a mut W, } impl<'a> FEIE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FEIE_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "FE interrupt disabled"] #[inline(always)] pub fn disabled(self) -> &'a mut W { self.variant(FEIE_A::DISABLED) } #[doc = "FE interrupt enabled"] #[inline(always)] pub fn enabled(self) -> &'a mut W { self.variant(FEIE_A::ENABLED) } #[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 << 7)) | (((value as u32) & 0x01) << 7); self.w } } #[doc = "FIFO status\n\nValue on reset: 4"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum FS_A { #[doc = "0: 0 < fifo_level < 1/4"] QUARTER1 = 0, #[doc = "1: 1/4 <= fifo_level < 1/2"] QUARTER2 = 1, #[doc = "2: 1/2 <= fifo_level < 3/4"] QUARTER3 = 2, #[doc = "3: 3/4 <= fifo_level < full"] QUARTER4 = 3, #[doc = "4: FIFO is empty"] EMPTY = 4, #[doc = "5: FIFO is full"] FULL = 5, } impl From<FS_A> for u8 { #[inline(always)] fn from(variant: FS_A) -> Self { variant as _ } } #[doc = "Reader of field `FS`"] pub type FS_R = crate::R<u8, FS_A>; impl FS_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u8, FS_A> { use crate::Variant::*; match self.bits { 0 => Val(FS_A::QUARTER1), 1 => Val(FS_A::QUARTER2), 2 => Val(FS_A::QUARTER3), 3 => Val(FS_A::QUARTER4), 4 => Val(FS_A::EMPTY), 5 => Val(FS_A::FULL), i => Res(i), } } #[doc = "Checks if the value of the field is `QUARTER1`"] #[inline(always)] pub fn is_quarter1(&self) -> bool { *self == FS_A::QUARTER1 } #[doc = "Checks if the value of the field is `QUARTER2`"] #[inline(always)] pub fn is_quarter2(&self) -> bool { *self == FS_A::QUARTER2 } #[doc = "Checks if the value of the field is `QUARTER3`"] #[inline(always)] pub fn is_quarter3(&self) -> bool { *self == FS_A::QUARTER3 } #[doc = "Checks if the value of the field is `QUARTER4`"] #[inline(always)] pub fn is_quarter4(&self) -> bool { *self == FS_A::QUARTER4 } #[doc = "Checks if the value of the field is `EMPTY`"] #[inline(always)] pub fn is_empty(&self) -> bool { *self == FS_A::EMPTY } #[doc = "Checks if the value of the field is `FULL`"] #[inline(always)] pub fn is_full(&self) -> bool { *self == FS_A::FULL } } #[doc = "Direct mode disable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum DMDIS_A { #[doc = "0: Direct mode is enabled"] ENABLED = 0, #[doc = "1: Direct mode is disabled"] DISABLED = 1, } impl From<DMDIS_A> for bool { #[inline(always)] fn from(variant: DMDIS_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `DMDIS`"] pub type DMDIS_R = crate::R<bool, DMDIS_A>; impl DMDIS_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DMDIS_A { match self.bits { false => DMDIS_A::ENABLED, true => DMDIS_A::DISABLED, } } #[doc = "Checks if the value of the field is `ENABLED`"] #[inline(always)] pub fn is_enabled(&self) -> bool { *self == DMDIS_A::ENABLED } #[doc = "Checks if the value of the field is `DISABLED`"] #[inline(always)] pub fn is_disabled(&self) -> bool { *self == DMDIS_A::DISABLED } } #[doc = "Write proxy for field `DMDIS`"] pub struct DMDIS_W<'a> { w: &'a mut W, } impl<'a> DMDIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DMDIS_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Direct mode is enabled"] #[inline(always)] pub fn enabled(self) -> &'a mut W { self.variant(DMDIS_A::ENABLED) } #[doc = "Direct mode is disabled"] #[inline(always)] pub fn disabled(self) -> &'a mut W { self.variant(DMDIS_A::DISABLED) } #[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 << 2)) | (((value as u32) & 0x01) << 2); self.w } } #[doc = "FIFO threshold selection\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum FTH_A { #[doc = "0: 1/4 full FIFO"] QUARTER = 0, #[doc = "1: 1/2 full FIFO"] HALF = 1, #[doc = "2: 3/4 full FIFO"] THREEQUARTERS = 2, #[doc = "3: Full FIFO"] FULL = 3, } impl From<FTH_A> for u8 { #[inline(always)] fn from(variant: FTH_A) -> Self { variant as _ } } #[doc = "Reader of field `FTH`"] pub type FTH_R = crate::R<u8, FTH_A>; impl FTH_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FTH_A { match self.bits { 0 => FTH_A::QUARTER, 1 => FTH_A::HALF, 2 => FTH_A::THREEQUARTERS, 3 => FTH_A::FULL, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `QUARTER`"] #[inline(always)] pub fn is_quarter(&self) -> bool { *self == FTH_A::QUARTER } #[doc = "Checks if the value of the field is `HALF`"] #[inline(always)] pub fn is_half(&self) -> bool { *self == FTH_A::HALF } #[doc = "Checks if the value of the field is `THREEQUARTERS`"] #[inline(always)] pub fn is_three_quarters(&self) -> bool { *self == FTH_A::THREEQUARTERS } #[doc = "Checks if the value of the field is `FULL`"] #[inline(always)] pub fn is_full(&self) -> bool { *self == FTH_A::FULL } } #[doc = "Write proxy for field `FTH`"] pub struct FTH_W<'a> { w: &'a mut W, } impl<'a> FTH_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FTH_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "1/4 full FIFO"] #[inline(always)] pub fn quarter(self) -> &'a mut W { self.variant(FTH_A::QUARTER) } #[doc = "1/2 full FIFO"] #[inline(always)] pub fn half(self) -> &'a mut W { self.variant(FTH_A::HALF) } #[doc = "3/4 full FIFO"] #[inline(always)] pub fn three_quarters(self) -> &'a mut W { self.variant(FTH_A::THREEQUARTERS) } #[doc = "Full FIFO"] #[inline(always)] pub fn full(self) -> &'a mut W { self.variant(FTH_A::FULL) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); self.w } } impl R { #[doc = "Bit 7 - FIFO error interrupt enable"] #[inline(always)] pub fn feie(&self) -> FEIE_R { FEIE_R::new(((self.bits >> 7) & 0x01) != 0) } #[doc = "Bits 3:5 - FIFO status"] #[inline(always)] pub fn fs(&self) -> FS_R { FS_R::new(((self.bits >> 3) & 0x07) as u8) } #[doc = "Bit 2 - Direct mode disable"] #[inline(always)] pub fn dmdis(&self) -> DMDIS_R { DMDIS_R::new(((self.bits >> 2) & 0x01) != 0) } #[doc = "Bits 0:1 - FIFO threshold selection"] #[inline(always)] pub fn fth(&self) -> FTH_R { FTH_R::new((self.bits & 0x03) as u8) } } impl W { #[doc = "Bit 7 - FIFO error interrupt enable"] #[inline(always)] pub fn feie(&mut self) -> FEIE_W { FEIE_W { w: self } } #[doc = "Bit 2 - Direct mode disable"] #[inline(always)] pub fn dmdis(&mut self) -> DMDIS_W { DMDIS_W { w: self } } #[doc = "Bits 0:1 - FIFO threshold selection"] #[inline(always)] pub fn fth(&mut self) -> FTH_W { FTH_W { w: self } } }