Handle 3-phase to datasheet conversion. Args: T1: High time for '0' bit (nanoseconds) T2: Additional high time for '1' bit (nanoseconds) T3: Low tail duration (nanoseconds) verbose: Whether to show verbose output
(T1: int, T2: int, T3: int, verbose: bool)
| 585 | |
| 586 | |
| 587 | def handle_fastled(T1: int, T2: int, T3: int, verbose: bool) -> None: |
| 588 | """Handle 3-phase to datasheet conversion. |
| 589 | |
| 590 | Args: |
| 591 | T1: High time for '0' bit (nanoseconds) |
| 592 | T2: Additional high time for '1' bit (nanoseconds) |
| 593 | T3: Low tail duration (nanoseconds) |
| 594 | verbose: Whether to show verbose output |
| 595 | """ |
| 596 | fl = Timing3Phase(T1, T2, T3) |
| 597 | ds = phase3_to_datasheet(fl) |
| 598 | |
| 599 | if ds is None: |
| 600 | print("ERROR: Invalid timing (negative values in datasheet format)") |
| 601 | sys.exit(1) |
| 602 | assert ds is not None |
| 603 | |
| 604 | if verbose: |
| 605 | print(f"3-Phase Format: {fl}") |
| 606 | print(f"Datasheet Format: {ds}") |
| 607 | else: |
| 608 | print(f"T0H={ds.T0H} T0L={ds.T0L} T1H={ds.T1H} T1L={ds.T1L}") |
| 609 | |
| 610 | |
| 611 | @dataclass |
no test coverage detected