@@ -428,158 +428,121 @@ impl_debug_from_methods! {
428
428
#[ repr( transparent) ]
429
429
#[ derive( Copy , Clone ) ]
430
430
pub struct PortPowerManagementStatusAndControlRegister ( u32 ) ;
431
+ /// **These methods are only valid for USB3.**
431
432
impl PortPowerManagementStatusAndControlRegister {
432
433
/// Returns the value of the U1 Timeout field.
433
- ///
434
- /// **This field is USB3 only.**
435
434
#[ must_use]
436
435
pub fn u1_timeout ( self ) -> u8 {
437
436
self . 0 . get_bits ( 0 ..=7 ) . try_into ( ) . unwrap ( )
438
437
}
439
438
440
439
/// Sets the value of the U1 Timeout field.
441
- ///
442
- /// **This field is USB3 only.**
443
440
pub fn set_u1_timeout ( & mut self , timeout : u8 ) {
444
441
self . 0 . set_bits ( 0 ..=7 , timeout. into ( ) ) ;
445
442
}
446
443
447
444
/// Returns the value of the U2 Timeout field.
448
- ///
449
- /// **This field is USB3 only.**
450
445
#[ must_use]
451
446
pub fn u2_timeout ( self ) -> u8 {
452
447
self . 0 . get_bits ( 8 ..=15 ) . try_into ( ) . unwrap ( )
453
448
}
454
449
455
450
/// Sets the value of the U2 Timeout field.
456
- ///
457
- /// **This field is USB3 only.**
458
451
pub fn set_u2_timeout ( & mut self , timeout : u8 ) {
459
452
self . 0 . set_bits ( 8 ..=15 , timeout. into ( ) ) ;
460
453
}
461
454
462
455
/// Returns the value of the Force Link PM Accept bit.
463
- ///
464
- /// **This field is USB3 only.**
465
456
#[ must_use]
466
457
pub fn force_link_pm_accept ( self ) -> bool {
467
458
self . 0 . get_bit ( 16 )
468
459
}
469
460
470
461
/// Sets the value of the Force Link PM Accept bit.
471
- ///
472
- /// **This field is USB3 only.**
473
462
pub fn set_force_link_pm_accept ( & mut self ) {
474
463
self . 0 . set_bit ( 16 , true ) ;
475
464
}
476
465
477
466
/// Clears the Force Link PM Accept bit.
478
- ///
479
- /// **This field is USB3 only.**
480
467
pub fn clear_force_link_pm_accept ( & mut self ) {
481
468
self . 0 . set_bit ( 16 , false ) ;
482
469
}
483
-
470
+ }
471
+ /// **These methods are only valid for USB2.**
472
+ impl PortPowerManagementStatusAndControlRegister {
484
473
/// Returns the value of the L1 Status field.
485
474
///
486
475
/// This field returns [`None`] if the value means `Reserved`.
487
- ///
488
- /// **This field is USB2 only.**
489
476
#[ must_use]
490
477
pub fn l1_status ( self ) -> Option < L1Status > {
491
478
let s = self . 0 . get_bits ( 0 ..=2 ) ;
492
479
FromPrimitive :: from_u32 ( s)
493
480
}
494
481
495
482
/// Returns the value of the Remote Wake Enable field.
496
- ///
497
- /// **This field is USB2 only.**
498
483
#[ must_use]
499
484
pub fn remote_wake_enable ( self ) -> bool {
500
485
self . 0 . get_bit ( 3 )
501
486
}
502
487
503
488
/// Sets the value of the Remote Wake Enable field.
504
- ///
505
- /// **This field is USB2 only.**
506
489
pub fn set_remote_wake_enable ( & mut self ) {
507
490
self . 0 . set_bit ( 3 , true ) ;
508
491
}
509
492
510
493
/// Clears the Remote Wake Enable bit.
511
- ///
512
- /// **This field is USB2 only.**
513
494
pub fn clear_remote_wake_enable ( & mut self ) {
514
495
self . 0 . set_bit ( 3 , false ) ;
515
496
}
516
497
517
498
/// Returns the value of the Best Effort Service Latency field.
518
- ///
519
- /// **This field is USB2 only.**
520
499
#[ must_use]
521
500
pub fn best_effort_service_latency ( self ) -> u8 {
522
501
self . 0 . get_bits ( 4 ..=7 ) . try_into ( ) . unwrap ( )
523
502
}
524
503
525
504
/// Sets the value of the Best Effort Service Latency field.
526
- ///
527
- /// **This field is USB2 only.**
528
505
pub fn set_best_effort_service_latency ( & mut self , l : u8 ) {
529
506
self . 0 . set_bits ( 4 ..=7 , l. into ( ) ) ;
530
507
}
531
508
532
509
/// Returns the value of the L1 Device Slot field.
533
- ///
534
- /// **This field is USB2 only.**
535
510
#[ must_use]
536
511
pub fn l1_device_slot ( self ) -> u8 {
537
512
self . 0 . get_bits ( 8 ..=15 ) . try_into ( ) . unwrap ( )
538
513
}
539
514
540
515
/// Sets the value of the L1 Device Slot field.
541
- ///
542
- /// **This field is USB2 only.**
543
516
pub fn set_l1_device_slot ( & mut self , slot : u8 ) {
544
517
self . 0 . set_bits ( 8 ..=15 , slot. into ( ) ) ;
545
518
}
546
519
547
520
/// Returns the value of the Hardware LPM Enable field.
548
- ///
549
- /// **This field is USB2 only.**
550
521
#[ must_use]
551
522
pub fn hardware_lpm_enable ( self ) -> bool {
552
523
self . 0 . get_bit ( 16 )
553
524
}
554
525
555
526
/// Sets the value of the Hardware LPM Enable field.
556
- ///
557
- /// **This field is USB2 only.**
558
527
pub fn set_hardware_lpm_enable ( & mut self ) {
559
528
self . 0 . set_bit ( 16 , true ) ;
560
529
}
561
530
562
531
/// Clears the Hardware LPM Enable bit.
563
- ///
564
- /// **This field is USB2 only.**
565
532
pub fn clear_hardware_lpm_enable ( & mut self ) {
566
533
self . 0 . set_bit ( 16 , false ) ;
567
534
}
568
535
569
536
/// Returns the value of the Port Test Control field.
570
537
///
571
538
/// This field returns [`None`] if the value means `Reserved`.
572
- ///
573
- /// **This field is USB2 only.**
574
539
#[ must_use]
575
540
pub fn port_test_control ( self ) -> Option < TestMode > {
576
541
let t = self . 0 . get_bits ( 28 ..=31 ) ;
577
542
FromPrimitive :: from_u32 ( t)
578
543
}
579
544
580
545
/// Sets the value of the Port Test Control field.
581
- ///
582
- /// **This field is USB2 only.**
583
546
pub fn set_port_test_control ( & mut self , m : TestMode ) {
584
547
self . 0 . set_bits ( 28 ..=31 , m as _ ) ;
585
548
}
0 commit comments