|
5 | 5 | from adi.context_manager import context_manager |
6 | 6 | from adi.jesd import jesd as jesdadi |
7 | 7 | from adi.obs import obs |
8 | | -from adi.rx_tx import rx_tx |
| 8 | +from adi.rx_tx import rx, rx_tx, tx |
9 | 9 | from adi.sync_start import sync_start |
10 | 10 |
|
11 | 11 |
|
@@ -356,3 +356,366 @@ def jesd204_fsm_paused(self): |
356 | 356 | def jesd204_fsm_error(self): |
357 | 357 | """jesd204_fsm_error: jesd204-fsm error""" |
358 | 358 | return self._get_iio_dev_attr("jesd204_fsm_error") |
| 359 | + |
| 360 | + |
| 361 | +class adrv9008_1(rx, context_manager, sync_start): |
| 362 | + """ADRV9008-1 Receiver""" |
| 363 | + |
| 364 | + def __init__(self, uri="", jesd_monitor=False, jesd=None): |
| 365 | + self.adrv9009 = adrv9009(uri, jesd_monitor, jesd) |
| 366 | + |
| 367 | + self._rx_channel_names = self.adrv9009._rx_channel_names |
| 368 | + self._device_name = self.adrv9009._device_name |
| 369 | + self._ctrl = self.adrv9009._ctx.find_device("adrv9009-phy") |
| 370 | + self._rxadc = self.adrv9009._ctx.find_device("axi-adrv9009-rx-hpc") |
| 371 | + self.adrv9009._ctx.set_timeout(30000) # Needed for loading profiles |
| 372 | + if jesdadi and jesd_monitor: |
| 373 | + self._jesd = jesd if jesd else jesdadi(uri=uri) |
| 374 | + rx.__init__(self) |
| 375 | + |
| 376 | + @property |
| 377 | + def ensm_mode(self): |
| 378 | + """ensm_mode: Enable State Machine State Allows real time control over |
| 379 | + the current state of the device. Options are: radio_on, radio_off""" |
| 380 | + return self.adrv9009.ensm_mode |
| 381 | + |
| 382 | + @ensm_mode.setter |
| 383 | + def ensm_mode(self, value): |
| 384 | + self.adrv9009.ensm_mode = value |
| 385 | + |
| 386 | + @property |
| 387 | + def profile(self): |
| 388 | + """Load profile file. Provide path to profile file to attribute""" |
| 389 | + return self.adrv9009.profile |
| 390 | + |
| 391 | + @profile.setter |
| 392 | + def profile(self, value): |
| 393 | + self.adrv9009.profile = value |
| 394 | + |
| 395 | + @property |
| 396 | + def frequency_hopping_mode(self): |
| 397 | + """frequency_hopping_mode: Set Frequency Hopping Mode""" |
| 398 | + return self._get_iio_attr("RX_LO", "frequency_hopping_mode", True) |
| 399 | + |
| 400 | + @frequency_hopping_mode.setter |
| 401 | + def frequency_hopping_mode(self, value): |
| 402 | + self._set_iio_attr("RX_LO", "frequency_hopping_mode", True, value) |
| 403 | + |
| 404 | + @property |
| 405 | + def frequency_hopping_mode_en(self): |
| 406 | + """frequency_hopping_mode_en: Enable Frequency Hopping Mode""" |
| 407 | + return self._get_iio_attr("RX_LO", "frequency_hopping_mode_enable", True) |
| 408 | + |
| 409 | + @frequency_hopping_mode_en.setter |
| 410 | + def frequency_hopping_mode_en(self, value): |
| 411 | + self._set_iio_attr("RX_LO", "frequency_hopping_mode_enable", True, value) |
| 412 | + |
| 413 | + @property |
| 414 | + def calibrate_rx_phase_correction_en(self): |
| 415 | + """calibrate_rx_phase_correction_en: Enable RX Phase Correction Calibration""" |
| 416 | + return self.adrv9009.calibrate_rx_phase_correction_en |
| 417 | + |
| 418 | + @calibrate_rx_phase_correction_en.setter |
| 419 | + def calibrate_rx_phase_correction_en(self, value): |
| 420 | + self.adrv9009.calibrate_rx_phase_correction_en = value |
| 421 | + |
| 422 | + @property |
| 423 | + def calibrate_rx_qec_en(self): |
| 424 | + """calibrate_rx_qec_en: Enable RX QEC Calibration""" |
| 425 | + return self.adrv9009.calibrate_rx_qec_en |
| 426 | + |
| 427 | + @calibrate_rx_qec_en.setter |
| 428 | + def calibrate_rx_qec_en(self, value): |
| 429 | + self.adrv9009.calibrate_rx_qec_en = value |
| 430 | + |
| 431 | + @property |
| 432 | + def calibrate(self): |
| 433 | + """calibrate: Trigger Calibration""" |
| 434 | + return self.adrv9009.calibrate |
| 435 | + |
| 436 | + @calibrate.setter |
| 437 | + def calibrate(self, value): |
| 438 | + self.adrv9009.calibrate = value |
| 439 | + |
| 440 | + @property |
| 441 | + def gain_control_mode_chan0(self): |
| 442 | + """gain_control_mode_chan0: Mode of receive path AGC. Options are: |
| 443 | + slow_attack, manual""" |
| 444 | + return self.adrv9009.gain_control_mode_chan0 |
| 445 | + |
| 446 | + @gain_control_mode_chan0.setter |
| 447 | + def gain_control_mode_chan0(self, value): |
| 448 | + self.adrv9009.gain_control_mode_chan0 = value |
| 449 | + |
| 450 | + @property |
| 451 | + def gain_control_mode_chan1(self): |
| 452 | + """gain_control_mode_chan1: Mode of receive path AGC. Options are: |
| 453 | + slow_attack, manual""" |
| 454 | + return self.adrv9009.gain_control_mode_chan1 |
| 455 | + |
| 456 | + @gain_control_mode_chan1.setter |
| 457 | + def gain_control_mode_chan1(self, value): |
| 458 | + self.adrv9009.gain_control_mode_chan1 = value |
| 459 | + |
| 460 | + @property |
| 461 | + def rx_quadrature_tracking_en_chan0(self): |
| 462 | + """Enable Quadrature tracking calibration for RX1""" |
| 463 | + return self.adrv9009.rx_quadrature_tracking_en_chan0 |
| 464 | + |
| 465 | + @rx_quadrature_tracking_en_chan0.setter |
| 466 | + def rx_quadrature_tracking_en_chan0(self, value): |
| 467 | + self.adrv9009.rx_quadrature_tracking_en_chan0 = value |
| 468 | + |
| 469 | + @property |
| 470 | + def rx_quadrature_tracking_en_chan1(self): |
| 471 | + """Enable Quadrature tracking calibration for RX2""" |
| 472 | + return self.adrv9009.rx_quadrature_tracking_en_chan1 |
| 473 | + |
| 474 | + @rx_quadrature_tracking_en_chan1.setter |
| 475 | + def rx_quadrature_tracking_en_chan1(self, value): |
| 476 | + self.adrv9009.rx_quadrature_tracking_en_chan1 = value |
| 477 | + |
| 478 | + @property |
| 479 | + def rx_powerdown_en_chan0(self): |
| 480 | + """rx_powerdown_en_chan0: Enables/disables the RX1 signal paths |
| 481 | + while in the ENSM radio_on state""" |
| 482 | + return self.adrv9009.rx_powerdown_en_chan0 |
| 483 | + |
| 484 | + @rx_powerdown_en_chan0.setter |
| 485 | + def rx_powerdown_en_chan0(self, value): |
| 486 | + self.adrv9009.rx_powerdown_en_chan0 = value |
| 487 | + |
| 488 | + @property |
| 489 | + def rx_powerdown_en_chan1(self): |
| 490 | + """rx_powerdown_en_chan1: Enables/disables the RX2 signal paths |
| 491 | + while in the ENSM radio_on state""" |
| 492 | + return self.adrv9009.rx_powerdown_en_chan1 |
| 493 | + |
| 494 | + @rx_powerdown_en_chan1.setter |
| 495 | + def rx_powerdown_en_chan1(self, value): |
| 496 | + self.adrv9009.rx_powerdown_en_chan1 = value |
| 497 | + |
| 498 | + @property |
| 499 | + def rx_hardwaregain_chan0(self): |
| 500 | + """rx_hardwaregain: Gain applied to RX path channel 0. Only applicable when |
| 501 | + gain_control_mode is set to 'manual'""" |
| 502 | + return self.adrv9009.rx_hardwaregain_chan0 |
| 503 | + |
| 504 | + @rx_hardwaregain_chan0.setter |
| 505 | + def rx_hardwaregain_chan0(self, value): |
| 506 | + if self.adrv9009.gain_control_mode_chan0 == "manual": |
| 507 | + self.adrv9009.rx_hardwaregain_chan0 = value |
| 508 | + |
| 509 | + @property |
| 510 | + def rx_hardwaregain_chan1(self): |
| 511 | + """rx_hardwaregain: Gain applied to RX path channel 1. Only applicable when |
| 512 | + gain_control_mode is set to 'manual'""" |
| 513 | + return self.adrv9009.rx_hardwaregain_chan1 |
| 514 | + |
| 515 | + @rx_hardwaregain_chan1.setter |
| 516 | + def rx_hardwaregain_chan1(self, value): |
| 517 | + if self.adrv9009.gain_control_mode_chan1 == "manual": |
| 518 | + self.adrv9009.rx_hardwaregain_chan1 = value |
| 519 | + |
| 520 | + @property |
| 521 | + def rx_rf_bandwidth(self): |
| 522 | + """rx_rf_bandwidth: Bandwidth of front-end analog filter of RX path""" |
| 523 | + return self.adrv9009.rx_rf_bandwidth |
| 524 | + |
| 525 | + @property |
| 526 | + def rx_sample_rate(self): |
| 527 | + """rx_sample_rate: Sample rate RX path in samples per second""" |
| 528 | + return self.adrv9009.rx_sample_rate |
| 529 | + |
| 530 | + @property |
| 531 | + def trx_lo(self): |
| 532 | + """trx_lo: Carrier frequency of TX and RX path""" |
| 533 | + return self.adrv9009.trx_lo |
| 534 | + |
| 535 | + @trx_lo.setter |
| 536 | + def trx_lo(self, value): |
| 537 | + self.adrv9009.trx_lo = value |
| 538 | + |
| 539 | + |
| 540 | +class adrv9008_2(tx, context_manager, sync_start): |
| 541 | + """ADRV9008-2 Transmitter""" |
| 542 | + |
| 543 | + def __init__(self, uri="", jesd_monitor=False, jesd=None): |
| 544 | + self.adrv9009 = adrv9009(uri, jesd_monitor, jesd) |
| 545 | + |
| 546 | + self._tx_channel_names = self.adrv9009._tx_channel_names |
| 547 | + self._device_name = self.adrv9009._device_name |
| 548 | + self._ctrl = self.adrv9009._ctx.find_device("adrv9009-phy") |
| 549 | + self._txdac = self.adrv9009._ctx.find_device("axi-adrv9009-tx-hpc") |
| 550 | + self.adrv9009._ctx.set_timeout(30000) # Needed for loading profiles |
| 551 | + if jesdadi and jesd_monitor: |
| 552 | + self._jesd = jesd if jesd else jesdadi(uri=uri) |
| 553 | + tx.__init__(self) |
| 554 | + |
| 555 | + @property |
| 556 | + def ensm_mode(self): |
| 557 | + """ensm_mode: Enable State Machine State Allows real time control over |
| 558 | + the current state of the device. Options are: radio_on, radio_off""" |
| 559 | + return self.adrv9009.ensm_mode |
| 560 | + |
| 561 | + @ensm_mode.setter |
| 562 | + def ensm_mode(self, value): |
| 563 | + self.adrv9009.ensm_mode = value |
| 564 | + |
| 565 | + @property |
| 566 | + def profile(self): |
| 567 | + """Load profile file. Provide path to profile file to attribute""" |
| 568 | + return self.adrv9009.profile |
| 569 | + |
| 570 | + @profile.setter |
| 571 | + def profile(self, value): |
| 572 | + self.adrv9009.profile = value |
| 573 | + |
| 574 | + @property |
| 575 | + def frequency_hopping_mode(self): |
| 576 | + """frequency_hopping_mode: Set Frequency Hopping Mode""" |
| 577 | + return self._get_iio_attr("TX_LO", "frequency_hopping_mode", True) |
| 578 | + |
| 579 | + @frequency_hopping_mode.setter |
| 580 | + def frequency_hopping_mode(self, value): |
| 581 | + self._set_iio_attr("TX_LO", "frequency_hopping_mode", True, value) |
| 582 | + |
| 583 | + @property |
| 584 | + def frequency_hopping_mode_en(self): |
| 585 | + """frequency_hopping_mode_en: Enable Frequency Hopping Mode""" |
| 586 | + return self._get_iio_attr("TX_LO", "frequency_hopping_mode_enable", True) |
| 587 | + |
| 588 | + @frequency_hopping_mode_en.setter |
| 589 | + def frequency_hopping_mode_en(self, value): |
| 590 | + self._set_iio_attr("TX_LO", "frequency_hopping_mode_enable", True, value) |
| 591 | + |
| 592 | + @property |
| 593 | + def calibrate_tx_qec_en(self): |
| 594 | + """calibrate_tx_qec_en: Enable TX QEC Calibration""" |
| 595 | + return self.adrv9009.calibrate_tx_qec_en |
| 596 | + |
| 597 | + @calibrate_tx_qec_en.setter |
| 598 | + def calibrate_tx_qec_en(self, value): |
| 599 | + self.adrv9009.calibrate_tx_qec_en = value |
| 600 | + |
| 601 | + @property |
| 602 | + def calibrate(self): |
| 603 | + """calibrate: Trigger Calibration""" |
| 604 | + return self.adrv9009.calibrate |
| 605 | + |
| 606 | + @calibrate.setter |
| 607 | + def calibrate(self, value): |
| 608 | + self.adrv9009.calibrate = value |
| 609 | + |
| 610 | + @property |
| 611 | + def tx_quadrature_tracking_en_chan0(self): |
| 612 | + """Enable Quadrature tracking calibration for TX1""" |
| 613 | + return self.adrv9009.tx_quadrature_tracking_en_chan0 |
| 614 | + |
| 615 | + @tx_quadrature_tracking_en_chan0.setter |
| 616 | + def tx_quadrature_tracking_en_chan0(self, value): |
| 617 | + self.adrv9009.tx_quadrature_tracking_en_chan0 = value |
| 618 | + |
| 619 | + @property |
| 620 | + def tx_quadrature_tracking_en_chan1(self): |
| 621 | + """Enable Quadrature tracking calibration for TX2""" |
| 622 | + return self.adrv9009.tx_quadrature_tracking_en_chan1 |
| 623 | + |
| 624 | + @tx_quadrature_tracking_en_chan1.setter |
| 625 | + def tx_quadrature_tracking_en_chan1(self, value): |
| 626 | + self.adrv9009.tx_quadrature_tracking_en_chan1 = value |
| 627 | + |
| 628 | + @property |
| 629 | + def tx_hardwaregain_chan0(self): |
| 630 | + """tx_hardwaregain: Attenuation applied to TX path channel 0""" |
| 631 | + return self.adrv9009.tx_hardwaregain_chan0 |
| 632 | + |
| 633 | + @tx_hardwaregain_chan0.setter |
| 634 | + def tx_hardwaregain_chan0(self, value): |
| 635 | + self.adrv9009.tx_hardwaregain_chan0 = value |
| 636 | + |
| 637 | + @property |
| 638 | + def tx_hardwaregain_chan1(self): |
| 639 | + """tx_hardwaregain: Attenuation applied to TX path channel 1""" |
| 640 | + return self.adrv9009.tx_hardwaregain_chan1 |
| 641 | + |
| 642 | + @tx_hardwaregain_chan1.setter |
| 643 | + def tx_hardwaregain_chan1(self, value): |
| 644 | + self.adrv9009.tx_hardwaregain_chan1 = value |
| 645 | + |
| 646 | + @property |
| 647 | + def tx_rf_bandwidth(self): |
| 648 | + """tx_rf_bandwidth: Bandwidth of front-end analog filter of TX path""" |
| 649 | + return self.adrv9009.tx_rf_bandwidth |
| 650 | + |
| 651 | + @property |
| 652 | + def tx_sample_rate(self): |
| 653 | + """tx_sample_rate: Sample rate TX path in samples per second""" |
| 654 | + return self.adrv9009.tx_sample_rate |
| 655 | + |
| 656 | + @property |
| 657 | + def trx_lo(self): |
| 658 | + """trx_lo: Carrier frequency of TX and RX path""" |
| 659 | + return self.adrv9009.trx_lo |
| 660 | + |
| 661 | + @trx_lo.setter |
| 662 | + def trx_lo(self, value): |
| 663 | + self.adrv9009.trx_lo = value |
| 664 | + |
| 665 | + @property |
| 666 | + def obs_powerdown_en(self): |
| 667 | + """obs_powerdown_en: Enables/disables the ORX signal paths |
| 668 | + while in the ENSM radio_on state""" |
| 669 | + return self.adrv9009.obs_powerdown_en |
| 670 | + |
| 671 | + @obs_powerdown_en.setter |
| 672 | + def obs_powerdown_en(self, value): |
| 673 | + self.adrv9009.obs_powerdown_en = value |
| 674 | + |
| 675 | + @property |
| 676 | + def aux_obs_lo(self): |
| 677 | + """aux_obs_lo: Carrier frequency of ORx path""" |
| 678 | + return self.adrv9009.aux_obs_lo |
| 679 | + |
| 680 | + @aux_obs_lo.setter |
| 681 | + def aux_obs_lo(self, value): |
| 682 | + self.adrv9009.aux_obs_lo = value |
| 683 | + |
| 684 | + @property |
| 685 | + def obs_quadrature_tracking_en(self): |
| 686 | + """Enable Quadrature tracking calibration for ORX""" |
| 687 | + return self.adrv9009.obs_quadrature_tracking_en |
| 688 | + |
| 689 | + @obs_quadrature_tracking_en.setter |
| 690 | + def obs_quadrature_tracking_en(self, value): |
| 691 | + self.adrv9009.obs_quadrature_tracking_en = value |
| 692 | + |
| 693 | + @property |
| 694 | + def obs_rf_port_select(self): |
| 695 | + """obs_rf_port_select: Observation path source for ORX. Options are: |
| 696 | +
|
| 697 | + - OBS_TX_LO - |
| 698 | + - OBS_AUX_LO - |
| 699 | +
|
| 700 | + """ |
| 701 | + return self.adrv9009.obs_rf_port_select |
| 702 | + |
| 703 | + @obs_rf_port_select.setter |
| 704 | + def obs_rf_port_select(self, value): |
| 705 | + self.adrv9009.obs_rf_port_select = value |
| 706 | + |
| 707 | + @property |
| 708 | + def obs_hardwaregain(self): |
| 709 | + """obs_hardwaregain: Gain applied to Obs/Sniffer receive path ORX1.""" |
| 710 | + return self.adrv9009.obs_hardwaregain |
| 711 | + |
| 712 | + @obs_hardwaregain.setter |
| 713 | + def obs_hardwaregain(self, value): |
| 714 | + self.adrv9009.obs_hardwaregain = value |
| 715 | + |
| 716 | + @property |
| 717 | + def orx_sample_rate(self): |
| 718 | + """orx_sample_rate: Sample rate ORX path in samples per second |
| 719 | + This value will reflect the correct value when 8x decimator is enabled |
| 720 | + """ |
| 721 | + return self.adrv9009.orx_sample_rate |
0 commit comments