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 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482
#[doc = "Reader of register TIMING"] pub type R = crate::R<u32, super::TIMING>; #[doc = "Writer for register TIMING"] pub type W = crate::W<u32, super::TIMING>; #[doc = "Register TIMING `reset()`'s with value 0"] impl crate::ResetValue for super::TIMING { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0 } } #[doc = "TX Frame Start Delay\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum TXDELAY_A { #[doc = "0: Disable - TXDELAY in USARTn_CTRL can be used for legacy"] DISABLE = 0, #[doc = "1: Start of transmission is delayed for 1 baud-times"] ONE = 1, #[doc = "2: Start of transmission is delayed for 2 baud-times"] TWO = 2, #[doc = "3: Start of transmission is delayed for 3 baud-times"] THREE = 3, #[doc = "4: Start of transmission is delayed for 7 baud-times"] SEVEN = 4, #[doc = "5: Start of transmission is delayed for TCMPVAL0 baud-times"] TCMP0 = 5, #[doc = "6: Start of transmission is delayed for TCMPVAL1 baud-times"] TCMP1 = 6, #[doc = "7: Start of transmission is delayed for TCMPVAL2 baud-times"] TCMP2 = 7, } impl From<TXDELAY_A> for u8 { #[inline(always)] fn from(variant: TXDELAY_A) -> Self { variant as _ } } #[doc = "Reader of field `TXDELAY`"] pub type TXDELAY_R = crate::R<u8, TXDELAY_A>; impl TXDELAY_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TXDELAY_A { match self.bits { 0 => TXDELAY_A::DISABLE, 1 => TXDELAY_A::ONE, 2 => TXDELAY_A::TWO, 3 => TXDELAY_A::THREE, 4 => TXDELAY_A::SEVEN, 5 => TXDELAY_A::TCMP0, 6 => TXDELAY_A::TCMP1, 7 => TXDELAY_A::TCMP2, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `DISABLE`"] #[inline(always)] pub fn is_disable(&self) -> bool { *self == TXDELAY_A::DISABLE } #[doc = "Checks if the value of the field is `ONE`"] #[inline(always)] pub fn is_one(&self) -> bool { *self == TXDELAY_A::ONE } #[doc = "Checks if the value of the field is `TWO`"] #[inline(always)] pub fn is_two(&self) -> bool { *self == TXDELAY_A::TWO } #[doc = "Checks if the value of the field is `THREE`"] #[inline(always)] pub fn is_three(&self) -> bool { *self == TXDELAY_A::THREE } #[doc = "Checks if the value of the field is `SEVEN`"] #[inline(always)] pub fn is_seven(&self) -> bool { *self == TXDELAY_A::SEVEN } #[doc = "Checks if the value of the field is `TCMP0`"] #[inline(always)] pub fn is_tcmp0(&self) -> bool { *self == TXDELAY_A::TCMP0 } #[doc = "Checks if the value of the field is `TCMP1`"] #[inline(always)] pub fn is_tcmp1(&self) -> bool { *self == TXDELAY_A::TCMP1 } #[doc = "Checks if the value of the field is `TCMP2`"] #[inline(always)] pub fn is_tcmp2(&self) -> bool { *self == TXDELAY_A::TCMP2 } } #[doc = "Write proxy for field `TXDELAY`"] pub struct TXDELAY_W<'a> { w: &'a mut W, } impl<'a> TXDELAY_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TXDELAY_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "Disable - TXDELAY in USARTn_CTRL can be used for legacy"] #[inline(always)] pub fn disable(self) -> &'a mut W { self.variant(TXDELAY_A::DISABLE) } #[doc = "Start of transmission is delayed for 1 baud-times"] #[inline(always)] pub fn one(self) -> &'a mut W { self.variant(TXDELAY_A::ONE) } #[doc = "Start of transmission is delayed for 2 baud-times"] #[inline(always)] pub fn two(self) -> &'a mut W { self.variant(TXDELAY_A::TWO) } #[doc = "Start of transmission is delayed for 3 baud-times"] #[inline(always)] pub fn three(self) -> &'a mut W { self.variant(TXDELAY_A::THREE) } #[doc = "Start of transmission is delayed for 7 baud-times"] #[inline(always)] pub fn seven(self) -> &'a mut W { self.variant(TXDELAY_A::SEVEN) } #[doc = "Start of transmission is delayed for TCMPVAL0 baud-times"] #[inline(always)] pub fn tcmp0(self) -> &'a mut W { self.variant(TXDELAY_A::TCMP0) } #[doc = "Start of transmission is delayed for TCMPVAL1 baud-times"] #[inline(always)] pub fn tcmp1(self) -> &'a mut W { self.variant(TXDELAY_A::TCMP1) } #[doc = "Start of transmission is delayed for TCMPVAL2 baud-times"] #[inline(always)] pub fn tcmp2(self) -> &'a mut W { self.variant(TXDELAY_A::TCMP2) } #[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 & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); self.w } } #[doc = "Chip Select Setup\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum CSSETUP_A { #[doc = "0: CS is not asserted before start of transmission"] ZERO = 0, #[doc = "1: CS is asserted for 1 baud-times before start of transmission"] ONE = 1, #[doc = "2: CS is asserted for 2 baud-times before start of transmission"] TWO = 2, #[doc = "3: CS is asserted for 3 baud-times before start of transmission"] THREE = 3, #[doc = "4: CS is asserted for 7 baud-times before start of transmission"] SEVEN = 4, #[doc = "5: CS is asserted before the start of transmission for TCMPVAL0 baud-times"] TCMP0 = 5, #[doc = "6: CS is asserted before the start of transmission for TCMPVAL1 baud-times"] TCMP1 = 6, #[doc = "7: CS is asserted before the start of transmission for TCMPVAL2 baud-times"] TCMP2 = 7, } impl From<CSSETUP_A> for u8 { #[inline(always)] fn from(variant: CSSETUP_A) -> Self { variant as _ } } #[doc = "Reader of field `CSSETUP`"] pub type CSSETUP_R = crate::R<u8, CSSETUP_A>; impl CSSETUP_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CSSETUP_A { match self.bits { 0 => CSSETUP_A::ZERO, 1 => CSSETUP_A::ONE, 2 => CSSETUP_A::TWO, 3 => CSSETUP_A::THREE, 4 => CSSETUP_A::SEVEN, 5 => CSSETUP_A::TCMP0, 6 => CSSETUP_A::TCMP1, 7 => CSSETUP_A::TCMP2, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `ZERO`"] #[inline(always)] pub fn is_zero(&self) -> bool { *self == CSSETUP_A::ZERO } #[doc = "Checks if the value of the field is `ONE`"] #[inline(always)] pub fn is_one(&self) -> bool { *self == CSSETUP_A::ONE } #[doc = "Checks if the value of the field is `TWO`"] #[inline(always)] pub fn is_two(&self) -> bool { *self == CSSETUP_A::TWO } #[doc = "Checks if the value of the field is `THREE`"] #[inline(always)] pub fn is_three(&self) -> bool { *self == CSSETUP_A::THREE } #[doc = "Checks if the value of the field is `SEVEN`"] #[inline(always)] pub fn is_seven(&self) -> bool { *self == CSSETUP_A::SEVEN } #[doc = "Checks if the value of the field is `TCMP0`"] #[inline(always)] pub fn is_tcmp0(&self) -> bool { *self == CSSETUP_A::TCMP0 } #[doc = "Checks if the value of the field is `TCMP1`"] #[inline(always)] pub fn is_tcmp1(&self) -> bool { *self == CSSETUP_A::TCMP1 } #[doc = "Checks if the value of the field is `TCMP2`"] #[inline(always)] pub fn is_tcmp2(&self) -> bool { *self == CSSETUP_A::TCMP2 } } #[doc = "Write proxy for field `CSSETUP`"] pub struct CSSETUP_W<'a> { w: &'a mut W, } impl<'a> CSSETUP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CSSETUP_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "CS is not asserted before start of transmission"] #[inline(always)] pub fn zero(self) -> &'a mut W { self.variant(CSSETUP_A::ZERO) } #[doc = "CS is asserted for 1 baud-times before start of transmission"] #[inline(always)] pub fn one(self) -> &'a mut W { self.variant(CSSETUP_A::ONE) } #[doc = "CS is asserted for 2 baud-times before start of transmission"] #[inline(always)] pub fn two(self) -> &'a mut W { self.variant(CSSETUP_A::TWO) } #[doc = "CS is asserted for 3 baud-times before start of transmission"] #[inline(always)] pub fn three(self) -> &'a mut W { self.variant(CSSETUP_A::THREE) } #[doc = "CS is asserted for 7 baud-times before start of transmission"] #[inline(always)] pub fn seven(self) -> &'a mut W { self.variant(CSSETUP_A::SEVEN) } #[doc = "CS is asserted before the start of transmission for TCMPVAL0 baud-times"] #[inline(always)] pub fn tcmp0(self) -> &'a mut W { self.variant(CSSETUP_A::TCMP0) } #[doc = "CS is asserted before the start of transmission for TCMPVAL1 baud-times"] #[inline(always)] pub fn tcmp1(self) -> &'a mut W { self.variant(CSSETUP_A::TCMP1) } #[doc = "CS is asserted before the start of transmission for TCMPVAL2 baud-times"] #[inline(always)] pub fn tcmp2(self) -> &'a mut W { self.variant(CSSETUP_A::TCMP2) } #[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 & !(0x07 << 20)) | (((value as u32) & 0x07) << 20); self.w } } #[doc = "Inter-character Spacing\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum ICS_A { #[doc = "0: There is no space between charcters"] ZERO = 0, #[doc = "1: Create a space of 1 baud-times before start of transmission "] ONE = 1, #[doc = "2: Create a space of 2 baud-times before start of transmission"] TWO = 2, #[doc = "3: Create a space of 3 baud-times before start of transmission"] THREE = 3, #[doc = "4: Create a space of 7 baud-times before start of transmission"] SEVEN = 4, #[doc = "5: Create a space of before the start of transmission for TCMPVAL0 baud-times"] TCMP0 = 5, #[doc = "6: Create a space of before the start of transmission for TCMPVAL1 baud-times"] TCMP1 = 6, #[doc = "7: Create a space of before the start of transmission for TCMPVAL2 baud-times"] TCMP2 = 7, } impl From<ICS_A> for u8 { #[inline(always)] fn from(variant: ICS_A) -> Self { variant as _ } } #[doc = "Reader of field `ICS`"] pub type ICS_R = crate::R<u8, ICS_A>; impl ICS_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ICS_A { match self.bits { 0 => ICS_A::ZERO, 1 => ICS_A::ONE, 2 => ICS_A::TWO, 3 => ICS_A::THREE, 4 => ICS_A::SEVEN, 5 => ICS_A::TCMP0, 6 => ICS_A::TCMP1, 7 => ICS_A::TCMP2, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `ZERO`"] #[inline(always)] pub fn is_zero(&self) -> bool { *self == ICS_A::ZERO } #[doc = "Checks if the value of the field is `ONE`"] #[inline(always)] pub fn is_one(&self) -> bool { *self == ICS_A::ONE } #[doc = "Checks if the value of the field is `TWO`"] #[inline(always)] pub fn is_two(&self) -> bool { *self == ICS_A::TWO } #[doc = "Checks if the value of the field is `THREE`"] #[inline(always)] pub fn is_three(&self) -> bool { *self == ICS_A::THREE } #[doc = "Checks if the value of the field is `SEVEN`"] #[inline(always)] pub fn is_seven(&self) -> bool { *self == ICS_A::SEVEN } #[doc = "Checks if the value of the field is `TCMP0`"] #[inline(always)] pub fn is_tcmp0(&self) -> bool { *self == ICS_A::TCMP0 } #[doc = "Checks if the value of the field is `TCMP1`"] #[inline(always)] pub fn is_tcmp1(&self) -> bool { *self == ICS_A::TCMP1 } #[doc = "Checks if the value of the field is `TCMP2`"] #[inline(always)] pub fn is_tcmp2(&self) -> bool { *self == ICS_A::TCMP2 } } #[doc = "Write proxy for field `ICS`"] pub struct ICS_W<'a> { w: &'a mut W, } impl<'a> ICS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ICS_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "There is no space between charcters"] #[inline(always)] pub fn zero(self) -> &'a mut W { self.variant(ICS_A::ZERO) } #[doc = "Create a space of 1 baud-times before start of transmission"] #[inline(always)] pub fn one(self) -> &'a mut W { self.variant(ICS_A::ONE) } #[doc = "Create a space of 2 baud-times before start of transmission"] #[inline(always)] pub fn two(self) -> &'a mut W { self.variant(ICS_A::TWO) } #[doc = "Create a space of 3 baud-times before start of transmission"] #[inline(always)] pub fn three(self) -> &'a mut W { self.variant(ICS_A::THREE) } #[doc = "Create a space of 7 baud-times before start of transmission"] #[inline(always)] pub fn seven(self) -> &'a mut W { self.variant(ICS_A::SEVEN) } #[doc = "Create a space of before the start of transmission for TCMPVAL0 baud-times"] #[inline(always)] pub fn tcmp0(self) -> &'a mut W { self.variant(ICS_A::TCMP0) } #[doc = "Create a space of before the start of transmission for TCMPVAL1 baud-times"] #[inline(always)] pub fn tcmp1(self) -> &'a mut W { self.variant(ICS_A::TCMP1) } #[doc = "Create a space of before the start of transmission for TCMPVAL2 baud-times"] #[inline(always)] pub fn tcmp2(self) -> &'a mut W { self.variant(ICS_A::TCMP2) } #[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 & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); self.w } } #[doc = "Chip Select Hold\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum CSHOLD_A { #[doc = "0: Disable CS being asserted after the end of transmission"] ZERO = 0, #[doc = "1: CS is asserted for 1 baud-times after the end of transmission"] ONE = 1, #[doc = "2: CS is asserted for 2 baud-times after the end of transmission"] TWO = 2, #[doc = "3: CS is asserted for 3 baud-times after the end of transmission"] THREE = 3, #[doc = "4: CS is asserted for 7 baud-times after the end of transmission"] SEVEN = 4, #[doc = "5: CS is asserted after the end of transmission for TCMPVAL0 baud-times"] TCMP0 = 5, #[doc = "6: CS is asserted after the end of transmission for TCMPVAL1 baud-times"] TCMP1 = 6, #[doc = "7: CS is asserted after the end of transmission for TCMPVAL2 baud-times"] TCMP2 = 7, } impl From<CSHOLD_A> for u8 { #[inline(always)] fn from(variant: CSHOLD_A) -> Self { variant as _ } } #[doc = "Reader of field `CSHOLD`"] pub type CSHOLD_R = crate::R<u8, CSHOLD_A>; impl CSHOLD_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CSHOLD_A { match self.bits { 0 => CSHOLD_A::ZERO, 1 => CSHOLD_A::ONE, 2 => CSHOLD_A::TWO, 3 => CSHOLD_A::THREE, 4 => CSHOLD_A::SEVEN, 5 => CSHOLD_A::TCMP0, 6 => CSHOLD_A::TCMP1, 7 => CSHOLD_A::TCMP2, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `ZERO`"] #[inline(always)] pub fn is_zero(&self) -> bool { *self == CSHOLD_A::ZERO } #[doc = "Checks if the value of the field is `ONE`"] #[inline(always)] pub fn is_one(&self) -> bool { *self == CSHOLD_A::ONE } #[doc = "Checks if the value of the field is `TWO`"] #[inline(always)] pub fn is_two(&self) -> bool { *self == CSHOLD_A::TWO } #[doc = "Checks if the value of the field is `THREE`"] #[inline(always)] pub fn is_three(&self) -> bool { *self == CSHOLD_A::THREE } #[doc = "Checks if the value of the field is `SEVEN`"] #[inline(always)] pub fn is_seven(&self) -> bool { *self == CSHOLD_A::SEVEN } #[doc = "Checks if the value of the field is `TCMP0`"] #[inline(always)] pub fn is_tcmp0(&self) -> bool { *self == CSHOLD_A::TCMP0 } #[doc = "Checks if the value of the field is `TCMP1`"] #[inline(always)] pub fn is_tcmp1(&self) -> bool { *self == CSHOLD_A::TCMP1 } #[doc = "Checks if the value of the field is `TCMP2`"] #[inline(always)] pub fn is_tcmp2(&self) -> bool { *self == CSHOLD_A::TCMP2 } } #[doc = "Write proxy for field `CSHOLD`"] pub struct CSHOLD_W<'a> { w: &'a mut W, } impl<'a> CSHOLD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CSHOLD_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "Disable CS being asserted after the end of transmission"] #[inline(always)] pub fn zero(self) -> &'a mut W { self.variant(CSHOLD_A::ZERO) } #[doc = "CS is asserted for 1 baud-times after the end of transmission"] #[inline(always)] pub fn one(self) -> &'a mut W { self.variant(CSHOLD_A::ONE) } #[doc = "CS is asserted for 2 baud-times after the end of transmission"] #[inline(always)] pub fn two(self) -> &'a mut W { self.variant(CSHOLD_A::TWO) } #[doc = "CS is asserted for 3 baud-times after the end of transmission"] #[inline(always)] pub fn three(self) -> &'a mut W { self.variant(CSHOLD_A::THREE) } #[doc = "CS is asserted for 7 baud-times after the end of transmission"] #[inline(always)] pub fn seven(self) -> &'a mut W { self.variant(CSHOLD_A::SEVEN) } #[doc = "CS is asserted after the end of transmission for TCMPVAL0 baud-times"] #[inline(always)] pub fn tcmp0(self) -> &'a mut W { self.variant(CSHOLD_A::TCMP0) } #[doc = "CS is asserted after the end of transmission for TCMPVAL1 baud-times"] #[inline(always)] pub fn tcmp1(self) -> &'a mut W { self.variant(CSHOLD_A::TCMP1) } #[doc = "CS is asserted after the end of transmission for TCMPVAL2 baud-times"] #[inline(always)] pub fn tcmp2(self) -> &'a mut W { self.variant(CSHOLD_A::TCMP2) } #[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 & !(0x07 << 28)) | (((value as u32) & 0x07) << 28); self.w } } impl R { #[doc = "Bits 16:18 - TX Frame Start Delay"] #[inline(always)] pub fn txdelay(&self) -> TXDELAY_R { TXDELAY_R::new(((self.bits >> 16) & 0x07) as u8) } #[doc = "Bits 20:22 - Chip Select Setup"] #[inline(always)] pub fn cssetup(&self) -> CSSETUP_R { CSSETUP_R::new(((self.bits >> 20) & 0x07) as u8) } #[doc = "Bits 24:26 - Inter-character Spacing"] #[inline(always)] pub fn ics(&self) -> ICS_R { ICS_R::new(((self.bits >> 24) & 0x07) as u8) } #[doc = "Bits 28:30 - Chip Select Hold"] #[inline(always)] pub fn cshold(&self) -> CSHOLD_R { CSHOLD_R::new(((self.bits >> 28) & 0x07) as u8) } } impl W { #[doc = "Bits 16:18 - TX Frame Start Delay"] #[inline(always)] pub fn txdelay(&mut self) -> TXDELAY_W { TXDELAY_W { w: self } } #[doc = "Bits 20:22 - Chip Select Setup"] #[inline(always)] pub fn cssetup(&mut self) -> CSSETUP_W { CSSETUP_W { w: self } } #[doc = "Bits 24:26 - Inter-character Spacing"] #[inline(always)] pub fn ics(&mut self) -> ICS_W { ICS_W { w: self } } #[doc = "Bits 28:30 - Chip Select Hold"] #[inline(always)] pub fn cshold(&mut self) -> CSHOLD_W { CSHOLD_W { w: self } } }