ADC3669API

   1from samrat_api import Samrat
   2from time import sleep
   3from math import log
   4from typing import List
   5
   6
   7class ADC3669:
   8    """Python API for ADC3669 family devices.
   9    
  10    Attributes:
  11        alias: String used to identify the ADC being interfaced with
  12        device: Reference to the low level API which handles register field functions.
  13        fs: Sampling frequency of the device
  14
  15    """
  16
  17    def __init__(self, alias:str, device_handle, sample_freq:int):
  18        """Constructor for ADC3669 API.
  19        
  20        Arguments:
  21            alias: String used to identify the ADC being interfaced with
  22            device_handle: Object which handles SPI communication to the device. Contains read and write functions.
  23            sample_freq: Sampling frequency of the device.
  24        
  25        Raises:
  26            None
  27
  28        Returns:
  29            An instance of the ADC3669 API class
  30
  31        """
  32        self.alias = alias
  33        self.fs = sample_freq
  34        self.device = Samrat(device_handle, sample_freq)
  35
  36    def reg_read(self, addr: int) -> int:
  37        """Reads the value stored in a register
  38
  39        Arguments:
  40            addr:
  41                The address of the desired register
  42
  43        Raises:
  44            None
  45
  46        Returns:
  47            The value of the register that is read back
  48        """
  49        return self.device.read(addr)
  50
  51    def reg_write(self, addr: int, value: int) -> None:
  52        """Writes a value into a register
  53
  54        Arguments:
  55            addr:
  56                The address of the desired register
  57            value:
  58                The value that is to be written to the register
  59
  60        Raises:
  61            None
  62
  63        Returns:
  64            None
  65        """
  66        self.device.write(addr, value)
  67
  68    def configure_ready(self) -> int:
  69        """Indicates the status of the internal fuse load after HW reset. The device should not be programmed before the fuse load is complete.
  70
  71        Arguments:
  72            None
  73
  74        Raises:
  75            None
  76
  77        Returns:
  78            Status of the fuse autoload.
  79
  80            - 0: Fuse autoload is incomplete, and the device should not be programmed
  81            - 1: Fuse autoload is complete, the device can be programmed
  82        """
  83        return self.device.GET_FUSE_LOAD_DONE()
  84
  85    def reset(self) -> None:
  86        """Resets the device. The register will self clear after reset.
  87
  88        Arguments:
  89            None
  90
  91        Raises:
  92            None
  93
  94        Returns:
  95            None
  96        """
  97        self.device.SET_SOFTWARE_RESET(1)
  98
  99    def global_powerdown(self, value: int) -> None:
 100        """Powers down the device.
 101
 102        Arguments:
 103            value: input value
 104                - 0: Normal Operation
 105                - 1: Powerdown
 106
 107        Raises:
 108            None
 109
 110        Returns:
 111            None
 112        """
 113        self.device.SET_GLOBAL_PDN(value)
 114
 115    def fast_powerdown_cha(self, value: int) -> None:
 116        """Puts channel A into a low power state that enables a fast wake time.
 117
 118        Arguments:
 119            value: input value
 120                - 0: Normal Operation
 121                - 1: Powerdown
 122
 123        Raises:
 124            None
 125
 126        Returns:
 127            None
 128        """
 129        self.device.SET_FAST_PDN_CH0(value)
 130
 131    def fast_powerdown_chb(self, state: int) -> None:
 132        """Puts channel B into a low power state that enables a fast wake time.
 133
 134        Arguments:
 135            value: input value
 136                - 0: Normal Operation
 137                - 1: Powerdown
 138
 139        Raises:
 140            None
 141
 142        Returns:
 143            None
 144        """
 145        self.device.SET_FAST_PDN_CH1(state)
 146
 147    def sysref_detect_clear(self, value: int) -> None:
 148        """resets the SYSREF DET flag
 149
 150        Arguments:
 151            value: input value
 152                - 0: Normal operation
 153                - 1: SYSREF DET flag gets reset
 154
 155        Raises:
 156            None
 157
 158        Returns:
 159            None
 160        """
 161        self.device.SET_SYSREF_DET_CLR(value)
 162
 163    def cha_termination(self, value: int) -> None:
 164        """Sets the internal termination on channel A.
 165
 166        Arguments:
 167            value: input value
 168                - 0: 100Ω differential termination
 169                - 1: 200Ω differential termination
 170
 171        Raises:
 172            None
 173
 174        Returns:
 175            None
 176        """
 177        self.device.SET_CH0_200_OHM_TERM(value)
 178
 179    def chb_termination(self, value: int) -> None:
 180        """Sets the internal termination on channel B.
 181
 182        Arguments:
 183            value: input value
 184                - 0: 100Ω differential termination
 185                - 1: 200Ω differential termination
 186
 187        Raises:
 188            None
 189
 190        Returns:
 191            None
 192        """
 193        self.device.SET_CH1_200_OHM_TERM(value)
 194
 195    def overrange_clear(self, value) -> None:
 196        """A transition from 0 to 2 clears the clears the sticky overrange bit.
 197
 198        Arguments:
 199            value: input value
 200                - 0: Normal operation
 201                - 2: Overrange bit is cleared
 202
 203        Raises:
 204            None
 205
 206        Returns:
 207            None
 208        """
 209        self.device.SET_DIG_OVR_CLEAR(value)
 210
 211    def overrange_sticky(self, value: int) -> None:
 212        """Makes the digital Overrange sticky.
 213
 214        Arguments:
 215            value: input value
 216                - 0: Digital OVR is non-sticky (updated based on overrange_length())
 217                - 1: Digital OVR is sticky (use overrange_clear() to reset)
 218
 219        Raises:
 220            None
 221
 222        Returns:
 223            None
 224        """
 225        self.device.SET_DIG_OVR_MODE(value)
 226
 227    def overrange_length(self, value: int) -> None:
 228        """Controls the Overrange pulse expansion. The expansion width is specified in terms of number of clock cycles.
 229
 230        Arguments:
 231            value: input value
 232                8-bit integer specifying the ovr pulse expansion in number of clock cycles
 233
 234        Raises:
 235            None
 236
 237        Returns:
 238            None
 239        """
 240        self.device.SET_DIG_OVR_WIDTH(value)
 241
 242    def lvds_termination(self, value: int) -> None:
 243        """Configures the LVDS termination resistance
 244
 245        Arguments:
 246            value: input value
 247                - 0: LVDS termination is 50Ω
 248                - 1: LVDS termination is 100Ω
 249
 250        Raises:
 251            None
 252
 253        Returns:
 254            None
 255        """
 256        self.device.SET_HUNDRED_OHM_TERM(value)
 257
 258    def lvds_half_swing(self, value: int) -> None:
 259        """Reduces LVDS output swing by 50% to reduce power consumption
 260
 261        Arguments:
 262            value: input value
 263                - 0: Normal output swing
 264                - 1: Reduced output swing
 265
 266        Raises:
 267            None
 268
 269        Returns:
 270            None
 271        """
 272        self.device.SET_LVDS_HALF_SWING_EN(value)
 273
 274    def data_rate(self, value: int) -> None:
 275        """This bit configures the parallel LVDS output interface. When only a single channel is output, SDR LVDS can be enabled.
 276
 277        Arguments:
 278            value: input value
 279                - 0: Dual Data Rate (DDR)
 280                - 1: Single Data Rate (SDR)
 281
 282        Raises:
 283            None
 284
 285        Returns:
 286            None
 287        """
 288        self.device.SET_SDR(value)
 289
 290    def swap_channels(self, value: int) -> None:
 291        """Internally swaps channel A and channel B.
 292
 293        Arguments:
 294            value: input value
 295                - 0: Normal operation
 296                - 1: Channel A and channel B are swapped
 297
 298        Raises:
 299            None
 300
 301        Returns:
 302            None
 303        """
 304        self.device.SET_SWAP_CHANNELS(value)
 305
 306    def lvds_data_invert(self, value) -> None:
 307        """Inverts the polarity of individual LVDS output lanes.
 308
 309        Arguments:
 310            lanes:
 311                Value to write to the register, where each bit represents as listed in the datasheet, and the values correspond to the following functions:
 312                - 0: Normal operation
 313                - 1: LVDS Lane is inverted
 314
 315        Raises:
 316            None
 317
 318        Returns:
 319            None
 320        """
 321        self.device.SET_LVDS_DATA_INV(value)
 322
 323    def lvds_powerdown(self, value: List[int]) -> None:
 324        """Powers down the individual LVDS output lanes and puts LVDS pins into high impedance state.
 325
 326        Arguments:
 327            value: input value
 328                Value to write to the register, where each bit represents as listed in the datasheet, and the values correspond to the following functions:
 329                - 0: Normal operation
 330                - 1: Powered down
 331
 332        Raises:
 333            None
 334
 335        Returns:
 336            None
 337        """
 338        self.device.SET_LVDS_DATA_PDN(value)
 339
 340    def fclk_duty_cycle(self, value: int) -> None:
 341        """Adjusts the Frame clock duty cycle.
 342        Arguments:
 343            value: input value
 344                - 0: FCLK stays high for one DCLK cycle at the beginning of the output sample
 345                - 1: FCLK stays high for 50% of the output sample
 346
 347        Raises:
 348            None
 349
 350        Returns:
 351            None
 352        """
 353        self.device.SET_ENABLE_50PER_DUTY_FCLK(value)
 354
 355    def fclk_disable(self, value: int) -> None:
 356        """Disables the output Frame clock.
 357
 358        Arguments:
 359            value: input value
 360                - 0: FCLK replaces the LSB data and is transmitted on DOUT0
 361                - 1: FCLK is disabled and the LSB data is transmitted on DOUT0.
 362
 363        Raises:
 364            None
 365
 366        Returns:
 367            None
 368        """
 369        self.device.SET_DISABLE_FRAME_INSERTION(value)
 370
 371    def lvds_mux_enable(self, value: int) -> None:
 372        """Enables use of the LVDS output mux
 373
 374        Arguments:
 375            value: input value
 376                - 0: LVDS Mux disabled
 377                - 1: LVDS Mux enabled
 378
 379        Raises:
 380            None
 381
 382        Returns:
 383            None
 384        """
 385        self.device.SET_LVDS_CROSS_BAR_MUX_EN(value)
 386
 387    def lvds_swap_edge(self, value: int) -> None:
 388        """Swaps the output data bits transmitted on rising and falling edge of DCLK.
 389
 390        Arguments:
 391            value: input value
 392                - 0: Normal operation
 393                - 1: Output bits on rising and falling edge are swapped.
 394
 395        Raises:
 396            None
 397
 398        Returns:
 399            None
 400        """
 401        self.device.SET_LVDS_SWAP_RISE_FALL(value)
 402
 403    def lvds_scrambling(self, value: int) -> None:
 404        """Controls the scrambling and LSB insertion configuration on the output data
 405
 406        Arguments:
 407            value: input value
 408                - 0: No scrambling, Defualt Operation
 409                - 1: Data is XOR'ed with a PRBS bit. This PRBS is inserted on the LSB position
 410                - 2: OVR is inserted on the LSB position
 411                - 3: OVR is inserted on the LSB+1 position
 412                - 4: Data is XOR'ed with a PRBS bit, and the PRBS is inserted on LSB+1 position
 413                - 5: OVR is inserted on LSB+1 position, PRBS is inseted on LSB position. Data is XOR'ed with PRBS
 414                - 6: OVR is inserted on LSB+2 position, PRBS is inseted on LSB+1 position. Data is XOR'ed with PRBS
 415
 416        Raises:
 417            None
 418
 419        Returns:
 420            None
 421        """
 422        self.device.SET_LVDS_DATA_DITH_MODE(value)
 423
 424    def dout0_mux(self, data: int) -> None:
 425        """Configures the digital data output on LVDS lane 0
 426
 427        Arguments:
 428            data:
 429                The internal digital data bus lane that is being mapped
 430
 431        Raises:
 432            None
 433
 434        Returns:
 435            None
 436        """
 437        self.device.SET_LANE0_MUX_SEL(data)
 438
 439    def dout1_mux(self, data: int) -> None:
 440        """Configures the digital data output on LVDS lane 1
 441
 442        Arguments:
 443            data:
 444                The internal digital data bus lane that is being mapped
 445
 446        Raises:
 447            None
 448
 449        Returns:
 450            None
 451        """
 452        self.device.SET_LANE1_MUX_SEL(data)
 453
 454    def dout2_mux(self, data: int) -> None:
 455        """Configures the digital data output on LVDS lane 2
 456
 457        Arguments:
 458            data:
 459                The internal digital data bus lane that is being mapped
 460
 461        Raises:
 462            None
 463
 464        Returns:
 465            None
 466        """
 467        self.device.SET_LANE2_MUX_SEL(data)
 468
 469    def dout3_mux(self, data: int) -> None:
 470        """Configures the digital data output on LVDS lane 3
 471
 472        Arguments:
 473            data:
 474                The internal digital data bus lane that is being mapped
 475
 476        Raises:
 477            None
 478
 479        Returns:
 480            None
 481        """
 482        self.device.SET_LANE3_MUX_SEL(data)
 483
 484    def dout4_mux(self, data: int) -> None:
 485        """Configures the digital data output on LVDS lane 4
 486
 487        Arguments:
 488            data:
 489                The internal digital data bus lane that is being mapped
 490
 491        Raises:
 492            None
 493
 494        Returns:
 495            None
 496        """
 497        self.device.SET_LANE4_MUX_SEL(data)
 498
 499    def dout5_mux(self, data: int) -> None:
 500        """Configures the digital data output on LVDS lane 5
 501
 502        Arguments:
 503            data:
 504                The internal digital data bus lane that is being mapped
 505
 506        Raises:
 507            None
 508
 509        Returns:
 510            None
 511        """
 512        self.device.SET_LANE5_MUX_SEL(data)
 513
 514    def dout6_mux(self, data: int) -> None:
 515        """Configures the digital data output on LVDS lane 6
 516
 517        Arguments:
 518            data:
 519                The internal digital data bus lane that is being mapped
 520
 521        Raises:
 522            None
 523
 524        Returns:
 525            None
 526        """
 527        self.device.SET_LANE6_MUX_SEL(data)
 528
 529    def dout7_mux(self, data: int) -> None:
 530        """Configures the digital data output on LVDS lane 7
 531
 532        Arguments:
 533            data:
 534                The internal digital data bus lane that is being mapped
 535
 536        Raises:
 537            None
 538
 539        Returns:
 540            None
 541        """
 542        self.device.SET_LANE7_MUX_SEL(data)
 543
 544    def dout8_mux(self, data: int) -> None:
 545        """Configures the digital data output on LVDS lane 8
 546
 547        Arguments:
 548            data:
 549                The internal digital data bus lane that is being mapped
 550
 551        Raises:
 552            None
 553
 554        Returns:
 555            None
 556        """
 557        self.device.SET_LANE8_MUX_SEL(data)
 558
 559    def dout9_mux(self, data: int) -> None:
 560        """Configures the digital data output on LVDS lane 9
 561
 562        Arguments:
 563            data:
 564                The internal digital data bus lane that is being mapped
 565
 566        Raises:
 567            None
 568
 569        Returns:
 570            None
 571        """
 572        self.device.SET_LANE9_MUX_SEL(data)
 573
 574    def dout10_mux(self, data: int) -> None:
 575        """Configures the digital data output on LVDS lane 10
 576
 577        Arguments:
 578            data:
 579                The internal digital data bus lane that is being mapped
 580
 581        Raises:
 582            None
 583
 584        Returns:
 585            None
 586        """
 587        self.device.SET_LANE10_MUX_SEL(data)
 588
 589    def dout11_mux(self, data: int) -> None:
 590        """Configures the digital data output on LVDS lane 11
 591
 592        Arguments:
 593            data:
 594                The internal digital data bus lane that is being mapped
 595
 596        Raises:
 597            None
 598
 599        Returns:
 600            None
 601        """
 602        self.device.SET_LANE11_MUX_SEL(data)
 603
 604    def dout12_mux(self, data: int) -> None:
 605        """Configures the digital data output on LVDS lane 12
 606
 607        Arguments:
 608            data:
 609                The internal digital data bus lane that is being mapped
 610
 611        Raises:
 612            None
 613
 614        Returns:
 615            None
 616        """
 617        self.device.SET_LANE12_MUX_SEL(data)
 618
 619    def dout13_mux(self, data: int) -> None:
 620        """Configures the digital data output on LVDS lane 13
 621
 622        Arguments:
 623            data:
 624                The internal digital data bus lane that is being mapped
 625
 626        Raises:
 627            None
 628
 629        Returns:
 630            None
 631        """
 632        self.device.SET_LANE13_MUX_SEL(data)
 633
 634    def dout14_mux(self, data: int) -> None:
 635        """Configures the digital data output on LVDS lane 14
 636
 637        Arguments:
 638            data:
 639                The internal digital data bus lane that is being mapped
 640
 641        Raises:
 642            None
 643
 644        Returns:
 645            None
 646        """
 647        self.device.SET_LANE14_MUX_SEL(data)
 648
 649    def dout15_mux(self, data: int) -> None:
 650        """Configures the digital data output on LVDS lane 15
 651
 652        Arguments:
 653            data:
 654                The internal digital data bus lane that is being mapped
 655
 656        Raises:
 657            None
 658
 659        Returns:
 660            None
 661        """
 662        self.device.SET_LANE15_MUX_SEL(data)
 663
 664    def high_fin(self, value: int) -> None:
 665        """Enable for best AC performance for input frequencies greater than 500 MHz
 666
 667        Arguments:
 668            value: input value
 669                - 0: Normal operation
 670                - 1: Performance optimized for input frequencies greater than 500 MHz
 671
 672        Raises:
 673            None
 674
 675        Returns:
 676            None
 677        """
 678        self.device.SET_DIS_ANA_NL_CORR(value)
 679
 680    def sysref_detect(self) -> int:
 681        """Indicates if a SYSREF signal is detected. Upon detection this bit stays high until it gets reset (0x102, D6) or a device reset is issued.
 682
 683        Arguments:
 684            None
 685
 686        Raises:
 687            None
 688
 689        Returns:
 690            Status of the Sysref signal
 691            
 692            - 0: No Sysref signal detected
 693            - 1: Sysref signal detected
 694        """
 695        return self.device.GET_SYSREF_DET()
 696
 697    def sysref_or(self) -> int:
 698        """Output of the five SYSREF XOR flags logically OR'ed together
 699
 700        Arguments:
 701            None
 702
 703        Raises:
 704            None
 705
 706        Returns:
 707            Status of the SYSREF flags OR'ed together
 708            
 709            - 0: No sysref flags raised
 710            - 1: One of the five XOR flags is raised
 711        """
 712        return self.device.GET_SYSREF_OR()
 713
 714    def sysref_xor(self) -> int:
 715        """XOR flags from the SYSREF window monitoring circuitry. 
 716        
 717        The sampling clock falling edge is used to capture the SYSREF signal.
 718        If a SYSREF signal transition happens within -60/+140 ps of the SYSREF capture, the appropriate XOR flag gets raised.
 719        These bits are updated on every SYSREF rising edge.
 720
 721        Arguments:
 722            None
 723
 724        Raises:
 725            None
 726
 727        Returns:
 728            List of 5 flags as follows
 729
 730            - X0: SYSREF leading sample clock by 20 to 60ps
 731            - X1: SYSREF leading sample clock by 20ps to 0ps or SYSREF lagging sample clock by 0 to 20ps
 732            - X2: SYSREF lagging sample clock by up to 20 to 60ps
 733            - X3: SYSREF lagging sample clock by 60 to 100ps
 734            - X4: SYSREF lagging sample clock by 100 to 140ps
 735
 736            With the corresponding values:
 737            - 0: Flag not raised
 738            - 1: Flag raised
 739        """
 740        return self.device.GET_SYSREF_XOR()
 741
 742    def gpio_config(self, value: int) -> None:
 743        """Configures the functionaliy of the two GPIO pins
 744
 745        Arguments:
 746            value: input value
 747            
 748        | Value  | GPIO 1              | GPIO 0              |
 749        |:------:|:-------------------:|:-------------------:|
 750        | 0      | NOT USED            | SYSREF              |
 751        | 3      | GLOBAL POWER DOWN   | SYSREF              |
 752        | 4      | EXTERNAL REFERENCE  | SYSREF              |
 753        | 5      | NCO SWITCH 1        | NCO SWITCH 0        |
 754        | 8      | NOT USED            | SYSREF              |
 755        | 9      | OVR CHB/CHA         | SYSREF              |
 756        | 10     | NOT USED            | GLOBAL POWER DOWN   |
 757        | 11     | OVR CHB/CHA         | GLOBAL POWER DOWN   |
 758        | 12     | OVR CHB             | OVR CHA             |
 759
 760        Raises:
 761            None
 762
 763        Returns:
 764            None
 765        """
 766        self.device.SET_GPIO_CONFIG(value)
 767
 768    def pattern_clk(self, value: int) -> None:
 769        """Controls the clock of the pattern signal generator.
 770
 771        Arguments:
 772            value: input value
 773                - 0: Normal operation
 774                - 1: Decimation CLK is used for the pattern generator
 775
 776        Raises:
 777            None
 778
 779        Returns:
 780            None
 781        """
 782        self.device.SET_PATTERN_CLK(value)
 783
 784    def test_pattern(self, value: int) -> None:
 785        """Controls the type of test pattern.
 786        
 787        The generated pattern is 20 bits wide. In 16 bit resolution mode, 16 MSBs of the pattern mode are sent out.
 788        In 32 bit resolution mode, 12 zeros are padded to the generated pattern and sent out.
 789
 790        Arguments:
 791            value: input value
 792                - 0: Test pattern is disabled
 793                - 1: Ramp pattern with a step of 1 (at 20 bit level, which is equivalent to 1/16 at 16 bit level)
 794                - 2: Ramp pattern with a step value set by CUSTOM PATTERN.
 795                - 3: Not used
 796                - 4: Static pattern set by CUSTOM PATTERN
 797                - 5: Pattern toggles between CUSTOM PATTERN and invert of CUSTOM PATTERN
 798                - 6: Pattern toggles between CUSTOM PATTERN and 0
 799
 800        Raises:
 801            None
 802
 803        Returns:
 804            None
 805        """
 806        self.device.SET_TEST_PATTERN_MODE(value)
 807
 808    def custom_pattern(self, value: int) -> None:
 809        """Controls the pattern generator. This controls different functions depending on the TEST PATTERN setting
 810
 811        Arguments:
 812            value:
 813                20-bit custom pattern data
 814
 815        Raises:
 816            None
 817
 818        Returns:
 819            None
 820        """
 821        # if value != 0:
 822        #     if not ((int(log(value, 2)) + 1) <= 20):
 823        #         raise Exception("Custom pattern value must be 20 bits long or less")
 824        self.device.SET_CUSTOM_PATTERN(value)
 825
 826    def digital_gain_cha(self, value: int) -> None:
 827        """Controls digital gain for channel A. Maximum gain is 6dB.
 828
 829        Arguments:
 830            value:
 831                Desired value to write into the register, where:
 832                Gain = (20 x log(1+(Value / 128)))
 833
 834        Raises:
 835            None
 836
 837        Returns:
 838            None
 839        """
 840        self.device.SET_CH0_PROG_GAIN(value)
 841
 842    def digital_gain_chb(self, value: int) -> None:
 843        """Controls digital gain for channel B. Maximum gain is 6dB.
 844
 845        Arguments:
 846            value:
 847                Desired value to write into the register, where:
 848                Gain = (20 x log(1+(Value / 128)))
 849
 850        Raises:
 851            None
 852
 853        Returns:
 854            None
 855        """
 856        self.device.SET_CH1_PROG_GAIN(value)
 857
 858    def sysref_mode(self, value: int) -> None:
 859        """Controls the global SYSREF mask
 860
 861        Arguments:
 862            value: input value
 863                - 0: Pass all SYSREF pulses
 864                - 1: Pass the first SYSREF pulse and gates subsequent pulses
 865                - 2: Gate all SYSREF pulses
 866                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
 867
 868        Raises:
 869            None
 870
 871        Returns:
 872            None
 873        """
 874        self.device.SET_SYSREF_MODE(value)
 875
 876    def lvds_sysref_mask(self, value: int) -> None:
 877        """Controls the SYSREF pulse going to the LVDS block.
 878
 879        Arguments:
 880            value: input value
 881                - 0: Pass all SYSREF pulses
 882                - 1: Pass the first SYSREF pulse and gates subsequent pulses
 883                - 2: Gate all SYSREF pulses
 884                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
 885
 886        Raises:
 887            None
 888
 889        Returns:
 890            None
 891        """
 892        self.device.SET_LVDS_SYSREF_MASK(value)
 893
 894    def ddc_sysref_mask(self, value: int) -> None:
 895        """Controls the SYSREF pulse of DDC block.
 896
 897        Arguments:
 898            value: input value
 899                - 0: Pass all SYSREF pulses
 900                - 1: Pass the first SYSREF pulse and gates subsequent pulses
 901                - 2: Gate all SYSREF pulses
 902                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
 903
 904        Raises:
 905            None
 906
 907        Returns:
 908            None
 909        """
 910        self.device.SET_DECIMATION_SYSREF_MASK(value)
 911
 912    def nco_sysref_mask(self, value: int) -> None:
 913        """Controls the SYSREF pulse of NCO block.
 914
 915        Arguments:
 916            value: input value
 917                - 0: Pass all SYSREF pulses
 918                - 1: Pass the first SYSREF pulse and gates subsequent pulses
 919                - 2: Gate all SYSREF pulses
 920                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
 921
 922        Raises:
 923            None
 924
 925        Returns:
 926            None
 927        """
 928        self.device.SET_NCO_SYSREF_MASK(value)
 929
 930    def timer_sysref_mask(self, value: int) -> None:
 931        """Controls the SYSREF pulse of TIMER block.
 932
 933        Arguments:
 934            value: input value
 935                - 0: Pass all SYSREF pulses
 936                - 1: Pass the first SYSREF pulse and gates subsequent pulses
 937                - 2: Gate all SYSREF pulses
 938                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
 939
 940        Raises:
 941            None
 942
 943        Returns:
 944            None
 945        """
 946        self.device.SET_TIMER_SYSREF_MASK(value)
 947
 948    def sysref_time_stamp(self, value: int) -> None:
 949        """Allows the SYSREF to be passed on the FRAME_INDICATOR lane. OVR_ON_LSB setting takes precedence
 950
 951        Arguments:
 952            value: input value
 953                - 0: Normal operation
 954                - 3: Pass sysref time stamp on the frame indicator lane
 955
 956        Raises:
 957            None
 958
 959        Returns:
 960            None
 961        """
 962        self.device.SET_SYSREF_TIME_STAMP(value)
 963
 964    def gain_override(self, value: int) -> None:
 965        """Controls 6dB gain setting of the DDC. The 6dB gain is applied in COMPLEX DDC mode by default. This will force 6 dB gain on the DDC output, irrespective of the DDC mode
 966
 967        Arguments:
 968            value: input value
 969                - 0: Normal operation
 970                - 2: Unity gain
 971                - 3: 6dB gain override
 972
 973        Raises:
 974            None
 975
 976        Returns:
 977            None
 978        """
 979        self.device.SET_SIX_DB_GAIN_OVERRIDE(value)
 980
 981    def complex_decimation(self, value: int) -> None:
 982        """Enables/disables complex decimation for all DDCs.
 983
 984        Arguments:
 985            value: input value
 986                - 0: Real Deciamtion
 987                - 1: Complex Decimation
 988
 989        Raises:
 990            None
 991
 992        Returns:
 993            None
 994        """
 995        self.device.SET_EN_COMPLEX_DDC(value)
 996
 997    def output_resolution(self, value: int) -> None:
 998        """Configures the output resolution for 16-bit or 32-bit
 999
1000        Arguments:
1001            value: input value
1002                - 0: 16-bit output resolution
1003                - 1: 32-bit output resolution
1004
1005        Raises:
1006            None
1007
1008        Returns:
1009            None
1010        """
1011        self.device.SET_OUTPUT_RESOLUTION(value)
1012
1013    def output_format(self, value: int) -> None:
1014        """Configures the output data format
1015
1016        Arguments:
1017            value: input value
1018                - 0: Output format is 2s complement
1019                - 1: Output format is offset binary
1020
1021        Raises:
1022            None
1023
1024        Returns:
1025            None
1026        """
1027        self.device.SET_OUTPUT_FORMAT(value)
1028
1029    def ddc0_mux(self, input: int) -> None:
1030        """Sets the input data source to decimation filter 0.
1031
1032        Arguments:
1033            ddc:
1034                The DDC for which the input data source is being configured
1035            input:
1036                Input to the DDC
1037                - 0: Channel A
1038                - 1: Channel B
1039                - 2: 2x Average ((ChA + ChB)/2)
1040                - 3: 2x Average ((ChA - ChB)/2)
1041
1042        Raises:
1043            None
1044
1045        Returns:
1046            None
1047        """
1048        self.device.SET_DDC0_MUX(input)
1049
1050    def ddc1_mux(self, input: int) -> None:
1051        """Sets the input data source to decimation filter 1.
1052
1053        Arguments:
1054            ddc:
1055                The DDC for which the input data source is being configured
1056            input:
1057                Input to the DDC
1058                - 0: Channel B
1059                - 1: Channel A
1060                - 2: 2x Average ((ChA + ChB)/2)
1061                - 3: 2x Average ((ChA - ChB)/2)
1062
1063        Raises:
1064            None
1065
1066        Returns:
1067            None
1068        """
1069        self.device.SET_DDC1_MUX(input)
1070
1071    def ddc2_mux(self, input: int) -> None:
1072        """Sets the input data source to decimation filter 2.
1073
1074        Arguments:
1075            ddc:
1076                The DDC for which the input data source is being configured
1077            input:
1078                Input to the DDC
1079                - 0: Channel A
1080                - 1: Channel B
1081                - 2: 2x Average ((ChA + ChB)/2)
1082                - 3: 2x Average ((ChA - ChB)/2)
1083
1084        Raises:
1085            None
1086
1087        Returns:
1088            None
1089        """
1090        self.device.SET_DDC2_MUX(input)
1091
1092    def ddc3_mux(self, input: int) -> None:
1093        """Sets the input data source to decimation filter 3.
1094
1095        Arguments:
1096            ddc:
1097                The DDC for which the input data source is being configured
1098            input:
1099                Input to the DDC
1100                - 0: Channel B
1101                - 1: Channel A
1102                - 2: 2x Average ((ChA + ChB)/2)
1103                - 3: 2x Average ((ChA - ChB)/2)
1104
1105        Raises:
1106            None
1107
1108        Returns:
1109            None
1110        """
1111        self.device.SET_DDC3_MUX(input)
1112
1113    def nco0_update(self, value: int) -> None:
1114        """Updates the four NCO frequencies of NCO0.
1115
1116        Arguments:
1117            value: input value
1118                - 0: Normal operation
1119                - 1: Update NCO0 frequencies
1120
1121        Raises:
1122            None
1123
1124        Returns:
1125            None
1126        """
1127        self.device.SET_NCO0_UPDATE(value)
1128
1129    def nco1_update(self, value: int) -> None:
1130        """Updates the four NCO frequencies of NCO1.
1131
1132        Arguments:
1133            value: input value
1134                - 0: Normal operation
1135                - 1: Update NCO1 frequencies
1136
1137        Raises:
1138            None
1139
1140        Returns:
1141            None
1142        """
1143        self.device.SET_NCO1_UPDATE(value)
1144
1145    def nco2_update(self, value: int) -> None:
1146        """Updates the four NCO frequencies of NCO2.
1147
1148        Arguments:
1149            value: input value
1150                - 0: Normal operation
1151                - 1: Update NCO2 frequencies
1152
1153        Raises:
1154            None
1155
1156        Returns:
1157            None
1158        """
1159        self.device.SET_NCO2_UPDATE(value)
1160
1161    def nco3_update(self, value: int) -> None:
1162        """Updates the four NCO frequencies of NCO3.
1163
1164        Arguments:
1165            value: input value
1166                - 0: Normal operation
1167                - 1: Update NCO3 frequencies
1168
1169        Raises:
1170            None
1171
1172        Returns:
1173            None
1174        """
1175        self.device.SET_NCO3_UPDATE(value)
1176
1177    def select_negative_image(self, value: int) -> None:
1178        """Controls the selection of the negative frequency image. Applicable only in Complex DDC mode.
1179
1180        Arguments:
1181            value: input value
1182                - 0: Normal operation
1183                - 1: Negative image
1184
1185        Raises:
1186            None
1187
1188        Returns:
1189            None
1190        """
1191        self.device.SET_NCO_SEL_NEG_IMAGE(value)
1192
1193    def nco_mode(self, value: int) -> None:
1194        """Configures the NCOs operating mode.
1195
1196        Arguments:
1197            value: input value
1198                - 0: Phase continuous
1199                - 1: Infinite phase coherent
1200
1201        Raises:
1202            None
1203
1204        Returns:
1205            None
1206        """
1207        self.device.SET_NCO_MODE(value)
1208
1209    def low_latency_enable(self, value: int) -> None:
1210        """Enables low latency mode by byapssing all digital features
1211
1212        Arguments:
1213            value: input value
1214                - 0: Normal Operation
1215                - 1: Low Latency Mode
1216
1217        Raises:
1218            None
1219
1220        Returns:
1221            None
1222        """
1223        self.device.SET_ENABLE_LOW_LATENCY(value)
1224
1225    def disable_nco_auto_update(self, value: int) -> None:
1226        """Disables the automatic update when switching the NCOs using GPIO pins
1227
1228        Arguments:
1229            value: input value
1230                - 0: Automatic update enabled
1231                - 1: Automatic update disabled
1232
1233        Raises:
1234            None
1235
1236        Returns:
1237            None
1238        """
1239        self.device.SET_DISABLE_NCO_AUTO_UPDATE(value)
1240
1241    def nco_select_enable(self, value: int) -> None:
1242        """This bit enables NCO frequency selection via SPI register 0x166 instead of GPIO pins.
1243
1244        Arguments:
1245            value: input value
1246                - 0: NCO Select via GPIO Pins
1247                - 1: NCO Select via SPI Write
1248
1249        Raises:
1250            None
1251
1252        Returns:
1253            None
1254        """
1255        self.device.SET_ENABLE_NCO_SEL(value)
1256
1257    def nco_common_update(self, value: int) -> None:
1258        """Updates the four NCO frequencies of all NCOs.
1259
1260        Arguments:
1261            value: input value
1262                - 0: Normal operation
1263                - 1: Update NCO frequencies
1264
1265        Raises:
1266            None
1267
1268        Returns:
1269            None
1270        """
1271        self.device.SET_NCO_COMMON_UPDATE(value)
1272
1273    def ddc0_nco_select(self, nco: int) -> None:
1274        """Selects which of the 4 frequencies is active for DDC0.
1275
1276        Arguments:
1277            nco:
1278                NCO word to set as the active frequency
1279
1280        Raises:
1281            None
1282
1283        Returns:
1284            None
1285        """
1286        self.device.SET_DDC0_NCO_SEL(nco)
1287
1288    def ddc1_nco_select(self, nco: int) -> None:
1289        """Selects which of the 4 frequencies is active for DDC1.
1290
1291        Arguments:
1292            nco:
1293                NCO word to set as the active frequency
1294
1295        Raises:
1296            None
1297
1298        Returns:
1299            None
1300        """
1301        self.device.SET_DDC1_NCO_SEL(nco)
1302
1303    def ddc2_nco_select(self, nco: int) -> None:
1304        """Selects which of the 4 frequencies is active for DDC2.
1305
1306        Arguments:
1307            nco:
1308                NCO word to set as the active frequency
1309
1310        Raises:
1311            None
1312
1313        Returns:
1314            None
1315        """
1316        self.device.SET_DDC2_NCO_SEL(nco)
1317
1318    def ddc3_nco_select(self, nco: int) -> None:
1319        """Selects which of the 4 frequencies is active for DDC3.
1320
1321        Arguments:
1322            nco:
1323                NCO word to set as the active frequency
1324
1325        Raises:
1326            None
1327
1328        Returns:
1329            None
1330        """
1331        self.device.SET_DDC3_NCO_SEL(nco)
1332
1333    def ddc0_decimation(self, value: int) -> None:
1334        """Sets the decimation filter factors for DDC0 when using unequal decimation factors.
1335
1336        Arguments:
1337            value:
1338                value to write to the register such that Decimation Factor = 2^value.
1339
1340        Raises:
1341            None
1342
1343        Returns:
1344            None
1345        """
1346        self.device.SET_DDC0_DECIMATION_MODE(value)
1347
1348    def ddc1_decimation(self, value: int) -> None:
1349        """Sets the decimation filter factors for DDC1 when using unequal decimation factors.
1350
1351        Arguments:
1352            value:
1353                value to write to the register such that Decimation Factor = 2^value.
1354
1355        Raises:
1356            None
1357
1358        Returns:
1359            None
1360        """
1361        self.device.SET_DDC1_DECIMATION_MODE(value)
1362
1363    def ddc2_decimation(self, value: int) -> None:
1364        """Sets the decimation filter factors for DDC2 when using unequal decimation factors.
1365
1366        Arguments:
1367            value:
1368                value to write to the register such that Decimation Factor = 2^value.
1369
1370        Raises:
1371            None
1372
1373        Returns:
1374            None
1375        """
1376        self.device.SET_DDC2_DECIMATION_MODE(value)
1377
1378    def ddc3_decimation(self, value: int) -> None:
1379        """Sets the decimation filter factors for DDC3 when using unequal decimation factors.
1380
1381        Arguments:
1382            value:
1383                value to write to the register such that Decimation Factor = 2^value.
1384
1385        Raises:
1386            None
1387
1388        Returns:
1389            None
1390        """
1391        self.device.SET_DDC3_DECIMATION_MODE(value)
1392
1393    def unequal_decimation(self, value: int) -> None:
1394        """Enables configuration of DDC0 thru DDC3 to have unequal decimation factors.
1395
1396        Arguments:
1397            value: input value
1398                - 0: Normal operation
1399                - 1: Unequal decimation factors enabled
1400
1401        Raises:
1402            None:
1403
1404        Returns:
1405            None
1406        """
1407        self.device.SET_SELECT_INDEPENDENT_DECIMATION(value)
1408
1409    def number_of_ddcs(self, value: int) -> None:
1410        """This register configures the # of active DDCs.
1411
1412        Arguments:
1413            value: input value
1414                - 0: Single DDC per channel (Total two DDCs are enabled)
1415                - 1: Dual DDCs per channel (Total 4 DDCs are enabled)
1416                - 2: Just one DDC is enabled (1 DDC is active)
1417                - 3: Dual DDC for a single channel (Total two DDCs are enabled)
1418
1419        Raises:
1420            None
1421
1422        Returns:
1423            None
1424        """
1425        lsb = value & 1
1426        msb = value >> 1
1427        self.device.SET_EN_DUAL_BAND(lsb)
1428        self.device.SET_DIS_DUAL_CHANNEL(msb)
1429
1430    def common_decimation(self, value: int) -> None:
1431        """Sets the decimation filter factor for all active DDCs.
1432
1433        Arguments:
1434            value:
1435                value to write to the register such that Decimation Factor = 2^value.
1436
1437        Raises:
1438            None
1439
1440        Returns:
1441            None
1442        """
1443        self.device.SET_COMMON_DECIMATION_MODE(value)
1444
1445    def update_nyqusit_zone(self, value: int) -> None:
1446        """Must be pulsed after the Nyquist zone if programmed.
1447        
1448        A 0 to 1 transition on this bit copies the NYQUIST ZONE field to an internal register.
1449
1450        Argument:
1451            value: input value
1452                - 0: Normal Operation
1453                - 1: Nyquist zone value is updated
1454
1455        Raises:
1456            None
1457
1458        Returns:
1459            None
1460        """
1461        self.device.SET_UPDATE_NYQUIST(value)
1462
1463    def nyquist_zone(self, value: int) -> None:
1464        """Sets the nyquist zone of operation.
1465        
1466        The internal calibration of the device depends on the NYQUIST ZONE of the signal being sampled.
1467        This field must be programmed based on the operating Nyquist zone.
1468
1469        Arguments:
1470            value:
1471                Operating nyquist zone (0 - 7)
1472
1473        Raises:
1474            None
1475
1476        Returns:
1477            None
1478        """
1479        self.device.SET_NYQUIST_ZONE(value)
1480
1481    def ddc0_nco_frequency0(self, value: int) -> None:
1482        """Configures the 48-bit NCO frequency word 0 of DDC0.
1483
1484        Arguments:
1485            value:
1486                Value to write to the NCO frequency word, such that:\n
1487                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1488                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1489
1490        Raises:
1491            None
1492
1493        Returns:
1494            None
1495        """
1496        self.device.SET_DDC0_NCO_FREQ0(value)
1497
1498    def ddc0_nco_frequency1(self, value: int) -> None:
1499        """Configures the 48-bit NCO frequency word 1 of DDC0.
1500
1501        Arguments:
1502            value:
1503                Value to write to the NCO frequency word, such that:\n
1504                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1505                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1506
1507        Raises:
1508            None
1509
1510        Returns:
1511            None
1512        """
1513        self.device.SET_DDC0_NCO_FREQ1(value)
1514
1515    def ddc0_nco_frequency2(self, value: int) -> None:
1516        """Configures the 48-bit NCO frequency word 2 of DDC0.
1517
1518        Arguments:
1519            value:
1520                Value to write to the NCO frequency word, such that:\n
1521                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1522                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1523
1524        Raises:
1525            None
1526
1527        Returns:
1528            None
1529        """
1530        self.device.SET_DDC0_NCO_FREQ2(value)
1531
1532    def ddc0_nco_frequency3(self, value: int) -> None:
1533        """Configures the 48-bit NCO frequency word 3 of DDC0.
1534
1535        Arguments:
1536            value:
1537                Value to write to the NCO frequency word, such that:\n
1538                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1539                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1540
1541        Raises:
1542            None
1543
1544        Returns:
1545            None
1546        """
1547        self.device.SET_DDC0_NCO_FREQ3(value)
1548
1549    def ddc1_nco_frequency0(self, value: int) -> None:
1550        """Configures the 48-bit NCO frequency word 0 of DDC1.
1551
1552        Arguments:
1553            value:
1554                Value to write to the NCO frequency word, such that:\n
1555                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1556                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1557
1558        Raises:
1559            None
1560
1561        Returns:
1562            None
1563        """
1564        self.device.SET_DDC1_NCO_FREQ0(value)
1565
1566    def ddc1_nco_frequency1(self, value: int) -> None:
1567        """Configures the 48-bit NCO frequency word 1 of DDC1.
1568
1569        Arguments:
1570            value:
1571                Value to write to the NCO frequency word, such that:\n
1572                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1573                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1574
1575        Raises:
1576            None
1577
1578        Returns:
1579            None
1580        """
1581        self.device.SET_DDC1_NCO_FREQ1(value)
1582
1583    def ddc1_nco_frequency2(self, value: int) -> None:
1584        """Configures the 48-bit NCO frequency word 2 of DDC1.
1585
1586        Arguments:
1587            value:
1588                Value to write to the NCO frequency word, such that:\n
1589                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1590                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1591
1592        Raises:
1593            None
1594
1595        Returns:
1596            None
1597        """
1598        self.device.SET_DDC1_NCO_FREQ2(value)
1599
1600    def ddc1_nco_frequency3(self, value: int) -> None:
1601        """Configures the 48-bit NCO frequency word 3 of DDC1.
1602
1603        Arguments:
1604            value:
1605                Value to write to the NCO frequency word, such that:\n
1606                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1607                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1608
1609        Raises:
1610            None
1611
1612        Returns:
1613            None
1614        """
1615        self.device.SET_DDC1_NCO_FREQ3(value)
1616
1617    def ddc2_nco_frequency0(self, value: int) -> None:
1618        """Configures the 48-bit NCO frequency word 0 of DDC2.
1619
1620        Arguments:
1621            value:
1622                Value to write to the NCO frequency word, such that:\n
1623                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1624                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1625
1626        Raises:
1627            None
1628
1629        Returns:
1630            None
1631        """
1632        self.device.SET_DDC2_NCO_FREQ0(value)
1633
1634    def ddc2_nco_frequency1(self, value: int) -> None:
1635        """Configures the 48-bit NCO frequency word 1 of DDC2.
1636
1637        Arguments:
1638            value:
1639                Value to write to the NCO frequency word, such that:\n
1640                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1641                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1642
1643        Raises:
1644            None
1645
1646        Returns:
1647            None
1648        """
1649        self.device.SET_DDC2_NCO_FREQ1(value)
1650
1651    def ddc2_nco_frequency2(self, value: int) -> None:
1652        """Configures the 48-bit NCO frequency word 2 of DDC2.
1653
1654        Arguments:
1655            value:
1656                Value to write to the NCO frequency word, such that:\n
1657                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1658                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1659
1660        Raises:
1661            None
1662
1663        Returns:
1664            None
1665        """
1666        self.device.SET_DDC2_NCO_FREQ2(value)
1667
1668    def ddc2_nco_frequency3(self, value: int) -> None:
1669        """Configures the 48-bit NCO frequency word 3 of DDC2.
1670
1671        Arguments:
1672            value:
1673                Value to write to the NCO frequency word, such that:\n
1674                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1675                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1676
1677        Raises:
1678            None
1679
1680        Returns:
1681            None
1682        """
1683        self.device.SET_DDC2_NCO_FREQ3(value)
1684
1685    def ddc3_nco_frequency0(self, value: int) -> None:
1686        """Configures the 48-bit NCO frequency word 0 of DDC3.
1687
1688        Arguments:
1689            value:
1690                Value to write to the NCO frequency word, such that:\n
1691                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1692                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1693
1694        Raises:
1695            None
1696
1697        Returns:
1698            None
1699        """
1700        self.device.SET_DDC3_NCO_FREQ0(value)
1701
1702    def ddc3_nco_frequency1(self, value: int) -> None:
1703        """Configures the 48-bit NCO frequency word 1 of DDC3.
1704
1705        Arguments:
1706            value:
1707                Value to write to the NCO frequency word, such that:\n
1708                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1709                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1710
1711        Raises:
1712            None
1713
1714        Returns:
1715            None
1716        """
1717        self.device.SET_DDC3_NCO_FREQ1(value)
1718
1719    def ddc3_nco_frequency2(self, value: int) -> None:
1720        """Configures the 48-bit NCO frequency word 2 of DDC3.
1721
1722        Arguments:
1723            value:
1724                Value to write to the NCO frequency word, such that:\n
1725                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1726                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1727
1728        Raises:
1729            None
1730
1731        Returns:
1732            None
1733        """
1734        self.device.SET_DDC3_NCO_FREQ2(value)
1735
1736    def ddc3_nco_frequency3(self, value: int) -> None:
1737        """Configures the 48-bit NCO frequency word 3 of DDC3.
1738
1739        Arguments:
1740            value:
1741                Value to write to the NCO frequency word, such that:\n
1742                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1743                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1744
1745        Raises:
1746            None
1747
1748        Returns:
1749            None
1750        """
1751        self.device.SET_DDC3_NCO_FREQ3(value)
1752
1753    def ddc0_nco_phase0(self, value: int) -> None:
1754        """Configures the starting phase for NCO Frequency 0 of DDC0
1755
1756        Arguments:
1757            value:
1758                Value to write to the NCO phase word, such that:
1759                value = 90° / Phase
1760        Raises:
1761            None
1762
1763        Returns:
1764            None
1765        """
1766        self.device.SET_DDC0_NCO_PHASE0(value)
1767
1768    def ddc0_nco_phase1(self, value: int) -> None:
1769        """Configures the starting phase for NCO Frequency 1 of DDC0
1770
1771        Arguments:
1772            value:
1773                Value to write to the NCO phase word, such that:
1774                value = 90° / Phase
1775        Raises:
1776            None
1777
1778        Returns:
1779            None
1780        """
1781        self.device.SET_DDC0_NCO_PHASE1(value)
1782
1783    def ddc0_nco_phase2(self, value: int) -> None:
1784        """Configures the starting phase for NCO Frequency 2 of DDC0
1785
1786        Arguments:
1787            value:
1788                Value to write to the NCO phase word, such that:
1789                value = 90° / Phase
1790        Raises:
1791            None
1792
1793        Returns:
1794            None
1795        """
1796        self.device.SET_DDC0_NCO_PHASE2(value)
1797
1798    def ddc0_nco_phase3(self, value: int) -> None:
1799        """Configures the starting phase for NCO Frequency 3 of DDC0
1800
1801        Arguments:
1802            value:
1803                Value to write to the NCO phase word, such that:
1804                value = 90° / Phase
1805        Raises:
1806            None
1807
1808        Returns:
1809            None
1810        """
1811        self.device.SET_DDC0_NCO_PHASE3(value)
1812
1813    def ddc1_nco_phase0(self, value: int) -> None:
1814        """Configures the starting phase for NCO Frequency 0 of DDC1
1815
1816        Arguments:
1817            value:
1818                Value to write to the NCO phase word, such that:
1819                value = 90° / Phase
1820        Raises:
1821            None
1822
1823        Returns:
1824            None
1825        """
1826        self.device.SET_DDC1_NCO_PHASE0(value)
1827
1828    def ddc1_nco_phase1(self, value: int) -> None:
1829        """Configures the starting phase for NCO Frequency 1 of DDC1
1830
1831        Arguments:
1832            value:
1833                Value to write to the NCO phase word, such that:
1834                value = 90° / Phase
1835        Raises:
1836            None
1837
1838        Returns:
1839            None
1840        """
1841        self.device.SET_DDC1_NCO_PHASE1(value)
1842
1843    def ddc1_nco_phase2(self, value: int) -> None:
1844        """Configures the starting phase for NCO Frequency 2 of DDC1
1845
1846        Arguments:
1847            value:
1848                Value to write to the NCO phase word, such that:
1849                value = 90° / Phase
1850        Raises:
1851            None
1852
1853        Returns:
1854            None
1855        """
1856        self.device.SET_DDC1_NCO_PHASE2(value)
1857
1858    def ddc1_nco_phase3(self, value: int) -> None:
1859        """Configures the starting phase for NCO Frequency 3 of DDC1
1860
1861        Arguments:
1862            value:
1863                Value to write to the NCO phase word, such that:
1864                value = 90° / Phase
1865        Raises:
1866            None
1867
1868        Returns:
1869            None
1870        """
1871        self.device.SET_DDC1_NCO_PHASE3(value)
1872
1873    def ddc2_nco_phase0(self, value: int) -> None:
1874        """Configures the starting phase for NCO Frequency 0 of DDC2
1875
1876        Arguments:
1877            value:
1878                Value to write to the NCO phase word, such that:
1879                value = 90° / Phase
1880        Raises:
1881            None
1882
1883        Returns:
1884            None
1885        """
1886        self.device.SET_DDC2_NCO_PHASE0(value)
1887
1888    def ddc2_nco_phase1(self, value: int) -> None:
1889        """Configures the starting phase for NCO Frequency 1 of DDC2
1890
1891        Arguments:
1892            value:
1893                Value to write to the NCO phase word, such that:
1894                value = 90° / Phase
1895        Raises:
1896            None
1897
1898        Returns:
1899            None
1900        """
1901        self.device.SET_DDC2_NCO_PHASE1(value)
1902
1903    def ddc2_nco_phase2(self, value: int) -> None:
1904        """Configures the starting phase for NCO Frequency 2 of DDC2
1905
1906        Arguments:
1907            value:
1908                Value to write to the NCO phase word, such that:
1909                value = 90° / Phase
1910        Raises:
1911            None
1912
1913        Returns:
1914            None
1915        """
1916        self.device.SET_DDC2_NCO_PHASE2(value)
1917
1918    def ddc2_nco_phase3(self, value: int) -> None:
1919        """Configures the starting phase for NCO Frequency 3 of DDC2
1920
1921        Arguments:
1922            value:
1923                Value to write to the NCO phase word, such that:
1924                value = 90° / Phase
1925        Raises:
1926            None
1927
1928        Returns:
1929            None
1930        """
1931        self.device.SET_DDC2_NCO_PHASE3(value)
1932
1933    def ddc3_nco_phase0(self, value: int) -> None:
1934        """Configures the starting phase for NCO Frequency 0 of DDC3
1935
1936        Arguments:
1937            value:
1938                Value to write to the NCO phase word, such that:
1939                value = 90° / Phase
1940        Raises:
1941            None
1942
1943        Returns:
1944            None
1945        """
1946        self.device.SET_DDC3_NCO_PHASE0(value)
1947
1948    def ddc3_nco_phase1(self, value: int) -> None:
1949        """Configures the starting phase for NCO Frequency 1 of DDC3
1950
1951        Arguments:
1952            value:
1953                Value to write to the NCO phase word, such that:
1954                value = 90° / Phase
1955        Raises:
1956            None
1957
1958        Returns:
1959            None
1960        """
1961        self.device.SET_DDC3_NCO_PHASE1(value)
1962
1963    def ddc3_nco_phase2(self, value: int) -> None:
1964        """Configures the starting phase for NCO Frequency 2 of DDC3
1965
1966        Arguments:
1967            value:
1968                Value to write to the NCO phase word, such that:
1969                value = 90° / Phase
1970        Raises:
1971            None
1972
1973        Returns:
1974            None
1975        """
1976        self.device.SET_DDC3_NCO_PHASE2(value)
1977
1978    def ddc3_nco_phase3(self, value: int) -> None:
1979        """Configures the starting phase for NCO Frequency 3 of DDC3
1980
1981        Arguments:
1982            value:
1983                Value to write to the NCO phase word, such that:
1984                value = 90° / Phase
1985        Raises:
1986            None
1987
1988        Returns:
1989            None
1990        """
1991        self.device.SET_DDC3_NCO_PHASE3(value)
1992
1993    def enable_dclk_divider(self, value: int) -> None:
1994        """Enables the Data Clock divider for higher decimation rates.
1995
1996        Arguments:
1997            value: input value
1998                - 0: DCLK divider is disabled. DCLK is equal to the Sample CLK
1999                - 1: DCLK divider is enabled. DCLK is divided down from Sample CLK
2000
2001        Raises:
2002            None
2003
2004        Returns:
2005            None
2006        """
2007        self.device.SET_DIG_CLK_DDC(value)
2008
2009    def dclk_powerdown(self, value: int) -> None:
2010        """Powers down the LVDS output clock.
2011
2012        Arguments:
2013            value: input value
2014                - 0: Normal operation
2015                - 1: Dclk powered down
2016
2017        Raises:
2018            None
2019
2020        Returns:
2021            None
2022        """
2023        self.device.SET_DCLK_PDN(value)
2024
2025    ######################################################################################################################################
2026    # ███╗   ███╗ █████╗  ██████╗██████╗  ██████╗ ███████╗
2027    # ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔═══██╗██╔════╝
2028    # ██╔████╔██║███████║██║     ██████╔╝██║   ██║███████╗
2029    # ██║╚██╔╝██║██╔══██║██║     ██╔══██╗██║   ██║╚════██║
2030    # ██║ ╚═╝ ██║██║  ██║╚██████╗██║  ██║╚██████╔╝███████║
2031    # ╚═╝     ╚═╝╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝
2032    ######################################################################################################################################
2033
2034    def pulse_overrange_clear(self) -> None:
2035        """Macro Function. Clears the Digital Overrange by pulsing a value of 2 on the OVR_CLR register field
2036
2037        Arguments:
2038            None
2039
2040        Raises:
2041            None
2042
2043        Returns:
2044            None
2045        """
2046        self.device.SET_DIG_OVR_CLEAR(0x0)
2047        sleep(0.1)
2048        self.device.SET_DIG_OVR_CLEAR(0x2)
2049        sleep(0.1)
2050        self.device.SET_DIG_OVR_CLEAR(0x0)
2051
2052    def invert_lvds_lanes(self, lanes: List[int]) -> None:
2053        """Macro Function. Inverts the polarity of individual LVDS output lanes.
2054
2055        Arguments:
2056            lanes:
2057                List of 16 lanes with the corresponding values:
2058                - 0: Polarity as shown in pin diagram.
2059                - 1: Polarity inverted
2060
2061        Raises:
2062            None
2063
2064        Returns:
2065            None
2066        """
2067        lanes = int("".join(map(str, lanes)), 2)
2068        self.device.SET_LVDS_DATA_INV(lanes)
2069
2070    def powerdown_lvds_lanes(self, lanes: List[int]) -> None:
2071        """Macro Function. Powers down the individual LVDS output lanes and puts LVDS pins into high impedance state.
2072
2073        Arguments:
2074            lanes:
2075                List of bits which enable or disable the LVDS lanes as follows
2076                - 0: Normal operation
2077                - 1: Powered down
2078
2079        Raises:
2080            None
2081
2082        Returns:
2083            None
2084        """
2085        lanes = int("".join(map(str, lanes)), 2)
2086        self.device.SET_LVDS_DATA_PDN(lanes)
2087
2088    def dout_mux(self, lane: int, data: int) -> None:
2089        """Macro Function. Configures the data bus assignments for each individual output lane
2090
2091        Arguments:
2092            lane:
2093                The DOUT output pin to be mapped to
2094            data:
2095                The internal digital data bus lane that is being mapped
2096
2097        Raises:
2098            None
2099
2100        Returns:
2101            None
2102        """
2103        if lane == 0:
2104            self.device.SET_LANE0_MUX_SEL(data)
2105        elif lane == 1:
2106            self.device.SET_LANE1_MUX_SEL(data)
2107        elif lane == 2:
2108            self.device.SET_LANE2_MUX_SEL(data)
2109        elif lane == 3:
2110            self.device.SET_LANE3_MUX_SEL(data)
2111        elif lane == 4:
2112            self.device.SET_LANE4_MUX_SEL(data)
2113        elif lane == 5:
2114            self.device.SET_LANE5_MUX_SEL(data)
2115        elif lane == 6:
2116            self.device.SET_LANE6_MUX_SEL(data)
2117        elif lane == 7:
2118            self.device.SET_LANE7_MUX_SEL(data)
2119        elif lane == 8:
2120            self.device.SET_LANE8_MUX_SEL(data)
2121        elif lane == 9:
2122            self.device.SET_LANE9_MUX_SEL(data)
2123        elif lane == 10:
2124            self.device.SET_LANE10_MUX_SEL(data)
2125        elif lane == 11:
2126            self.device.SET_LANE11_MUX_SEL(data)
2127        elif lane == 12:
2128            self.device.SET_LANE12_MUX_SEL(data)
2129        elif lane == 13:
2130            self.device.SET_LANE13_MUX_SEL(data)
2131        elif lane == 14:
2132            self.device.SET_LANE14_MUX_SEL(data)
2133        elif lane == 15:
2134            self.device.SET_LANE15_MUX_SEL(data)
2135
2136    def lvds_mirror_all(self, lane: int) -> None:
2137        """Macro Function. Mirrors all LVDS lanes to data of chosen lane
2138
2139        Arguments:
2140            lane:
2141                The desired lane data to mirror to all output lanes
2142
2143        Raises:
2144            None
2145
2146        Returns:
2147            None
2148        """
2149        for i in range(0, 16):
2150            self.dout_mux(i, lane)
2151
2152    def cha_digital_gain(self, value: int) -> None:
2153        """Macro Function. Controls digital gain for channel A. Maximum gain is 6dB.
2154
2155        Arguments:
2156            value:
2157                Desired gain value in dB
2158
2159        Raises:
2160            None
2161
2162        Returns:
2163            None
2164        """
2165        gain = 20 * log(1 + (value / 128), 10)
2166        self.device.SET_CH0_PROG_GAIN(gain)
2167
2168    def chb_digital_gain(self, value: int) -> None:
2169        """Macro Function. Controls digital gain for channel B. Maximum gain is 6dB.
2170
2171        Arguments:
2172            value:
2173                Desired gain value in dB
2174
2175        Raises:
2176            None
2177
2178        Returns:
2179            None
2180        """
2181        gain = 20 * log(1 + (value / 128), 10)
2182        self.device.SET_CH1_PROG_GAIN(gain)
2183
2184    def sysref_pulse(self) -> None:
2185        """Macro Function. Pulses the sysref signal
2186
2187        Arguments:
2188            None
2189
2190        Raises:
2191            None
2192
2193        Returns:
2194            None
2195        """
2196        self.sysref_mode(0)
2197        sleep(0.1)
2198        self.sysref_mode(3)
2199        sleep(0.1)
2200        self.sysref_mode(0)
2201
2202    def ddc_input_source(self, ddc: int, input: int) -> None:
2203        """Macro Function. Sets the input data source to each of the decimation filters.
2204
2205        Arguments:
2206            ddc:
2207                The DDC for which the input data source is being configured
2208            input:
2209                Input to the DDC
2210                - 0: Channel A
2211                - 1: Channel B
2212                - 2: 2x Average ((ChA + ChB)/2)
2213                - 3: 2x Average ((ChA - ChB)/2)
2214
2215        Raises:
2216            None
2217
2218        Returns:
2219            None
2220        """
2221        if ddc == 0:
2222            self.device.SET_DDC0_MUX(input)
2223        elif ddc == 1:
2224            if input == 0:
2225                input = 1
2226            elif input == 1:
2227                input = 0
2228            self.device.SET_DDC1_MUX(input)
2229        elif ddc == 2:
2230            self.device.SET_DDC2_MUX(input)
2231        elif ddc == 3:
2232            if input == 0:
2233                input = 1
2234            elif input == 1:
2235                input = 0
2236            self.device.SET_DDC3_MUX(input)
2237
2238    def nco_update(self, nco: int) -> None:
2239        """Macro Function. Updates the frequency of the selected NCO by pulsing a value of 1 on the corresponding NCO_UPDATE field
2240
2241        Arguments:
2242            nco:
2243                NCO that is being configured
2244
2245        Raises:
2246            None
2247
2248        Returns:
2249            None
2250        """
2251        if nco == 0:
2252            self.device.SET_NCO0_UPDATE(0)
2253            sleep(0.1)
2254            self.device.SET_NCO0_UPDATE(1)
2255            sleep(0.1)
2256            self.device.SET_NCO0_UPDATE(1)
2257        elif nco == 1:
2258            self.device.SET_NCO1_UPDATE(0)
2259            sleep(0.1)
2260            self.device.SET_NCO1_UPDATE(1)
2261            sleep(0.1)
2262            self.device.SET_NCO1_UPDATE(1)
2263        elif nco == 2:
2264            self.device.SET_NCO2_UPDATE(0)
2265            sleep(0.1)
2266            self.device.SET_NCO2_UPDATE(1)
2267            sleep(0.1)
2268            self.device.SET_NCO2_UPDATE(1)
2269        elif nco == 3:
2270            self.device.SET_NCO3_UPDATE(0)
2271            sleep(0.1)
2272            self.device.SET_NCO3_UPDATE(1)
2273            sleep(0.1)
2274            self.device.SET_NCO3_UPDATE(1)
2275
2276    def nco_update_common(self) -> None:
2277        """Macro Function. Updates the four NCO frequencies of all NCOs by pulsing a vlaue of 1 on the NCO_COMMON_UPDATE field
2278
2279        Arguments:
2280            None
2281
2282        Raises:
2283            None
2284
2285        Returns:
2286            None
2287        """
2288        self.device.SET_NCO_COMMON_UPDATE(0)
2289        sleep(0.1)
2290        self.device.SET_NCO_COMMON_UPDATE(1)
2291        sleep(0.1)
2292        self.device.SET_NCO_COMMON_UPDATE(0)
2293
2294    def ddc_nco_select(self, ddc: int, nco: int) -> None:
2295        """Macro Function. These bits select which of the 4 frequencies are active in the respective DDCs/NCOs.
2296
2297        Arguments:
2298            ddc:
2299                DDC of which to configure the nco frequency
2300            nco:
2301                NCO frequency to set as the active frequency
2302
2303        Raises:
2304            None
2305
2306        Returns:
2307            None
2308        """
2309        if ddc == 0:
2310            self.device.SET_DDC0_NCO_SEL(nco)
2311        elif ddc == 1:
2312            self.device.SET_DDC1_NCO_SEL(nco)
2313        elif ddc == 2:
2314            self.device.SET_DDC2_NCO_SEL(nco)
2315        elif ddc == 3:
2316            self.device.SET_DDC3_NCO_SEL(nco)
2317
2318    def ddc_decimation_factor(self, ddc: int, factor: int) -> None:
2319        """Macro Function. Sets the decimation factor for each DDC
2320
2321        Arguments:
2322            ddc:
2323                The DDC for which the decimation factor is being configured
2324            factor:
2325                Desired decimation factor
2326
2327        Raises:
2328            None
2329
2330        Returns:
2331            None
2332        """
2333        if factor == 0:
2334            n = factor
2335        else:
2336            n = int(log(factor, 2))
2337
2338        self.device.SET_SELECT_INDEPENDENT_DECIMATION(
2339            1
2340        )  # Configure for different decimation factors for each DDC
2341
2342        if ddc == 0:
2343            self.device.SET_DDC0_DECIMATION_MODE(n)
2344        elif ddc == 1:
2345            self.device.SET_DDC1_DECIMATION_MODE(n)
2346        elif ddc == 2:
2347            self.device.SET_DDC2_DECIMATION_MODE(n)
2348        elif ddc == 3:
2349            self.device.SET_DDC3_DECIMATION_MODE(n)
2350
2351    def decimation_factor_common(self, factor: int) -> None:
2352        """Macro Function. Enables decimation for all DDCs and sets the common decimation factor for all DDCs
2353
2354        Arguments:
2355            factor:
2356                Desired decimation factor
2357
2358        Raises:
2359            None
2360
2361        Returns:
2362            None
2363        """
2364        if factor == 0:
2365            n = factor
2366        else:
2367            n = int(log(factor, 2))
2368
2369        self.device.SET_SELECT_INDEPENDENT_DECIMATION(
2370            0
2371        )  # Configure for common decimation factors for all DDCs
2372        self.device.SET_COMMON_DECIMATION_MODE(n)
2373
2374    def ddc_nco_frequency(self, ddc: int, nco: int, freq: int) -> None:
2375        """Macro Function. Configures the 48-bit frequency words for the four DDCs/NCOs.
2376
2377        Arguments:
2378            ddc:
2379                DDC of which the frequency is being configured
2380            nco:
2381                NCO frequency which is being configured (0-3)
2382            freq:
2383                Desired frequency
2384
2385        Raises:
2386            None
2387
2388        Returns:
2389            None
2390        """
2391        if freq > 0:
2392            nco_word = int(
2393                freq * (2**48) / self.fs
2394            )  # Formula for calulating this value is in the datasheet
2395        else:
2396            nco_word = int(
2397                ((self.device.fs + freq) * (2**48) / self.fs) - 1
2398            )  # Formula for calulating this value is in the datasheet
2399
2400        if ddc == 0:
2401            if nco == 0:
2402                self.device.SET_DDC0_NCO_FREQ0(nco_word)
2403            elif nco == 1:
2404                self.device.SET_DDC0_NCO_FREQ1(nco_word)
2405            elif nco == 2:
2406                self.device.SET_DDC0_NCO_FREQ2(nco_word)
2407            elif nco == 3:
2408                self.device.SET_DDC0_NCO_FREQ3(nco_word)
2409        elif ddc == 1:
2410            if nco == 0:
2411                self.device.SET_DDC1_NCO_FREQ0(nco_word)
2412            elif nco == 1:
2413                self.device.SET_DDC1_NCO_FREQ1(nco_word)
2414            elif nco == 2:
2415                self.device.SET_DDC1_NCO_FREQ2(nco_word)
2416            elif nco == 3:
2417                self.device.SET_DDC1_NCO_FREQ3(nco_word)
2418        elif ddc == 2:
2419            if nco == 0:
2420                self.device.SET_DDC2_NCO_FREQ0(nco_word)
2421            elif nco == 1:
2422                self.device.SET_DDC2_NCO_FREQ1(nco_word)
2423            elif nco == 2:
2424                self.device.SET_DDC2_NCO_FREQ2(nco_word)
2425            elif nco == 3:
2426                self.device.SET_DDC2_NCO_FREQ3(nco_word)
2427        elif ddc == 3:
2428            if nco == 0:
2429                self.device.SET_DDC3_NCO_FREQ0(nco_word)
2430            elif nco == 1:
2431                self.device.SET_DDC3_NCO_FREQ1(nco_word)
2432            elif nco == 2:
2433                self.device.SET_DDC3_NCO_FREQ2(nco_word)
2434            elif nco == 3:
2435                self.device.SET_DDC3_NCO_FREQ3(nco_word)
2436
2437    def ddc_nco_phase(self, ddc: int, nco: int, phase: int) -> None:
2438        """Macro Function. Configure the starting phase of the frequency for the DDCs/NCOs. The phase value is: 90° / <16-bit register>
2439
2440        Arguments:
2441            ddc:
2442                DDC of which the phase is being configured
2443            nco:
2444                NCO of which the phase is being configured
2445            phase:
2446                desired phase in degrees
2447
2448        Raises:
2449            None
2450
2451        Returns:
2452            None
2453        """
2454        if phase == 0:
2455            phaseval = 0
2456        else:
2457            phaseval = int(90 / phase)
2458
2459        if ddc == 0:
2460            if nco == 0:
2461                self.device.SET_DDC0_NCO_PHASE0(phaseval)
2462            elif nco == 1:
2463                self.device.SET_DDC0_NCO_PHASE1(phaseval)
2464            elif nco == 2:
2465                self.device.SET_DDC0_NCO_PHASE2(phaseval)
2466            elif nco == 3:
2467                self.device.SET_DDC0_NCO_PHASE3(phaseval)
2468        elif ddc == 1:
2469            if nco == 0:
2470                self.device.SET_DDC0_NCO_PHASE0(phaseval)
2471            elif nco == 1:
2472                self.device.SET_DDC1_NCO_PHASE1(phaseval)
2473            elif nco == 2:
2474                self.device.SET_DDC2_NCO_PHASE2(phaseval)
2475            elif nco == 3:
2476                self.device.SET_DDC3_NCO_PHASE3(phaseval)
2477        elif ddc == 2:
2478            if nco == 0:
2479                self.device.SET_DDC0_NCO_PHASE0(phaseval)
2480            elif nco == 1:
2481                self.device.SET_DDC1_NCO_PHASE1(phaseval)
2482            elif nco == 2:
2483                self.device.SET_DDC2_NCO_PHASE2(phaseval)
2484            elif nco == 3:
2485                self.device.SET_DDC3_NCO_PHASE3(phaseval)
2486        elif ddc == 3:
2487            if nco == 0:
2488                self.device.SET_DDC0_NCO_PHASE0(phaseval)
2489            elif nco == 1:
2490                self.device.SET_DDC1_NCO_PHASE1(phaseval)
2491            elif nco == 2:
2492                self.device.SET_DDC2_NCO_PHASE2(phaseval)
2493            elif nco == 3:
2494                self.device.SET_DDC3_NCO_PHASE3(phaseval)
2495
2496    def read_all_regs(self) -> None:
2497        """Macro Function. Reads all registers for configuration debug purposes.
2498
2499        Arguments:
2500            None
2501
2502        Raises:
2503            None
2504
2505        Returns:
2506            None
2507        """
2508        self.device.debugReadback()
class ADC3669:
   8class ADC3669:
   9    """Python API for ADC3669 family devices.
  10    
  11    Attributes:
  12        alias: String used to identify the ADC being interfaced with
  13        device: Reference to the low level API which handles register field functions.
  14        fs: Sampling frequency of the device
  15
  16    """
  17
  18    def __init__(self, alias:str, device_handle, sample_freq:int):
  19        """Constructor for ADC3669 API.
  20        
  21        Arguments:
  22            alias: String used to identify the ADC being interfaced with
  23            device_handle: Object which handles SPI communication to the device. Contains read and write functions.
  24            sample_freq: Sampling frequency of the device.
  25        
  26        Raises:
  27            None
  28
  29        Returns:
  30            An instance of the ADC3669 API class
  31
  32        """
  33        self.alias = alias
  34        self.fs = sample_freq
  35        self.device = Samrat(device_handle, sample_freq)
  36
  37    def reg_read(self, addr: int) -> int:
  38        """Reads the value stored in a register
  39
  40        Arguments:
  41            addr:
  42                The address of the desired register
  43
  44        Raises:
  45            None
  46
  47        Returns:
  48            The value of the register that is read back
  49        """
  50        return self.device.read(addr)
  51
  52    def reg_write(self, addr: int, value: int) -> None:
  53        """Writes a value into a register
  54
  55        Arguments:
  56            addr:
  57                The address of the desired register
  58            value:
  59                The value that is to be written to the register
  60
  61        Raises:
  62            None
  63
  64        Returns:
  65            None
  66        """
  67        self.device.write(addr, value)
  68
  69    def configure_ready(self) -> int:
  70        """Indicates the status of the internal fuse load after HW reset. The device should not be programmed before the fuse load is complete.
  71
  72        Arguments:
  73            None
  74
  75        Raises:
  76            None
  77
  78        Returns:
  79            Status of the fuse autoload.
  80
  81            - 0: Fuse autoload is incomplete, and the device should not be programmed
  82            - 1: Fuse autoload is complete, the device can be programmed
  83        """
  84        return self.device.GET_FUSE_LOAD_DONE()
  85
  86    def reset(self) -> None:
  87        """Resets the device. The register will self clear after reset.
  88
  89        Arguments:
  90            None
  91
  92        Raises:
  93            None
  94
  95        Returns:
  96            None
  97        """
  98        self.device.SET_SOFTWARE_RESET(1)
  99
 100    def global_powerdown(self, value: int) -> None:
 101        """Powers down the device.
 102
 103        Arguments:
 104            value: input value
 105                - 0: Normal Operation
 106                - 1: Powerdown
 107
 108        Raises:
 109            None
 110
 111        Returns:
 112            None
 113        """
 114        self.device.SET_GLOBAL_PDN(value)
 115
 116    def fast_powerdown_cha(self, value: int) -> None:
 117        """Puts channel A into a low power state that enables a fast wake time.
 118
 119        Arguments:
 120            value: input value
 121                - 0: Normal Operation
 122                - 1: Powerdown
 123
 124        Raises:
 125            None
 126
 127        Returns:
 128            None
 129        """
 130        self.device.SET_FAST_PDN_CH0(value)
 131
 132    def fast_powerdown_chb(self, state: int) -> None:
 133        """Puts channel B into a low power state that enables a fast wake time.
 134
 135        Arguments:
 136            value: input value
 137                - 0: Normal Operation
 138                - 1: Powerdown
 139
 140        Raises:
 141            None
 142
 143        Returns:
 144            None
 145        """
 146        self.device.SET_FAST_PDN_CH1(state)
 147
 148    def sysref_detect_clear(self, value: int) -> None:
 149        """resets the SYSREF DET flag
 150
 151        Arguments:
 152            value: input value
 153                - 0: Normal operation
 154                - 1: SYSREF DET flag gets reset
 155
 156        Raises:
 157            None
 158
 159        Returns:
 160            None
 161        """
 162        self.device.SET_SYSREF_DET_CLR(value)
 163
 164    def cha_termination(self, value: int) -> None:
 165        """Sets the internal termination on channel A.
 166
 167        Arguments:
 168            value: input value
 169                - 0: 100Ω differential termination
 170                - 1: 200Ω differential termination
 171
 172        Raises:
 173            None
 174
 175        Returns:
 176            None
 177        """
 178        self.device.SET_CH0_200_OHM_TERM(value)
 179
 180    def chb_termination(self, value: int) -> None:
 181        """Sets the internal termination on channel B.
 182
 183        Arguments:
 184            value: input value
 185                - 0: 100Ω differential termination
 186                - 1: 200Ω differential termination
 187
 188        Raises:
 189            None
 190
 191        Returns:
 192            None
 193        """
 194        self.device.SET_CH1_200_OHM_TERM(value)
 195
 196    def overrange_clear(self, value) -> None:
 197        """A transition from 0 to 2 clears the clears the sticky overrange bit.
 198
 199        Arguments:
 200            value: input value
 201                - 0: Normal operation
 202                - 2: Overrange bit is cleared
 203
 204        Raises:
 205            None
 206
 207        Returns:
 208            None
 209        """
 210        self.device.SET_DIG_OVR_CLEAR(value)
 211
 212    def overrange_sticky(self, value: int) -> None:
 213        """Makes the digital Overrange sticky.
 214
 215        Arguments:
 216            value: input value
 217                - 0: Digital OVR is non-sticky (updated based on overrange_length())
 218                - 1: Digital OVR is sticky (use overrange_clear() to reset)
 219
 220        Raises:
 221            None
 222
 223        Returns:
 224            None
 225        """
 226        self.device.SET_DIG_OVR_MODE(value)
 227
 228    def overrange_length(self, value: int) -> None:
 229        """Controls the Overrange pulse expansion. The expansion width is specified in terms of number of clock cycles.
 230
 231        Arguments:
 232            value: input value
 233                8-bit integer specifying the ovr pulse expansion in number of clock cycles
 234
 235        Raises:
 236            None
 237
 238        Returns:
 239            None
 240        """
 241        self.device.SET_DIG_OVR_WIDTH(value)
 242
 243    def lvds_termination(self, value: int) -> None:
 244        """Configures the LVDS termination resistance
 245
 246        Arguments:
 247            value: input value
 248                - 0: LVDS termination is 50Ω
 249                - 1: LVDS termination is 100Ω
 250
 251        Raises:
 252            None
 253
 254        Returns:
 255            None
 256        """
 257        self.device.SET_HUNDRED_OHM_TERM(value)
 258
 259    def lvds_half_swing(self, value: int) -> None:
 260        """Reduces LVDS output swing by 50% to reduce power consumption
 261
 262        Arguments:
 263            value: input value
 264                - 0: Normal output swing
 265                - 1: Reduced output swing
 266
 267        Raises:
 268            None
 269
 270        Returns:
 271            None
 272        """
 273        self.device.SET_LVDS_HALF_SWING_EN(value)
 274
 275    def data_rate(self, value: int) -> None:
 276        """This bit configures the parallel LVDS output interface. When only a single channel is output, SDR LVDS can be enabled.
 277
 278        Arguments:
 279            value: input value
 280                - 0: Dual Data Rate (DDR)
 281                - 1: Single Data Rate (SDR)
 282
 283        Raises:
 284            None
 285
 286        Returns:
 287            None
 288        """
 289        self.device.SET_SDR(value)
 290
 291    def swap_channels(self, value: int) -> None:
 292        """Internally swaps channel A and channel B.
 293
 294        Arguments:
 295            value: input value
 296                - 0: Normal operation
 297                - 1: Channel A and channel B are swapped
 298
 299        Raises:
 300            None
 301
 302        Returns:
 303            None
 304        """
 305        self.device.SET_SWAP_CHANNELS(value)
 306
 307    def lvds_data_invert(self, value) -> None:
 308        """Inverts the polarity of individual LVDS output lanes.
 309
 310        Arguments:
 311            lanes:
 312                Value to write to the register, where each bit represents as listed in the datasheet, and the values correspond to the following functions:
 313                - 0: Normal operation
 314                - 1: LVDS Lane is inverted
 315
 316        Raises:
 317            None
 318
 319        Returns:
 320            None
 321        """
 322        self.device.SET_LVDS_DATA_INV(value)
 323
 324    def lvds_powerdown(self, value: List[int]) -> None:
 325        """Powers down the individual LVDS output lanes and puts LVDS pins into high impedance state.
 326
 327        Arguments:
 328            value: input value
 329                Value to write to the register, where each bit represents as listed in the datasheet, and the values correspond to the following functions:
 330                - 0: Normal operation
 331                - 1: Powered down
 332
 333        Raises:
 334            None
 335
 336        Returns:
 337            None
 338        """
 339        self.device.SET_LVDS_DATA_PDN(value)
 340
 341    def fclk_duty_cycle(self, value: int) -> None:
 342        """Adjusts the Frame clock duty cycle.
 343        Arguments:
 344            value: input value
 345                - 0: FCLK stays high for one DCLK cycle at the beginning of the output sample
 346                - 1: FCLK stays high for 50% of the output sample
 347
 348        Raises:
 349            None
 350
 351        Returns:
 352            None
 353        """
 354        self.device.SET_ENABLE_50PER_DUTY_FCLK(value)
 355
 356    def fclk_disable(self, value: int) -> None:
 357        """Disables the output Frame clock.
 358
 359        Arguments:
 360            value: input value
 361                - 0: FCLK replaces the LSB data and is transmitted on DOUT0
 362                - 1: FCLK is disabled and the LSB data is transmitted on DOUT0.
 363
 364        Raises:
 365            None
 366
 367        Returns:
 368            None
 369        """
 370        self.device.SET_DISABLE_FRAME_INSERTION(value)
 371
 372    def lvds_mux_enable(self, value: int) -> None:
 373        """Enables use of the LVDS output mux
 374
 375        Arguments:
 376            value: input value
 377                - 0: LVDS Mux disabled
 378                - 1: LVDS Mux enabled
 379
 380        Raises:
 381            None
 382
 383        Returns:
 384            None
 385        """
 386        self.device.SET_LVDS_CROSS_BAR_MUX_EN(value)
 387
 388    def lvds_swap_edge(self, value: int) -> None:
 389        """Swaps the output data bits transmitted on rising and falling edge of DCLK.
 390
 391        Arguments:
 392            value: input value
 393                - 0: Normal operation
 394                - 1: Output bits on rising and falling edge are swapped.
 395
 396        Raises:
 397            None
 398
 399        Returns:
 400            None
 401        """
 402        self.device.SET_LVDS_SWAP_RISE_FALL(value)
 403
 404    def lvds_scrambling(self, value: int) -> None:
 405        """Controls the scrambling and LSB insertion configuration on the output data
 406
 407        Arguments:
 408            value: input value
 409                - 0: No scrambling, Defualt Operation
 410                - 1: Data is XOR'ed with a PRBS bit. This PRBS is inserted on the LSB position
 411                - 2: OVR is inserted on the LSB position
 412                - 3: OVR is inserted on the LSB+1 position
 413                - 4: Data is XOR'ed with a PRBS bit, and the PRBS is inserted on LSB+1 position
 414                - 5: OVR is inserted on LSB+1 position, PRBS is inseted on LSB position. Data is XOR'ed with PRBS
 415                - 6: OVR is inserted on LSB+2 position, PRBS is inseted on LSB+1 position. Data is XOR'ed with PRBS
 416
 417        Raises:
 418            None
 419
 420        Returns:
 421            None
 422        """
 423        self.device.SET_LVDS_DATA_DITH_MODE(value)
 424
 425    def dout0_mux(self, data: int) -> None:
 426        """Configures the digital data output on LVDS lane 0
 427
 428        Arguments:
 429            data:
 430                The internal digital data bus lane that is being mapped
 431
 432        Raises:
 433            None
 434
 435        Returns:
 436            None
 437        """
 438        self.device.SET_LANE0_MUX_SEL(data)
 439
 440    def dout1_mux(self, data: int) -> None:
 441        """Configures the digital data output on LVDS lane 1
 442
 443        Arguments:
 444            data:
 445                The internal digital data bus lane that is being mapped
 446
 447        Raises:
 448            None
 449
 450        Returns:
 451            None
 452        """
 453        self.device.SET_LANE1_MUX_SEL(data)
 454
 455    def dout2_mux(self, data: int) -> None:
 456        """Configures the digital data output on LVDS lane 2
 457
 458        Arguments:
 459            data:
 460                The internal digital data bus lane that is being mapped
 461
 462        Raises:
 463            None
 464
 465        Returns:
 466            None
 467        """
 468        self.device.SET_LANE2_MUX_SEL(data)
 469
 470    def dout3_mux(self, data: int) -> None:
 471        """Configures the digital data output on LVDS lane 3
 472
 473        Arguments:
 474            data:
 475                The internal digital data bus lane that is being mapped
 476
 477        Raises:
 478            None
 479
 480        Returns:
 481            None
 482        """
 483        self.device.SET_LANE3_MUX_SEL(data)
 484
 485    def dout4_mux(self, data: int) -> None:
 486        """Configures the digital data output on LVDS lane 4
 487
 488        Arguments:
 489            data:
 490                The internal digital data bus lane that is being mapped
 491
 492        Raises:
 493            None
 494
 495        Returns:
 496            None
 497        """
 498        self.device.SET_LANE4_MUX_SEL(data)
 499
 500    def dout5_mux(self, data: int) -> None:
 501        """Configures the digital data output on LVDS lane 5
 502
 503        Arguments:
 504            data:
 505                The internal digital data bus lane that is being mapped
 506
 507        Raises:
 508            None
 509
 510        Returns:
 511            None
 512        """
 513        self.device.SET_LANE5_MUX_SEL(data)
 514
 515    def dout6_mux(self, data: int) -> None:
 516        """Configures the digital data output on LVDS lane 6
 517
 518        Arguments:
 519            data:
 520                The internal digital data bus lane that is being mapped
 521
 522        Raises:
 523            None
 524
 525        Returns:
 526            None
 527        """
 528        self.device.SET_LANE6_MUX_SEL(data)
 529
 530    def dout7_mux(self, data: int) -> None:
 531        """Configures the digital data output on LVDS lane 7
 532
 533        Arguments:
 534            data:
 535                The internal digital data bus lane that is being mapped
 536
 537        Raises:
 538            None
 539
 540        Returns:
 541            None
 542        """
 543        self.device.SET_LANE7_MUX_SEL(data)
 544
 545    def dout8_mux(self, data: int) -> None:
 546        """Configures the digital data output on LVDS lane 8
 547
 548        Arguments:
 549            data:
 550                The internal digital data bus lane that is being mapped
 551
 552        Raises:
 553            None
 554
 555        Returns:
 556            None
 557        """
 558        self.device.SET_LANE8_MUX_SEL(data)
 559
 560    def dout9_mux(self, data: int) -> None:
 561        """Configures the digital data output on LVDS lane 9
 562
 563        Arguments:
 564            data:
 565                The internal digital data bus lane that is being mapped
 566
 567        Raises:
 568            None
 569
 570        Returns:
 571            None
 572        """
 573        self.device.SET_LANE9_MUX_SEL(data)
 574
 575    def dout10_mux(self, data: int) -> None:
 576        """Configures the digital data output on LVDS lane 10
 577
 578        Arguments:
 579            data:
 580                The internal digital data bus lane that is being mapped
 581
 582        Raises:
 583            None
 584
 585        Returns:
 586            None
 587        """
 588        self.device.SET_LANE10_MUX_SEL(data)
 589
 590    def dout11_mux(self, data: int) -> None:
 591        """Configures the digital data output on LVDS lane 11
 592
 593        Arguments:
 594            data:
 595                The internal digital data bus lane that is being mapped
 596
 597        Raises:
 598            None
 599
 600        Returns:
 601            None
 602        """
 603        self.device.SET_LANE11_MUX_SEL(data)
 604
 605    def dout12_mux(self, data: int) -> None:
 606        """Configures the digital data output on LVDS lane 12
 607
 608        Arguments:
 609            data:
 610                The internal digital data bus lane that is being mapped
 611
 612        Raises:
 613            None
 614
 615        Returns:
 616            None
 617        """
 618        self.device.SET_LANE12_MUX_SEL(data)
 619
 620    def dout13_mux(self, data: int) -> None:
 621        """Configures the digital data output on LVDS lane 13
 622
 623        Arguments:
 624            data:
 625                The internal digital data bus lane that is being mapped
 626
 627        Raises:
 628            None
 629
 630        Returns:
 631            None
 632        """
 633        self.device.SET_LANE13_MUX_SEL(data)
 634
 635    def dout14_mux(self, data: int) -> None:
 636        """Configures the digital data output on LVDS lane 14
 637
 638        Arguments:
 639            data:
 640                The internal digital data bus lane that is being mapped
 641
 642        Raises:
 643            None
 644
 645        Returns:
 646            None
 647        """
 648        self.device.SET_LANE14_MUX_SEL(data)
 649
 650    def dout15_mux(self, data: int) -> None:
 651        """Configures the digital data output on LVDS lane 15
 652
 653        Arguments:
 654            data:
 655                The internal digital data bus lane that is being mapped
 656
 657        Raises:
 658            None
 659
 660        Returns:
 661            None
 662        """
 663        self.device.SET_LANE15_MUX_SEL(data)
 664
 665    def high_fin(self, value: int) -> None:
 666        """Enable for best AC performance for input frequencies greater than 500 MHz
 667
 668        Arguments:
 669            value: input value
 670                - 0: Normal operation
 671                - 1: Performance optimized for input frequencies greater than 500 MHz
 672
 673        Raises:
 674            None
 675
 676        Returns:
 677            None
 678        """
 679        self.device.SET_DIS_ANA_NL_CORR(value)
 680
 681    def sysref_detect(self) -> int:
 682        """Indicates if a SYSREF signal is detected. Upon detection this bit stays high until it gets reset (0x102, D6) or a device reset is issued.
 683
 684        Arguments:
 685            None
 686
 687        Raises:
 688            None
 689
 690        Returns:
 691            Status of the Sysref signal
 692            
 693            - 0: No Sysref signal detected
 694            - 1: Sysref signal detected
 695        """
 696        return self.device.GET_SYSREF_DET()
 697
 698    def sysref_or(self) -> int:
 699        """Output of the five SYSREF XOR flags logically OR'ed together
 700
 701        Arguments:
 702            None
 703
 704        Raises:
 705            None
 706
 707        Returns:
 708            Status of the SYSREF flags OR'ed together
 709            
 710            - 0: No sysref flags raised
 711            - 1: One of the five XOR flags is raised
 712        """
 713        return self.device.GET_SYSREF_OR()
 714
 715    def sysref_xor(self) -> int:
 716        """XOR flags from the SYSREF window monitoring circuitry. 
 717        
 718        The sampling clock falling edge is used to capture the SYSREF signal.
 719        If a SYSREF signal transition happens within -60/+140 ps of the SYSREF capture, the appropriate XOR flag gets raised.
 720        These bits are updated on every SYSREF rising edge.
 721
 722        Arguments:
 723            None
 724
 725        Raises:
 726            None
 727
 728        Returns:
 729            List of 5 flags as follows
 730
 731            - X0: SYSREF leading sample clock by 20 to 60ps
 732            - X1: SYSREF leading sample clock by 20ps to 0ps or SYSREF lagging sample clock by 0 to 20ps
 733            - X2: SYSREF lagging sample clock by up to 20 to 60ps
 734            - X3: SYSREF lagging sample clock by 60 to 100ps
 735            - X4: SYSREF lagging sample clock by 100 to 140ps
 736
 737            With the corresponding values:
 738            - 0: Flag not raised
 739            - 1: Flag raised
 740        """
 741        return self.device.GET_SYSREF_XOR()
 742
 743    def gpio_config(self, value: int) -> None:
 744        """Configures the functionaliy of the two GPIO pins
 745
 746        Arguments:
 747            value: input value
 748            
 749        | Value  | GPIO 1              | GPIO 0              |
 750        |:------:|:-------------------:|:-------------------:|
 751        | 0      | NOT USED            | SYSREF              |
 752        | 3      | GLOBAL POWER DOWN   | SYSREF              |
 753        | 4      | EXTERNAL REFERENCE  | SYSREF              |
 754        | 5      | NCO SWITCH 1        | NCO SWITCH 0        |
 755        | 8      | NOT USED            | SYSREF              |
 756        | 9      | OVR CHB/CHA         | SYSREF              |
 757        | 10     | NOT USED            | GLOBAL POWER DOWN   |
 758        | 11     | OVR CHB/CHA         | GLOBAL POWER DOWN   |
 759        | 12     | OVR CHB             | OVR CHA             |
 760
 761        Raises:
 762            None
 763
 764        Returns:
 765            None
 766        """
 767        self.device.SET_GPIO_CONFIG(value)
 768
 769    def pattern_clk(self, value: int) -> None:
 770        """Controls the clock of the pattern signal generator.
 771
 772        Arguments:
 773            value: input value
 774                - 0: Normal operation
 775                - 1: Decimation CLK is used for the pattern generator
 776
 777        Raises:
 778            None
 779
 780        Returns:
 781            None
 782        """
 783        self.device.SET_PATTERN_CLK(value)
 784
 785    def test_pattern(self, value: int) -> None:
 786        """Controls the type of test pattern.
 787        
 788        The generated pattern is 20 bits wide. In 16 bit resolution mode, 16 MSBs of the pattern mode are sent out.
 789        In 32 bit resolution mode, 12 zeros are padded to the generated pattern and sent out.
 790
 791        Arguments:
 792            value: input value
 793                - 0: Test pattern is disabled
 794                - 1: Ramp pattern with a step of 1 (at 20 bit level, which is equivalent to 1/16 at 16 bit level)
 795                - 2: Ramp pattern with a step value set by CUSTOM PATTERN.
 796                - 3: Not used
 797                - 4: Static pattern set by CUSTOM PATTERN
 798                - 5: Pattern toggles between CUSTOM PATTERN and invert of CUSTOM PATTERN
 799                - 6: Pattern toggles between CUSTOM PATTERN and 0
 800
 801        Raises:
 802            None
 803
 804        Returns:
 805            None
 806        """
 807        self.device.SET_TEST_PATTERN_MODE(value)
 808
 809    def custom_pattern(self, value: int) -> None:
 810        """Controls the pattern generator. This controls different functions depending on the TEST PATTERN setting
 811
 812        Arguments:
 813            value:
 814                20-bit custom pattern data
 815
 816        Raises:
 817            None
 818
 819        Returns:
 820            None
 821        """
 822        # if value != 0:
 823        #     if not ((int(log(value, 2)) + 1) <= 20):
 824        #         raise Exception("Custom pattern value must be 20 bits long or less")
 825        self.device.SET_CUSTOM_PATTERN(value)
 826
 827    def digital_gain_cha(self, value: int) -> None:
 828        """Controls digital gain for channel A. Maximum gain is 6dB.
 829
 830        Arguments:
 831            value:
 832                Desired value to write into the register, where:
 833                Gain = (20 x log(1+(Value / 128)))
 834
 835        Raises:
 836            None
 837
 838        Returns:
 839            None
 840        """
 841        self.device.SET_CH0_PROG_GAIN(value)
 842
 843    def digital_gain_chb(self, value: int) -> None:
 844        """Controls digital gain for channel B. Maximum gain is 6dB.
 845
 846        Arguments:
 847            value:
 848                Desired value to write into the register, where:
 849                Gain = (20 x log(1+(Value / 128)))
 850
 851        Raises:
 852            None
 853
 854        Returns:
 855            None
 856        """
 857        self.device.SET_CH1_PROG_GAIN(value)
 858
 859    def sysref_mode(self, value: int) -> None:
 860        """Controls the global SYSREF mask
 861
 862        Arguments:
 863            value: input value
 864                - 0: Pass all SYSREF pulses
 865                - 1: Pass the first SYSREF pulse and gates subsequent pulses
 866                - 2: Gate all SYSREF pulses
 867                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
 868
 869        Raises:
 870            None
 871
 872        Returns:
 873            None
 874        """
 875        self.device.SET_SYSREF_MODE(value)
 876
 877    def lvds_sysref_mask(self, value: int) -> None:
 878        """Controls the SYSREF pulse going to the LVDS block.
 879
 880        Arguments:
 881            value: input value
 882                - 0: Pass all SYSREF pulses
 883                - 1: Pass the first SYSREF pulse and gates subsequent pulses
 884                - 2: Gate all SYSREF pulses
 885                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
 886
 887        Raises:
 888            None
 889
 890        Returns:
 891            None
 892        """
 893        self.device.SET_LVDS_SYSREF_MASK(value)
 894
 895    def ddc_sysref_mask(self, value: int) -> None:
 896        """Controls the SYSREF pulse of DDC block.
 897
 898        Arguments:
 899            value: input value
 900                - 0: Pass all SYSREF pulses
 901                - 1: Pass the first SYSREF pulse and gates subsequent pulses
 902                - 2: Gate all SYSREF pulses
 903                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
 904
 905        Raises:
 906            None
 907
 908        Returns:
 909            None
 910        """
 911        self.device.SET_DECIMATION_SYSREF_MASK(value)
 912
 913    def nco_sysref_mask(self, value: int) -> None:
 914        """Controls the SYSREF pulse of NCO block.
 915
 916        Arguments:
 917            value: input value
 918                - 0: Pass all SYSREF pulses
 919                - 1: Pass the first SYSREF pulse and gates subsequent pulses
 920                - 2: Gate all SYSREF pulses
 921                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
 922
 923        Raises:
 924            None
 925
 926        Returns:
 927            None
 928        """
 929        self.device.SET_NCO_SYSREF_MASK(value)
 930
 931    def timer_sysref_mask(self, value: int) -> None:
 932        """Controls the SYSREF pulse of TIMER block.
 933
 934        Arguments:
 935            value: input value
 936                - 0: Pass all SYSREF pulses
 937                - 1: Pass the first SYSREF pulse and gates subsequent pulses
 938                - 2: Gate all SYSREF pulses
 939                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
 940
 941        Raises:
 942            None
 943
 944        Returns:
 945            None
 946        """
 947        self.device.SET_TIMER_SYSREF_MASK(value)
 948
 949    def sysref_time_stamp(self, value: int) -> None:
 950        """Allows the SYSREF to be passed on the FRAME_INDICATOR lane. OVR_ON_LSB setting takes precedence
 951
 952        Arguments:
 953            value: input value
 954                - 0: Normal operation
 955                - 3: Pass sysref time stamp on the frame indicator lane
 956
 957        Raises:
 958            None
 959
 960        Returns:
 961            None
 962        """
 963        self.device.SET_SYSREF_TIME_STAMP(value)
 964
 965    def gain_override(self, value: int) -> None:
 966        """Controls 6dB gain setting of the DDC. The 6dB gain is applied in COMPLEX DDC mode by default. This will force 6 dB gain on the DDC output, irrespective of the DDC mode
 967
 968        Arguments:
 969            value: input value
 970                - 0: Normal operation
 971                - 2: Unity gain
 972                - 3: 6dB gain override
 973
 974        Raises:
 975            None
 976
 977        Returns:
 978            None
 979        """
 980        self.device.SET_SIX_DB_GAIN_OVERRIDE(value)
 981
 982    def complex_decimation(self, value: int) -> None:
 983        """Enables/disables complex decimation for all DDCs.
 984
 985        Arguments:
 986            value: input value
 987                - 0: Real Deciamtion
 988                - 1: Complex Decimation
 989
 990        Raises:
 991            None
 992
 993        Returns:
 994            None
 995        """
 996        self.device.SET_EN_COMPLEX_DDC(value)
 997
 998    def output_resolution(self, value: int) -> None:
 999        """Configures the output resolution for 16-bit or 32-bit
1000
1001        Arguments:
1002            value: input value
1003                - 0: 16-bit output resolution
1004                - 1: 32-bit output resolution
1005
1006        Raises:
1007            None
1008
1009        Returns:
1010            None
1011        """
1012        self.device.SET_OUTPUT_RESOLUTION(value)
1013
1014    def output_format(self, value: int) -> None:
1015        """Configures the output data format
1016
1017        Arguments:
1018            value: input value
1019                - 0: Output format is 2s complement
1020                - 1: Output format is offset binary
1021
1022        Raises:
1023            None
1024
1025        Returns:
1026            None
1027        """
1028        self.device.SET_OUTPUT_FORMAT(value)
1029
1030    def ddc0_mux(self, input: int) -> None:
1031        """Sets the input data source to decimation filter 0.
1032
1033        Arguments:
1034            ddc:
1035                The DDC for which the input data source is being configured
1036            input:
1037                Input to the DDC
1038                - 0: Channel A
1039                - 1: Channel B
1040                - 2: 2x Average ((ChA + ChB)/2)
1041                - 3: 2x Average ((ChA - ChB)/2)
1042
1043        Raises:
1044            None
1045
1046        Returns:
1047            None
1048        """
1049        self.device.SET_DDC0_MUX(input)
1050
1051    def ddc1_mux(self, input: int) -> None:
1052        """Sets the input data source to decimation filter 1.
1053
1054        Arguments:
1055            ddc:
1056                The DDC for which the input data source is being configured
1057            input:
1058                Input to the DDC
1059                - 0: Channel B
1060                - 1: Channel A
1061                - 2: 2x Average ((ChA + ChB)/2)
1062                - 3: 2x Average ((ChA - ChB)/2)
1063
1064        Raises:
1065            None
1066
1067        Returns:
1068            None
1069        """
1070        self.device.SET_DDC1_MUX(input)
1071
1072    def ddc2_mux(self, input: int) -> None:
1073        """Sets the input data source to decimation filter 2.
1074
1075        Arguments:
1076            ddc:
1077                The DDC for which the input data source is being configured
1078            input:
1079                Input to the DDC
1080                - 0: Channel A
1081                - 1: Channel B
1082                - 2: 2x Average ((ChA + ChB)/2)
1083                - 3: 2x Average ((ChA - ChB)/2)
1084
1085        Raises:
1086            None
1087
1088        Returns:
1089            None
1090        """
1091        self.device.SET_DDC2_MUX(input)
1092
1093    def ddc3_mux(self, input: int) -> None:
1094        """Sets the input data source to decimation filter 3.
1095
1096        Arguments:
1097            ddc:
1098                The DDC for which the input data source is being configured
1099            input:
1100                Input to the DDC
1101                - 0: Channel B
1102                - 1: Channel A
1103                - 2: 2x Average ((ChA + ChB)/2)
1104                - 3: 2x Average ((ChA - ChB)/2)
1105
1106        Raises:
1107            None
1108
1109        Returns:
1110            None
1111        """
1112        self.device.SET_DDC3_MUX(input)
1113
1114    def nco0_update(self, value: int) -> None:
1115        """Updates the four NCO frequencies of NCO0.
1116
1117        Arguments:
1118            value: input value
1119                - 0: Normal operation
1120                - 1: Update NCO0 frequencies
1121
1122        Raises:
1123            None
1124
1125        Returns:
1126            None
1127        """
1128        self.device.SET_NCO0_UPDATE(value)
1129
1130    def nco1_update(self, value: int) -> None:
1131        """Updates the four NCO frequencies of NCO1.
1132
1133        Arguments:
1134            value: input value
1135                - 0: Normal operation
1136                - 1: Update NCO1 frequencies
1137
1138        Raises:
1139            None
1140
1141        Returns:
1142            None
1143        """
1144        self.device.SET_NCO1_UPDATE(value)
1145
1146    def nco2_update(self, value: int) -> None:
1147        """Updates the four NCO frequencies of NCO2.
1148
1149        Arguments:
1150            value: input value
1151                - 0: Normal operation
1152                - 1: Update NCO2 frequencies
1153
1154        Raises:
1155            None
1156
1157        Returns:
1158            None
1159        """
1160        self.device.SET_NCO2_UPDATE(value)
1161
1162    def nco3_update(self, value: int) -> None:
1163        """Updates the four NCO frequencies of NCO3.
1164
1165        Arguments:
1166            value: input value
1167                - 0: Normal operation
1168                - 1: Update NCO3 frequencies
1169
1170        Raises:
1171            None
1172
1173        Returns:
1174            None
1175        """
1176        self.device.SET_NCO3_UPDATE(value)
1177
1178    def select_negative_image(self, value: int) -> None:
1179        """Controls the selection of the negative frequency image. Applicable only in Complex DDC mode.
1180
1181        Arguments:
1182            value: input value
1183                - 0: Normal operation
1184                - 1: Negative image
1185
1186        Raises:
1187            None
1188
1189        Returns:
1190            None
1191        """
1192        self.device.SET_NCO_SEL_NEG_IMAGE(value)
1193
1194    def nco_mode(self, value: int) -> None:
1195        """Configures the NCOs operating mode.
1196
1197        Arguments:
1198            value: input value
1199                - 0: Phase continuous
1200                - 1: Infinite phase coherent
1201
1202        Raises:
1203            None
1204
1205        Returns:
1206            None
1207        """
1208        self.device.SET_NCO_MODE(value)
1209
1210    def low_latency_enable(self, value: int) -> None:
1211        """Enables low latency mode by byapssing all digital features
1212
1213        Arguments:
1214            value: input value
1215                - 0: Normal Operation
1216                - 1: Low Latency Mode
1217
1218        Raises:
1219            None
1220
1221        Returns:
1222            None
1223        """
1224        self.device.SET_ENABLE_LOW_LATENCY(value)
1225
1226    def disable_nco_auto_update(self, value: int) -> None:
1227        """Disables the automatic update when switching the NCOs using GPIO pins
1228
1229        Arguments:
1230            value: input value
1231                - 0: Automatic update enabled
1232                - 1: Automatic update disabled
1233
1234        Raises:
1235            None
1236
1237        Returns:
1238            None
1239        """
1240        self.device.SET_DISABLE_NCO_AUTO_UPDATE(value)
1241
1242    def nco_select_enable(self, value: int) -> None:
1243        """This bit enables NCO frequency selection via SPI register 0x166 instead of GPIO pins.
1244
1245        Arguments:
1246            value: input value
1247                - 0: NCO Select via GPIO Pins
1248                - 1: NCO Select via SPI Write
1249
1250        Raises:
1251            None
1252
1253        Returns:
1254            None
1255        """
1256        self.device.SET_ENABLE_NCO_SEL(value)
1257
1258    def nco_common_update(self, value: int) -> None:
1259        """Updates the four NCO frequencies of all NCOs.
1260
1261        Arguments:
1262            value: input value
1263                - 0: Normal operation
1264                - 1: Update NCO frequencies
1265
1266        Raises:
1267            None
1268
1269        Returns:
1270            None
1271        """
1272        self.device.SET_NCO_COMMON_UPDATE(value)
1273
1274    def ddc0_nco_select(self, nco: int) -> None:
1275        """Selects which of the 4 frequencies is active for DDC0.
1276
1277        Arguments:
1278            nco:
1279                NCO word to set as the active frequency
1280
1281        Raises:
1282            None
1283
1284        Returns:
1285            None
1286        """
1287        self.device.SET_DDC0_NCO_SEL(nco)
1288
1289    def ddc1_nco_select(self, nco: int) -> None:
1290        """Selects which of the 4 frequencies is active for DDC1.
1291
1292        Arguments:
1293            nco:
1294                NCO word to set as the active frequency
1295
1296        Raises:
1297            None
1298
1299        Returns:
1300            None
1301        """
1302        self.device.SET_DDC1_NCO_SEL(nco)
1303
1304    def ddc2_nco_select(self, nco: int) -> None:
1305        """Selects which of the 4 frequencies is active for DDC2.
1306
1307        Arguments:
1308            nco:
1309                NCO word to set as the active frequency
1310
1311        Raises:
1312            None
1313
1314        Returns:
1315            None
1316        """
1317        self.device.SET_DDC2_NCO_SEL(nco)
1318
1319    def ddc3_nco_select(self, nco: int) -> None:
1320        """Selects which of the 4 frequencies is active for DDC3.
1321
1322        Arguments:
1323            nco:
1324                NCO word to set as the active frequency
1325
1326        Raises:
1327            None
1328
1329        Returns:
1330            None
1331        """
1332        self.device.SET_DDC3_NCO_SEL(nco)
1333
1334    def ddc0_decimation(self, value: int) -> None:
1335        """Sets the decimation filter factors for DDC0 when using unequal decimation factors.
1336
1337        Arguments:
1338            value:
1339                value to write to the register such that Decimation Factor = 2^value.
1340
1341        Raises:
1342            None
1343
1344        Returns:
1345            None
1346        """
1347        self.device.SET_DDC0_DECIMATION_MODE(value)
1348
1349    def ddc1_decimation(self, value: int) -> None:
1350        """Sets the decimation filter factors for DDC1 when using unequal decimation factors.
1351
1352        Arguments:
1353            value:
1354                value to write to the register such that Decimation Factor = 2^value.
1355
1356        Raises:
1357            None
1358
1359        Returns:
1360            None
1361        """
1362        self.device.SET_DDC1_DECIMATION_MODE(value)
1363
1364    def ddc2_decimation(self, value: int) -> None:
1365        """Sets the decimation filter factors for DDC2 when using unequal decimation factors.
1366
1367        Arguments:
1368            value:
1369                value to write to the register such that Decimation Factor = 2^value.
1370
1371        Raises:
1372            None
1373
1374        Returns:
1375            None
1376        """
1377        self.device.SET_DDC2_DECIMATION_MODE(value)
1378
1379    def ddc3_decimation(self, value: int) -> None:
1380        """Sets the decimation filter factors for DDC3 when using unequal decimation factors.
1381
1382        Arguments:
1383            value:
1384                value to write to the register such that Decimation Factor = 2^value.
1385
1386        Raises:
1387            None
1388
1389        Returns:
1390            None
1391        """
1392        self.device.SET_DDC3_DECIMATION_MODE(value)
1393
1394    def unequal_decimation(self, value: int) -> None:
1395        """Enables configuration of DDC0 thru DDC3 to have unequal decimation factors.
1396
1397        Arguments:
1398            value: input value
1399                - 0: Normal operation
1400                - 1: Unequal decimation factors enabled
1401
1402        Raises:
1403            None:
1404
1405        Returns:
1406            None
1407        """
1408        self.device.SET_SELECT_INDEPENDENT_DECIMATION(value)
1409
1410    def number_of_ddcs(self, value: int) -> None:
1411        """This register configures the # of active DDCs.
1412
1413        Arguments:
1414            value: input value
1415                - 0: Single DDC per channel (Total two DDCs are enabled)
1416                - 1: Dual DDCs per channel (Total 4 DDCs are enabled)
1417                - 2: Just one DDC is enabled (1 DDC is active)
1418                - 3: Dual DDC for a single channel (Total two DDCs are enabled)
1419
1420        Raises:
1421            None
1422
1423        Returns:
1424            None
1425        """
1426        lsb = value & 1
1427        msb = value >> 1
1428        self.device.SET_EN_DUAL_BAND(lsb)
1429        self.device.SET_DIS_DUAL_CHANNEL(msb)
1430
1431    def common_decimation(self, value: int) -> None:
1432        """Sets the decimation filter factor for all active DDCs.
1433
1434        Arguments:
1435            value:
1436                value to write to the register such that Decimation Factor = 2^value.
1437
1438        Raises:
1439            None
1440
1441        Returns:
1442            None
1443        """
1444        self.device.SET_COMMON_DECIMATION_MODE(value)
1445
1446    def update_nyqusit_zone(self, value: int) -> None:
1447        """Must be pulsed after the Nyquist zone if programmed.
1448        
1449        A 0 to 1 transition on this bit copies the NYQUIST ZONE field to an internal register.
1450
1451        Argument:
1452            value: input value
1453                - 0: Normal Operation
1454                - 1: Nyquist zone value is updated
1455
1456        Raises:
1457            None
1458
1459        Returns:
1460            None
1461        """
1462        self.device.SET_UPDATE_NYQUIST(value)
1463
1464    def nyquist_zone(self, value: int) -> None:
1465        """Sets the nyquist zone of operation.
1466        
1467        The internal calibration of the device depends on the NYQUIST ZONE of the signal being sampled.
1468        This field must be programmed based on the operating Nyquist zone.
1469
1470        Arguments:
1471            value:
1472                Operating nyquist zone (0 - 7)
1473
1474        Raises:
1475            None
1476
1477        Returns:
1478            None
1479        """
1480        self.device.SET_NYQUIST_ZONE(value)
1481
1482    def ddc0_nco_frequency0(self, value: int) -> None:
1483        """Configures the 48-bit NCO frequency word 0 of DDC0.
1484
1485        Arguments:
1486            value:
1487                Value to write to the NCO frequency word, such that:\n
1488                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1489                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1490
1491        Raises:
1492            None
1493
1494        Returns:
1495            None
1496        """
1497        self.device.SET_DDC0_NCO_FREQ0(value)
1498
1499    def ddc0_nco_frequency1(self, value: int) -> None:
1500        """Configures the 48-bit NCO frequency word 1 of DDC0.
1501
1502        Arguments:
1503            value:
1504                Value to write to the NCO frequency word, such that:\n
1505                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1506                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1507
1508        Raises:
1509            None
1510
1511        Returns:
1512            None
1513        """
1514        self.device.SET_DDC0_NCO_FREQ1(value)
1515
1516    def ddc0_nco_frequency2(self, value: int) -> None:
1517        """Configures the 48-bit NCO frequency word 2 of DDC0.
1518
1519        Arguments:
1520            value:
1521                Value to write to the NCO frequency word, such that:\n
1522                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1523                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1524
1525        Raises:
1526            None
1527
1528        Returns:
1529            None
1530        """
1531        self.device.SET_DDC0_NCO_FREQ2(value)
1532
1533    def ddc0_nco_frequency3(self, value: int) -> None:
1534        """Configures the 48-bit NCO frequency word 3 of DDC0.
1535
1536        Arguments:
1537            value:
1538                Value to write to the NCO frequency word, such that:\n
1539                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1540                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1541
1542        Raises:
1543            None
1544
1545        Returns:
1546            None
1547        """
1548        self.device.SET_DDC0_NCO_FREQ3(value)
1549
1550    def ddc1_nco_frequency0(self, value: int) -> None:
1551        """Configures the 48-bit NCO frequency word 0 of DDC1.
1552
1553        Arguments:
1554            value:
1555                Value to write to the NCO frequency word, such that:\n
1556                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1557                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1558
1559        Raises:
1560            None
1561
1562        Returns:
1563            None
1564        """
1565        self.device.SET_DDC1_NCO_FREQ0(value)
1566
1567    def ddc1_nco_frequency1(self, value: int) -> None:
1568        """Configures the 48-bit NCO frequency word 1 of DDC1.
1569
1570        Arguments:
1571            value:
1572                Value to write to the NCO frequency word, such that:\n
1573                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1574                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1575
1576        Raises:
1577            None
1578
1579        Returns:
1580            None
1581        """
1582        self.device.SET_DDC1_NCO_FREQ1(value)
1583
1584    def ddc1_nco_frequency2(self, value: int) -> None:
1585        """Configures the 48-bit NCO frequency word 2 of DDC1.
1586
1587        Arguments:
1588            value:
1589                Value to write to the NCO frequency word, such that:\n
1590                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1591                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1592
1593        Raises:
1594            None
1595
1596        Returns:
1597            None
1598        """
1599        self.device.SET_DDC1_NCO_FREQ2(value)
1600
1601    def ddc1_nco_frequency3(self, value: int) -> None:
1602        """Configures the 48-bit NCO frequency word 3 of DDC1.
1603
1604        Arguments:
1605            value:
1606                Value to write to the NCO frequency word, such that:\n
1607                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1608                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1609
1610        Raises:
1611            None
1612
1613        Returns:
1614            None
1615        """
1616        self.device.SET_DDC1_NCO_FREQ3(value)
1617
1618    def ddc2_nco_frequency0(self, value: int) -> None:
1619        """Configures the 48-bit NCO frequency word 0 of DDC2.
1620
1621        Arguments:
1622            value:
1623                Value to write to the NCO frequency word, such that:\n
1624                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1625                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1626
1627        Raises:
1628            None
1629
1630        Returns:
1631            None
1632        """
1633        self.device.SET_DDC2_NCO_FREQ0(value)
1634
1635    def ddc2_nco_frequency1(self, value: int) -> None:
1636        """Configures the 48-bit NCO frequency word 1 of DDC2.
1637
1638        Arguments:
1639            value:
1640                Value to write to the NCO frequency word, such that:\n
1641                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1642                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1643
1644        Raises:
1645            None
1646
1647        Returns:
1648            None
1649        """
1650        self.device.SET_DDC2_NCO_FREQ1(value)
1651
1652    def ddc2_nco_frequency2(self, value: int) -> None:
1653        """Configures the 48-bit NCO frequency word 2 of DDC2.
1654
1655        Arguments:
1656            value:
1657                Value to write to the NCO frequency word, such that:\n
1658                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1659                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1660
1661        Raises:
1662            None
1663
1664        Returns:
1665            None
1666        """
1667        self.device.SET_DDC2_NCO_FREQ2(value)
1668
1669    def ddc2_nco_frequency3(self, value: int) -> None:
1670        """Configures the 48-bit NCO frequency word 3 of DDC2.
1671
1672        Arguments:
1673            value:
1674                Value to write to the NCO frequency word, such that:\n
1675                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1676                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1677
1678        Raises:
1679            None
1680
1681        Returns:
1682            None
1683        """
1684        self.device.SET_DDC2_NCO_FREQ3(value)
1685
1686    def ddc3_nco_frequency0(self, value: int) -> None:
1687        """Configures the 48-bit NCO frequency word 0 of DDC3.
1688
1689        Arguments:
1690            value:
1691                Value to write to the NCO frequency word, such that:\n
1692                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1693                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1694
1695        Raises:
1696            None
1697
1698        Returns:
1699            None
1700        """
1701        self.device.SET_DDC3_NCO_FREQ0(value)
1702
1703    def ddc3_nco_frequency1(self, value: int) -> None:
1704        """Configures the 48-bit NCO frequency word 1 of DDC3.
1705
1706        Arguments:
1707            value:
1708                Value to write to the NCO frequency word, such that:\n
1709                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1710                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1711
1712        Raises:
1713            None
1714
1715        Returns:
1716            None
1717        """
1718        self.device.SET_DDC3_NCO_FREQ1(value)
1719
1720    def ddc3_nco_frequency2(self, value: int) -> None:
1721        """Configures the 48-bit NCO frequency word 2 of DDC3.
1722
1723        Arguments:
1724            value:
1725                Value to write to the NCO frequency word, such that:\n
1726                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1727                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1728
1729        Raises:
1730            None
1731
1732        Returns:
1733            None
1734        """
1735        self.device.SET_DDC3_NCO_FREQ2(value)
1736
1737    def ddc3_nco_frequency3(self, value: int) -> None:
1738        """Configures the 48-bit NCO frequency word 3 of DDC3.
1739
1740        Arguments:
1741            value:
1742                Value to write to the NCO frequency word, such that:\n
1743                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1744                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1745
1746        Raises:
1747            None
1748
1749        Returns:
1750            None
1751        """
1752        self.device.SET_DDC3_NCO_FREQ3(value)
1753
1754    def ddc0_nco_phase0(self, value: int) -> None:
1755        """Configures the starting phase for NCO Frequency 0 of DDC0
1756
1757        Arguments:
1758            value:
1759                Value to write to the NCO phase word, such that:
1760                value = 90° / Phase
1761        Raises:
1762            None
1763
1764        Returns:
1765            None
1766        """
1767        self.device.SET_DDC0_NCO_PHASE0(value)
1768
1769    def ddc0_nco_phase1(self, value: int) -> None:
1770        """Configures the starting phase for NCO Frequency 1 of DDC0
1771
1772        Arguments:
1773            value:
1774                Value to write to the NCO phase word, such that:
1775                value = 90° / Phase
1776        Raises:
1777            None
1778
1779        Returns:
1780            None
1781        """
1782        self.device.SET_DDC0_NCO_PHASE1(value)
1783
1784    def ddc0_nco_phase2(self, value: int) -> None:
1785        """Configures the starting phase for NCO Frequency 2 of DDC0
1786
1787        Arguments:
1788            value:
1789                Value to write to the NCO phase word, such that:
1790                value = 90° / Phase
1791        Raises:
1792            None
1793
1794        Returns:
1795            None
1796        """
1797        self.device.SET_DDC0_NCO_PHASE2(value)
1798
1799    def ddc0_nco_phase3(self, value: int) -> None:
1800        """Configures the starting phase for NCO Frequency 3 of DDC0
1801
1802        Arguments:
1803            value:
1804                Value to write to the NCO phase word, such that:
1805                value = 90° / Phase
1806        Raises:
1807            None
1808
1809        Returns:
1810            None
1811        """
1812        self.device.SET_DDC0_NCO_PHASE3(value)
1813
1814    def ddc1_nco_phase0(self, value: int) -> None:
1815        """Configures the starting phase for NCO Frequency 0 of DDC1
1816
1817        Arguments:
1818            value:
1819                Value to write to the NCO phase word, such that:
1820                value = 90° / Phase
1821        Raises:
1822            None
1823
1824        Returns:
1825            None
1826        """
1827        self.device.SET_DDC1_NCO_PHASE0(value)
1828
1829    def ddc1_nco_phase1(self, value: int) -> None:
1830        """Configures the starting phase for NCO Frequency 1 of DDC1
1831
1832        Arguments:
1833            value:
1834                Value to write to the NCO phase word, such that:
1835                value = 90° / Phase
1836        Raises:
1837            None
1838
1839        Returns:
1840            None
1841        """
1842        self.device.SET_DDC1_NCO_PHASE1(value)
1843
1844    def ddc1_nco_phase2(self, value: int) -> None:
1845        """Configures the starting phase for NCO Frequency 2 of DDC1
1846
1847        Arguments:
1848            value:
1849                Value to write to the NCO phase word, such that:
1850                value = 90° / Phase
1851        Raises:
1852            None
1853
1854        Returns:
1855            None
1856        """
1857        self.device.SET_DDC1_NCO_PHASE2(value)
1858
1859    def ddc1_nco_phase3(self, value: int) -> None:
1860        """Configures the starting phase for NCO Frequency 3 of DDC1
1861
1862        Arguments:
1863            value:
1864                Value to write to the NCO phase word, such that:
1865                value = 90° / Phase
1866        Raises:
1867            None
1868
1869        Returns:
1870            None
1871        """
1872        self.device.SET_DDC1_NCO_PHASE3(value)
1873
1874    def ddc2_nco_phase0(self, value: int) -> None:
1875        """Configures the starting phase for NCO Frequency 0 of DDC2
1876
1877        Arguments:
1878            value:
1879                Value to write to the NCO phase word, such that:
1880                value = 90° / Phase
1881        Raises:
1882            None
1883
1884        Returns:
1885            None
1886        """
1887        self.device.SET_DDC2_NCO_PHASE0(value)
1888
1889    def ddc2_nco_phase1(self, value: int) -> None:
1890        """Configures the starting phase for NCO Frequency 1 of DDC2
1891
1892        Arguments:
1893            value:
1894                Value to write to the NCO phase word, such that:
1895                value = 90° / Phase
1896        Raises:
1897            None
1898
1899        Returns:
1900            None
1901        """
1902        self.device.SET_DDC2_NCO_PHASE1(value)
1903
1904    def ddc2_nco_phase2(self, value: int) -> None:
1905        """Configures the starting phase for NCO Frequency 2 of DDC2
1906
1907        Arguments:
1908            value:
1909                Value to write to the NCO phase word, such that:
1910                value = 90° / Phase
1911        Raises:
1912            None
1913
1914        Returns:
1915            None
1916        """
1917        self.device.SET_DDC2_NCO_PHASE2(value)
1918
1919    def ddc2_nco_phase3(self, value: int) -> None:
1920        """Configures the starting phase for NCO Frequency 3 of DDC2
1921
1922        Arguments:
1923            value:
1924                Value to write to the NCO phase word, such that:
1925                value = 90° / Phase
1926        Raises:
1927            None
1928
1929        Returns:
1930            None
1931        """
1932        self.device.SET_DDC2_NCO_PHASE3(value)
1933
1934    def ddc3_nco_phase0(self, value: int) -> None:
1935        """Configures the starting phase for NCO Frequency 0 of DDC3
1936
1937        Arguments:
1938            value:
1939                Value to write to the NCO phase word, such that:
1940                value = 90° / Phase
1941        Raises:
1942            None
1943
1944        Returns:
1945            None
1946        """
1947        self.device.SET_DDC3_NCO_PHASE0(value)
1948
1949    def ddc3_nco_phase1(self, value: int) -> None:
1950        """Configures the starting phase for NCO Frequency 1 of DDC3
1951
1952        Arguments:
1953            value:
1954                Value to write to the NCO phase word, such that:
1955                value = 90° / Phase
1956        Raises:
1957            None
1958
1959        Returns:
1960            None
1961        """
1962        self.device.SET_DDC3_NCO_PHASE1(value)
1963
1964    def ddc3_nco_phase2(self, value: int) -> None:
1965        """Configures the starting phase for NCO Frequency 2 of DDC3
1966
1967        Arguments:
1968            value:
1969                Value to write to the NCO phase word, such that:
1970                value = 90° / Phase
1971        Raises:
1972            None
1973
1974        Returns:
1975            None
1976        """
1977        self.device.SET_DDC3_NCO_PHASE2(value)
1978
1979    def ddc3_nco_phase3(self, value: int) -> None:
1980        """Configures the starting phase for NCO Frequency 3 of DDC3
1981
1982        Arguments:
1983            value:
1984                Value to write to the NCO phase word, such that:
1985                value = 90° / Phase
1986        Raises:
1987            None
1988
1989        Returns:
1990            None
1991        """
1992        self.device.SET_DDC3_NCO_PHASE3(value)
1993
1994    def enable_dclk_divider(self, value: int) -> None:
1995        """Enables the Data Clock divider for higher decimation rates.
1996
1997        Arguments:
1998            value: input value
1999                - 0: DCLK divider is disabled. DCLK is equal to the Sample CLK
2000                - 1: DCLK divider is enabled. DCLK is divided down from Sample CLK
2001
2002        Raises:
2003            None
2004
2005        Returns:
2006            None
2007        """
2008        self.device.SET_DIG_CLK_DDC(value)
2009
2010    def dclk_powerdown(self, value: int) -> None:
2011        """Powers down the LVDS output clock.
2012
2013        Arguments:
2014            value: input value
2015                - 0: Normal operation
2016                - 1: Dclk powered down
2017
2018        Raises:
2019            None
2020
2021        Returns:
2022            None
2023        """
2024        self.device.SET_DCLK_PDN(value)
2025
2026    ######################################################################################################################################
2027    # ███╗   ███╗ █████╗  ██████╗██████╗  ██████╗ ███████╗
2028    # ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔═══██╗██╔════╝
2029    # ██╔████╔██║███████║██║     ██████╔╝██║   ██║███████╗
2030    # ██║╚██╔╝██║██╔══██║██║     ██╔══██╗██║   ██║╚════██║
2031    # ██║ ╚═╝ ██║██║  ██║╚██████╗██║  ██║╚██████╔╝███████║
2032    # ╚═╝     ╚═╝╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝
2033    ######################################################################################################################################
2034
2035    def pulse_overrange_clear(self) -> None:
2036        """Macro Function. Clears the Digital Overrange by pulsing a value of 2 on the OVR_CLR register field
2037
2038        Arguments:
2039            None
2040
2041        Raises:
2042            None
2043
2044        Returns:
2045            None
2046        """
2047        self.device.SET_DIG_OVR_CLEAR(0x0)
2048        sleep(0.1)
2049        self.device.SET_DIG_OVR_CLEAR(0x2)
2050        sleep(0.1)
2051        self.device.SET_DIG_OVR_CLEAR(0x0)
2052
2053    def invert_lvds_lanes(self, lanes: List[int]) -> None:
2054        """Macro Function. Inverts the polarity of individual LVDS output lanes.
2055
2056        Arguments:
2057            lanes:
2058                List of 16 lanes with the corresponding values:
2059                - 0: Polarity as shown in pin diagram.
2060                - 1: Polarity inverted
2061
2062        Raises:
2063            None
2064
2065        Returns:
2066            None
2067        """
2068        lanes = int("".join(map(str, lanes)), 2)
2069        self.device.SET_LVDS_DATA_INV(lanes)
2070
2071    def powerdown_lvds_lanes(self, lanes: List[int]) -> None:
2072        """Macro Function. Powers down the individual LVDS output lanes and puts LVDS pins into high impedance state.
2073
2074        Arguments:
2075            lanes:
2076                List of bits which enable or disable the LVDS lanes as follows
2077                - 0: Normal operation
2078                - 1: Powered down
2079
2080        Raises:
2081            None
2082
2083        Returns:
2084            None
2085        """
2086        lanes = int("".join(map(str, lanes)), 2)
2087        self.device.SET_LVDS_DATA_PDN(lanes)
2088
2089    def dout_mux(self, lane: int, data: int) -> None:
2090        """Macro Function. Configures the data bus assignments for each individual output lane
2091
2092        Arguments:
2093            lane:
2094                The DOUT output pin to be mapped to
2095            data:
2096                The internal digital data bus lane that is being mapped
2097
2098        Raises:
2099            None
2100
2101        Returns:
2102            None
2103        """
2104        if lane == 0:
2105            self.device.SET_LANE0_MUX_SEL(data)
2106        elif lane == 1:
2107            self.device.SET_LANE1_MUX_SEL(data)
2108        elif lane == 2:
2109            self.device.SET_LANE2_MUX_SEL(data)
2110        elif lane == 3:
2111            self.device.SET_LANE3_MUX_SEL(data)
2112        elif lane == 4:
2113            self.device.SET_LANE4_MUX_SEL(data)
2114        elif lane == 5:
2115            self.device.SET_LANE5_MUX_SEL(data)
2116        elif lane == 6:
2117            self.device.SET_LANE6_MUX_SEL(data)
2118        elif lane == 7:
2119            self.device.SET_LANE7_MUX_SEL(data)
2120        elif lane == 8:
2121            self.device.SET_LANE8_MUX_SEL(data)
2122        elif lane == 9:
2123            self.device.SET_LANE9_MUX_SEL(data)
2124        elif lane == 10:
2125            self.device.SET_LANE10_MUX_SEL(data)
2126        elif lane == 11:
2127            self.device.SET_LANE11_MUX_SEL(data)
2128        elif lane == 12:
2129            self.device.SET_LANE12_MUX_SEL(data)
2130        elif lane == 13:
2131            self.device.SET_LANE13_MUX_SEL(data)
2132        elif lane == 14:
2133            self.device.SET_LANE14_MUX_SEL(data)
2134        elif lane == 15:
2135            self.device.SET_LANE15_MUX_SEL(data)
2136
2137    def lvds_mirror_all(self, lane: int) -> None:
2138        """Macro Function. Mirrors all LVDS lanes to data of chosen lane
2139
2140        Arguments:
2141            lane:
2142                The desired lane data to mirror to all output lanes
2143
2144        Raises:
2145            None
2146
2147        Returns:
2148            None
2149        """
2150        for i in range(0, 16):
2151            self.dout_mux(i, lane)
2152
2153    def cha_digital_gain(self, value: int) -> None:
2154        """Macro Function. Controls digital gain for channel A. Maximum gain is 6dB.
2155
2156        Arguments:
2157            value:
2158                Desired gain value in dB
2159
2160        Raises:
2161            None
2162
2163        Returns:
2164            None
2165        """
2166        gain = 20 * log(1 + (value / 128), 10)
2167        self.device.SET_CH0_PROG_GAIN(gain)
2168
2169    def chb_digital_gain(self, value: int) -> None:
2170        """Macro Function. Controls digital gain for channel B. Maximum gain is 6dB.
2171
2172        Arguments:
2173            value:
2174                Desired gain value in dB
2175
2176        Raises:
2177            None
2178
2179        Returns:
2180            None
2181        """
2182        gain = 20 * log(1 + (value / 128), 10)
2183        self.device.SET_CH1_PROG_GAIN(gain)
2184
2185    def sysref_pulse(self) -> None:
2186        """Macro Function. Pulses the sysref signal
2187
2188        Arguments:
2189            None
2190
2191        Raises:
2192            None
2193
2194        Returns:
2195            None
2196        """
2197        self.sysref_mode(0)
2198        sleep(0.1)
2199        self.sysref_mode(3)
2200        sleep(0.1)
2201        self.sysref_mode(0)
2202
2203    def ddc_input_source(self, ddc: int, input: int) -> None:
2204        """Macro Function. Sets the input data source to each of the decimation filters.
2205
2206        Arguments:
2207            ddc:
2208                The DDC for which the input data source is being configured
2209            input:
2210                Input to the DDC
2211                - 0: Channel A
2212                - 1: Channel B
2213                - 2: 2x Average ((ChA + ChB)/2)
2214                - 3: 2x Average ((ChA - ChB)/2)
2215
2216        Raises:
2217            None
2218
2219        Returns:
2220            None
2221        """
2222        if ddc == 0:
2223            self.device.SET_DDC0_MUX(input)
2224        elif ddc == 1:
2225            if input == 0:
2226                input = 1
2227            elif input == 1:
2228                input = 0
2229            self.device.SET_DDC1_MUX(input)
2230        elif ddc == 2:
2231            self.device.SET_DDC2_MUX(input)
2232        elif ddc == 3:
2233            if input == 0:
2234                input = 1
2235            elif input == 1:
2236                input = 0
2237            self.device.SET_DDC3_MUX(input)
2238
2239    def nco_update(self, nco: int) -> None:
2240        """Macro Function. Updates the frequency of the selected NCO by pulsing a value of 1 on the corresponding NCO_UPDATE field
2241
2242        Arguments:
2243            nco:
2244                NCO that is being configured
2245
2246        Raises:
2247            None
2248
2249        Returns:
2250            None
2251        """
2252        if nco == 0:
2253            self.device.SET_NCO0_UPDATE(0)
2254            sleep(0.1)
2255            self.device.SET_NCO0_UPDATE(1)
2256            sleep(0.1)
2257            self.device.SET_NCO0_UPDATE(1)
2258        elif nco == 1:
2259            self.device.SET_NCO1_UPDATE(0)
2260            sleep(0.1)
2261            self.device.SET_NCO1_UPDATE(1)
2262            sleep(0.1)
2263            self.device.SET_NCO1_UPDATE(1)
2264        elif nco == 2:
2265            self.device.SET_NCO2_UPDATE(0)
2266            sleep(0.1)
2267            self.device.SET_NCO2_UPDATE(1)
2268            sleep(0.1)
2269            self.device.SET_NCO2_UPDATE(1)
2270        elif nco == 3:
2271            self.device.SET_NCO3_UPDATE(0)
2272            sleep(0.1)
2273            self.device.SET_NCO3_UPDATE(1)
2274            sleep(0.1)
2275            self.device.SET_NCO3_UPDATE(1)
2276
2277    def nco_update_common(self) -> None:
2278        """Macro Function. Updates the four NCO frequencies of all NCOs by pulsing a vlaue of 1 on the NCO_COMMON_UPDATE field
2279
2280        Arguments:
2281            None
2282
2283        Raises:
2284            None
2285
2286        Returns:
2287            None
2288        """
2289        self.device.SET_NCO_COMMON_UPDATE(0)
2290        sleep(0.1)
2291        self.device.SET_NCO_COMMON_UPDATE(1)
2292        sleep(0.1)
2293        self.device.SET_NCO_COMMON_UPDATE(0)
2294
2295    def ddc_nco_select(self, ddc: int, nco: int) -> None:
2296        """Macro Function. These bits select which of the 4 frequencies are active in the respective DDCs/NCOs.
2297
2298        Arguments:
2299            ddc:
2300                DDC of which to configure the nco frequency
2301            nco:
2302                NCO frequency to set as the active frequency
2303
2304        Raises:
2305            None
2306
2307        Returns:
2308            None
2309        """
2310        if ddc == 0:
2311            self.device.SET_DDC0_NCO_SEL(nco)
2312        elif ddc == 1:
2313            self.device.SET_DDC1_NCO_SEL(nco)
2314        elif ddc == 2:
2315            self.device.SET_DDC2_NCO_SEL(nco)
2316        elif ddc == 3:
2317            self.device.SET_DDC3_NCO_SEL(nco)
2318
2319    def ddc_decimation_factor(self, ddc: int, factor: int) -> None:
2320        """Macro Function. Sets the decimation factor for each DDC
2321
2322        Arguments:
2323            ddc:
2324                The DDC for which the decimation factor is being configured
2325            factor:
2326                Desired decimation factor
2327
2328        Raises:
2329            None
2330
2331        Returns:
2332            None
2333        """
2334        if factor == 0:
2335            n = factor
2336        else:
2337            n = int(log(factor, 2))
2338
2339        self.device.SET_SELECT_INDEPENDENT_DECIMATION(
2340            1
2341        )  # Configure for different decimation factors for each DDC
2342
2343        if ddc == 0:
2344            self.device.SET_DDC0_DECIMATION_MODE(n)
2345        elif ddc == 1:
2346            self.device.SET_DDC1_DECIMATION_MODE(n)
2347        elif ddc == 2:
2348            self.device.SET_DDC2_DECIMATION_MODE(n)
2349        elif ddc == 3:
2350            self.device.SET_DDC3_DECIMATION_MODE(n)
2351
2352    def decimation_factor_common(self, factor: int) -> None:
2353        """Macro Function. Enables decimation for all DDCs and sets the common decimation factor for all DDCs
2354
2355        Arguments:
2356            factor:
2357                Desired decimation factor
2358
2359        Raises:
2360            None
2361
2362        Returns:
2363            None
2364        """
2365        if factor == 0:
2366            n = factor
2367        else:
2368            n = int(log(factor, 2))
2369
2370        self.device.SET_SELECT_INDEPENDENT_DECIMATION(
2371            0
2372        )  # Configure for common decimation factors for all DDCs
2373        self.device.SET_COMMON_DECIMATION_MODE(n)
2374
2375    def ddc_nco_frequency(self, ddc: int, nco: int, freq: int) -> None:
2376        """Macro Function. Configures the 48-bit frequency words for the four DDCs/NCOs.
2377
2378        Arguments:
2379            ddc:
2380                DDC of which the frequency is being configured
2381            nco:
2382                NCO frequency which is being configured (0-3)
2383            freq:
2384                Desired frequency
2385
2386        Raises:
2387            None
2388
2389        Returns:
2390            None
2391        """
2392        if freq > 0:
2393            nco_word = int(
2394                freq * (2**48) / self.fs
2395            )  # Formula for calulating this value is in the datasheet
2396        else:
2397            nco_word = int(
2398                ((self.device.fs + freq) * (2**48) / self.fs) - 1
2399            )  # Formula for calulating this value is in the datasheet
2400
2401        if ddc == 0:
2402            if nco == 0:
2403                self.device.SET_DDC0_NCO_FREQ0(nco_word)
2404            elif nco == 1:
2405                self.device.SET_DDC0_NCO_FREQ1(nco_word)
2406            elif nco == 2:
2407                self.device.SET_DDC0_NCO_FREQ2(nco_word)
2408            elif nco == 3:
2409                self.device.SET_DDC0_NCO_FREQ3(nco_word)
2410        elif ddc == 1:
2411            if nco == 0:
2412                self.device.SET_DDC1_NCO_FREQ0(nco_word)
2413            elif nco == 1:
2414                self.device.SET_DDC1_NCO_FREQ1(nco_word)
2415            elif nco == 2:
2416                self.device.SET_DDC1_NCO_FREQ2(nco_word)
2417            elif nco == 3:
2418                self.device.SET_DDC1_NCO_FREQ3(nco_word)
2419        elif ddc == 2:
2420            if nco == 0:
2421                self.device.SET_DDC2_NCO_FREQ0(nco_word)
2422            elif nco == 1:
2423                self.device.SET_DDC2_NCO_FREQ1(nco_word)
2424            elif nco == 2:
2425                self.device.SET_DDC2_NCO_FREQ2(nco_word)
2426            elif nco == 3:
2427                self.device.SET_DDC2_NCO_FREQ3(nco_word)
2428        elif ddc == 3:
2429            if nco == 0:
2430                self.device.SET_DDC3_NCO_FREQ0(nco_word)
2431            elif nco == 1:
2432                self.device.SET_DDC3_NCO_FREQ1(nco_word)
2433            elif nco == 2:
2434                self.device.SET_DDC3_NCO_FREQ2(nco_word)
2435            elif nco == 3:
2436                self.device.SET_DDC3_NCO_FREQ3(nco_word)
2437
2438    def ddc_nco_phase(self, ddc: int, nco: int, phase: int) -> None:
2439        """Macro Function. Configure the starting phase of the frequency for the DDCs/NCOs. The phase value is: 90° / <16-bit register>
2440
2441        Arguments:
2442            ddc:
2443                DDC of which the phase is being configured
2444            nco:
2445                NCO of which the phase is being configured
2446            phase:
2447                desired phase in degrees
2448
2449        Raises:
2450            None
2451
2452        Returns:
2453            None
2454        """
2455        if phase == 0:
2456            phaseval = 0
2457        else:
2458            phaseval = int(90 / phase)
2459
2460        if ddc == 0:
2461            if nco == 0:
2462                self.device.SET_DDC0_NCO_PHASE0(phaseval)
2463            elif nco == 1:
2464                self.device.SET_DDC0_NCO_PHASE1(phaseval)
2465            elif nco == 2:
2466                self.device.SET_DDC0_NCO_PHASE2(phaseval)
2467            elif nco == 3:
2468                self.device.SET_DDC0_NCO_PHASE3(phaseval)
2469        elif ddc == 1:
2470            if nco == 0:
2471                self.device.SET_DDC0_NCO_PHASE0(phaseval)
2472            elif nco == 1:
2473                self.device.SET_DDC1_NCO_PHASE1(phaseval)
2474            elif nco == 2:
2475                self.device.SET_DDC2_NCO_PHASE2(phaseval)
2476            elif nco == 3:
2477                self.device.SET_DDC3_NCO_PHASE3(phaseval)
2478        elif ddc == 2:
2479            if nco == 0:
2480                self.device.SET_DDC0_NCO_PHASE0(phaseval)
2481            elif nco == 1:
2482                self.device.SET_DDC1_NCO_PHASE1(phaseval)
2483            elif nco == 2:
2484                self.device.SET_DDC2_NCO_PHASE2(phaseval)
2485            elif nco == 3:
2486                self.device.SET_DDC3_NCO_PHASE3(phaseval)
2487        elif ddc == 3:
2488            if nco == 0:
2489                self.device.SET_DDC0_NCO_PHASE0(phaseval)
2490            elif nco == 1:
2491                self.device.SET_DDC1_NCO_PHASE1(phaseval)
2492            elif nco == 2:
2493                self.device.SET_DDC2_NCO_PHASE2(phaseval)
2494            elif nco == 3:
2495                self.device.SET_DDC3_NCO_PHASE3(phaseval)
2496
2497    def read_all_regs(self) -> None:
2498        """Macro Function. Reads all registers for configuration debug purposes.
2499
2500        Arguments:
2501            None
2502
2503        Raises:
2504            None
2505
2506        Returns:
2507            None
2508        """
2509        self.device.debugReadback()

Python API for ADC3669 family devices.

Attributes:
  • alias: String used to identify the ADC being interfaced with
  • device: Reference to the low level API which handles register field functions.
  • fs: Sampling frequency of the device
ADC3669(alias: str, device_handle, sample_freq: int)
18    def __init__(self, alias:str, device_handle, sample_freq:int):
19        """Constructor for ADC3669 API.
20        
21        Arguments:
22            alias: String used to identify the ADC being interfaced with
23            device_handle: Object which handles SPI communication to the device. Contains read and write functions.
24            sample_freq: Sampling frequency of the device.
25        
26        Raises:
27            None
28
29        Returns:
30            An instance of the ADC3669 API class
31
32        """
33        self.alias = alias
34        self.fs = sample_freq
35        self.device = Samrat(device_handle, sample_freq)

Constructor for ADC3669 API.

Arguments:
  • alias: String used to identify the ADC being interfaced with
  • device_handle: Object which handles SPI communication to the device. Contains read and write functions.
  • sample_freq: Sampling frequency of the device.
Raises:
  • None
Returns:

An instance of the ADC3669 API class

alias
fs
device
def reg_read(self, addr: int) -> int:
37    def reg_read(self, addr: int) -> int:
38        """Reads the value stored in a register
39
40        Arguments:
41            addr:
42                The address of the desired register
43
44        Raises:
45            None
46
47        Returns:
48            The value of the register that is read back
49        """
50        return self.device.read(addr)

Reads the value stored in a register

Arguments:
  • addr: The address of the desired register
Raises:
  • None
Returns:

The value of the register that is read back

def reg_write(self, addr: int, value: int) -> None:
52    def reg_write(self, addr: int, value: int) -> None:
53        """Writes a value into a register
54
55        Arguments:
56            addr:
57                The address of the desired register
58            value:
59                The value that is to be written to the register
60
61        Raises:
62            None
63
64        Returns:
65            None
66        """
67        self.device.write(addr, value)

Writes a value into a register

Arguments:
  • addr: The address of the desired register
  • value: The value that is to be written to the register
Raises:
  • None
Returns:

None

def configure_ready(self) -> int:
69    def configure_ready(self) -> int:
70        """Indicates the status of the internal fuse load after HW reset. The device should not be programmed before the fuse load is complete.
71
72        Arguments:
73            None
74
75        Raises:
76            None
77
78        Returns:
79            Status of the fuse autoload.
80
81            - 0: Fuse autoload is incomplete, and the device should not be programmed
82            - 1: Fuse autoload is complete, the device can be programmed
83        """
84        return self.device.GET_FUSE_LOAD_DONE()

Indicates the status of the internal fuse load after HW reset. The device should not be programmed before the fuse load is complete.

Arguments:
  • None
Raises:
  • None
Returns:

Status of the fuse autoload.

  • 0: Fuse autoload is incomplete, and the device should not be programmed
  • 1: Fuse autoload is complete, the device can be programmed
def reset(self) -> None:
86    def reset(self) -> None:
87        """Resets the device. The register will self clear after reset.
88
89        Arguments:
90            None
91
92        Raises:
93            None
94
95        Returns:
96            None
97        """
98        self.device.SET_SOFTWARE_RESET(1)

Resets the device. The register will self clear after reset.

Arguments:
  • None
Raises:
  • None
Returns:

None

def global_powerdown(self, value: int) -> None:
100    def global_powerdown(self, value: int) -> None:
101        """Powers down the device.
102
103        Arguments:
104            value: input value
105                - 0: Normal Operation
106                - 1: Powerdown
107
108        Raises:
109            None
110
111        Returns:
112            None
113        """
114        self.device.SET_GLOBAL_PDN(value)

Powers down the device.

Arguments:
  • value: input value
    • 0: Normal Operation
    • 1: Powerdown
Raises:
  • None
Returns:

None

def fast_powerdown_cha(self, value: int) -> None:
116    def fast_powerdown_cha(self, value: int) -> None:
117        """Puts channel A into a low power state that enables a fast wake time.
118
119        Arguments:
120            value: input value
121                - 0: Normal Operation
122                - 1: Powerdown
123
124        Raises:
125            None
126
127        Returns:
128            None
129        """
130        self.device.SET_FAST_PDN_CH0(value)

Puts channel A into a low power state that enables a fast wake time.

Arguments:
  • value: input value
    • 0: Normal Operation
    • 1: Powerdown
Raises:
  • None
Returns:

None

def fast_powerdown_chb(self, state: int) -> None:
132    def fast_powerdown_chb(self, state: int) -> None:
133        """Puts channel B into a low power state that enables a fast wake time.
134
135        Arguments:
136            value: input value
137                - 0: Normal Operation
138                - 1: Powerdown
139
140        Raises:
141            None
142
143        Returns:
144            None
145        """
146        self.device.SET_FAST_PDN_CH1(state)

Puts channel B into a low power state that enables a fast wake time.

Arguments:
  • value: input value
    • 0: Normal Operation
    • 1: Powerdown
Raises:
  • None
Returns:

None

def sysref_detect_clear(self, value: int) -> None:
148    def sysref_detect_clear(self, value: int) -> None:
149        """resets the SYSREF DET flag
150
151        Arguments:
152            value: input value
153                - 0: Normal operation
154                - 1: SYSREF DET flag gets reset
155
156        Raises:
157            None
158
159        Returns:
160            None
161        """
162        self.device.SET_SYSREF_DET_CLR(value)

resets the SYSREF DET flag

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: SYSREF DET flag gets reset
Raises:
  • None
Returns:

None

def cha_termination(self, value: int) -> None:
164    def cha_termination(self, value: int) -> None:
165        """Sets the internal termination on channel A.
166
167        Arguments:
168            value: input value
169                - 0: 100Ω differential termination
170                - 1: 200Ω differential termination
171
172        Raises:
173            None
174
175        Returns:
176            None
177        """
178        self.device.SET_CH0_200_OHM_TERM(value)

Sets the internal termination on channel A.

Arguments:
  • value: input value
    • 0: 100Ω differential termination
    • 1: 200Ω differential termination
Raises:
  • None
Returns:

None

def chb_termination(self, value: int) -> None:
180    def chb_termination(self, value: int) -> None:
181        """Sets the internal termination on channel B.
182
183        Arguments:
184            value: input value
185                - 0: 100Ω differential termination
186                - 1: 200Ω differential termination
187
188        Raises:
189            None
190
191        Returns:
192            None
193        """
194        self.device.SET_CH1_200_OHM_TERM(value)

Sets the internal termination on channel B.

Arguments:
  • value: input value
    • 0: 100Ω differential termination
    • 1: 200Ω differential termination
Raises:
  • None
Returns:

None

def overrange_clear(self, value) -> None:
196    def overrange_clear(self, value) -> None:
197        """A transition from 0 to 2 clears the clears the sticky overrange bit.
198
199        Arguments:
200            value: input value
201                - 0: Normal operation
202                - 2: Overrange bit is cleared
203
204        Raises:
205            None
206
207        Returns:
208            None
209        """
210        self.device.SET_DIG_OVR_CLEAR(value)

A transition from 0 to 2 clears the clears the sticky overrange bit.

Arguments:
  • value: input value
    • 0: Normal operation
    • 2: Overrange bit is cleared
Raises:
  • None
Returns:

None

def overrange_sticky(self, value: int) -> None:
212    def overrange_sticky(self, value: int) -> None:
213        """Makes the digital Overrange sticky.
214
215        Arguments:
216            value: input value
217                - 0: Digital OVR is non-sticky (updated based on overrange_length())
218                - 1: Digital OVR is sticky (use overrange_clear() to reset)
219
220        Raises:
221            None
222
223        Returns:
224            None
225        """
226        self.device.SET_DIG_OVR_MODE(value)

Makes the digital Overrange sticky.

Arguments:
  • value: input value
    • 0: Digital OVR is non-sticky (updated based on overrange_length())
    • 1: Digital OVR is sticky (use overrange_clear() to reset)
Raises:
  • None
Returns:

None

def overrange_length(self, value: int) -> None:
228    def overrange_length(self, value: int) -> None:
229        """Controls the Overrange pulse expansion. The expansion width is specified in terms of number of clock cycles.
230
231        Arguments:
232            value: input value
233                8-bit integer specifying the ovr pulse expansion in number of clock cycles
234
235        Raises:
236            None
237
238        Returns:
239            None
240        """
241        self.device.SET_DIG_OVR_WIDTH(value)

Controls the Overrange pulse expansion. The expansion width is specified in terms of number of clock cycles.

Arguments:
  • value: input value 8-bit integer specifying the ovr pulse expansion in number of clock cycles
Raises:
  • None
Returns:

None

def lvds_termination(self, value: int) -> None:
243    def lvds_termination(self, value: int) -> None:
244        """Configures the LVDS termination resistance
245
246        Arguments:
247            value: input value
248                - 0: LVDS termination is 50Ω
249                - 1: LVDS termination is 100Ω
250
251        Raises:
252            None
253
254        Returns:
255            None
256        """
257        self.device.SET_HUNDRED_OHM_TERM(value)

Configures the LVDS termination resistance

Arguments:
  • value: input value
    • 0: LVDS termination is 50Ω
    • 1: LVDS termination is 100Ω
Raises:
  • None
Returns:

None

def lvds_half_swing(self, value: int) -> None:
259    def lvds_half_swing(self, value: int) -> None:
260        """Reduces LVDS output swing by 50% to reduce power consumption
261
262        Arguments:
263            value: input value
264                - 0: Normal output swing
265                - 1: Reduced output swing
266
267        Raises:
268            None
269
270        Returns:
271            None
272        """
273        self.device.SET_LVDS_HALF_SWING_EN(value)

Reduces LVDS output swing by 50% to reduce power consumption

Arguments:
  • value: input value
    • 0: Normal output swing
    • 1: Reduced output swing
Raises:
  • None
Returns:

None

def data_rate(self, value: int) -> None:
275    def data_rate(self, value: int) -> None:
276        """This bit configures the parallel LVDS output interface. When only a single channel is output, SDR LVDS can be enabled.
277
278        Arguments:
279            value: input value
280                - 0: Dual Data Rate (DDR)
281                - 1: Single Data Rate (SDR)
282
283        Raises:
284            None
285
286        Returns:
287            None
288        """
289        self.device.SET_SDR(value)

This bit configures the parallel LVDS output interface. When only a single channel is output, SDR LVDS can be enabled.

Arguments:
  • value: input value
    • 0: Dual Data Rate (DDR)
    • 1: Single Data Rate (SDR)
Raises:
  • None
Returns:

None

def swap_channels(self, value: int) -> None:
291    def swap_channels(self, value: int) -> None:
292        """Internally swaps channel A and channel B.
293
294        Arguments:
295            value: input value
296                - 0: Normal operation
297                - 1: Channel A and channel B are swapped
298
299        Raises:
300            None
301
302        Returns:
303            None
304        """
305        self.device.SET_SWAP_CHANNELS(value)

Internally swaps channel A and channel B.

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: Channel A and channel B are swapped
Raises:
  • None
Returns:

None

def lvds_data_invert(self, value) -> None:
307    def lvds_data_invert(self, value) -> None:
308        """Inverts the polarity of individual LVDS output lanes.
309
310        Arguments:
311            lanes:
312                Value to write to the register, where each bit represents as listed in the datasheet, and the values correspond to the following functions:
313                - 0: Normal operation
314                - 1: LVDS Lane is inverted
315
316        Raises:
317            None
318
319        Returns:
320            None
321        """
322        self.device.SET_LVDS_DATA_INV(value)

Inverts the polarity of individual LVDS output lanes.

Arguments:
  • lanes: Value to write to the register, where each bit represents as listed in the datasheet, and the values correspond to the following functions:
    • 0: Normal operation
    • 1: LVDS Lane is inverted
Raises:
  • None
Returns:

None

def lvds_powerdown(self, value: List[int]) -> None:
324    def lvds_powerdown(self, value: List[int]) -> None:
325        """Powers down the individual LVDS output lanes and puts LVDS pins into high impedance state.
326
327        Arguments:
328            value: input value
329                Value to write to the register, where each bit represents as listed in the datasheet, and the values correspond to the following functions:
330                - 0: Normal operation
331                - 1: Powered down
332
333        Raises:
334            None
335
336        Returns:
337            None
338        """
339        self.device.SET_LVDS_DATA_PDN(value)

Powers down the individual LVDS output lanes and puts LVDS pins into high impedance state.

Arguments:
  • value: input value Value to write to the register, where each bit represents as listed in the datasheet, and the values correspond to the following functions:
    • 0: Normal operation
    • 1: Powered down
Raises:
  • None
Returns:

None

def fclk_duty_cycle(self, value: int) -> None:
341    def fclk_duty_cycle(self, value: int) -> None:
342        """Adjusts the Frame clock duty cycle.
343        Arguments:
344            value: input value
345                - 0: FCLK stays high for one DCLK cycle at the beginning of the output sample
346                - 1: FCLK stays high for 50% of the output sample
347
348        Raises:
349            None
350
351        Returns:
352            None
353        """
354        self.device.SET_ENABLE_50PER_DUTY_FCLK(value)

Adjusts the Frame clock duty cycle.

Arguments:
  • value: input value
    • 0: FCLK stays high for one DCLK cycle at the beginning of the output sample
    • 1: FCLK stays high for 50% of the output sample
Raises:
  • None
Returns:

None

def fclk_disable(self, value: int) -> None:
356    def fclk_disable(self, value: int) -> None:
357        """Disables the output Frame clock.
358
359        Arguments:
360            value: input value
361                - 0: FCLK replaces the LSB data and is transmitted on DOUT0
362                - 1: FCLK is disabled and the LSB data is transmitted on DOUT0.
363
364        Raises:
365            None
366
367        Returns:
368            None
369        """
370        self.device.SET_DISABLE_FRAME_INSERTION(value)

Disables the output Frame clock.

Arguments:
  • value: input value
    • 0: FCLK replaces the LSB data and is transmitted on DOUT0
    • 1: FCLK is disabled and the LSB data is transmitted on DOUT0.
Raises:
  • None
Returns:

None

def lvds_mux_enable(self, value: int) -> None:
372    def lvds_mux_enable(self, value: int) -> None:
373        """Enables use of the LVDS output mux
374
375        Arguments:
376            value: input value
377                - 0: LVDS Mux disabled
378                - 1: LVDS Mux enabled
379
380        Raises:
381            None
382
383        Returns:
384            None
385        """
386        self.device.SET_LVDS_CROSS_BAR_MUX_EN(value)

Enables use of the LVDS output mux

Arguments:
  • value: input value
    • 0: LVDS Mux disabled
    • 1: LVDS Mux enabled
Raises:
  • None
Returns:

None

def lvds_swap_edge(self, value: int) -> None:
388    def lvds_swap_edge(self, value: int) -> None:
389        """Swaps the output data bits transmitted on rising and falling edge of DCLK.
390
391        Arguments:
392            value: input value
393                - 0: Normal operation
394                - 1: Output bits on rising and falling edge are swapped.
395
396        Raises:
397            None
398
399        Returns:
400            None
401        """
402        self.device.SET_LVDS_SWAP_RISE_FALL(value)

Swaps the output data bits transmitted on rising and falling edge of DCLK.

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: Output bits on rising and falling edge are swapped.
Raises:
  • None
Returns:

None

def lvds_scrambling(self, value: int) -> None:
404    def lvds_scrambling(self, value: int) -> None:
405        """Controls the scrambling and LSB insertion configuration on the output data
406
407        Arguments:
408            value: input value
409                - 0: No scrambling, Defualt Operation
410                - 1: Data is XOR'ed with a PRBS bit. This PRBS is inserted on the LSB position
411                - 2: OVR is inserted on the LSB position
412                - 3: OVR is inserted on the LSB+1 position
413                - 4: Data is XOR'ed with a PRBS bit, and the PRBS is inserted on LSB+1 position
414                - 5: OVR is inserted on LSB+1 position, PRBS is inseted on LSB position. Data is XOR'ed with PRBS
415                - 6: OVR is inserted on LSB+2 position, PRBS is inseted on LSB+1 position. Data is XOR'ed with PRBS
416
417        Raises:
418            None
419
420        Returns:
421            None
422        """
423        self.device.SET_LVDS_DATA_DITH_MODE(value)

Controls the scrambling and LSB insertion configuration on the output data

Arguments:
  • value: input value
    • 0: No scrambling, Defualt Operation
    • 1: Data is XOR'ed with a PRBS bit. This PRBS is inserted on the LSB position
    • 2: OVR is inserted on the LSB position
    • 3: OVR is inserted on the LSB+1 position
    • 4: Data is XOR'ed with a PRBS bit, and the PRBS is inserted on LSB+1 position
    • 5: OVR is inserted on LSB+1 position, PRBS is inseted on LSB position. Data is XOR'ed with PRBS
    • 6: OVR is inserted on LSB+2 position, PRBS is inseted on LSB+1 position. Data is XOR'ed with PRBS
Raises:
  • None
Returns:

None

def dout0_mux(self, data: int) -> None:
425    def dout0_mux(self, data: int) -> None:
426        """Configures the digital data output on LVDS lane 0
427
428        Arguments:
429            data:
430                The internal digital data bus lane that is being mapped
431
432        Raises:
433            None
434
435        Returns:
436            None
437        """
438        self.device.SET_LANE0_MUX_SEL(data)

Configures the digital data output on LVDS lane 0

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout1_mux(self, data: int) -> None:
440    def dout1_mux(self, data: int) -> None:
441        """Configures the digital data output on LVDS lane 1
442
443        Arguments:
444            data:
445                The internal digital data bus lane that is being mapped
446
447        Raises:
448            None
449
450        Returns:
451            None
452        """
453        self.device.SET_LANE1_MUX_SEL(data)

Configures the digital data output on LVDS lane 1

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout2_mux(self, data: int) -> None:
455    def dout2_mux(self, data: int) -> None:
456        """Configures the digital data output on LVDS lane 2
457
458        Arguments:
459            data:
460                The internal digital data bus lane that is being mapped
461
462        Raises:
463            None
464
465        Returns:
466            None
467        """
468        self.device.SET_LANE2_MUX_SEL(data)

Configures the digital data output on LVDS lane 2

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout3_mux(self, data: int) -> None:
470    def dout3_mux(self, data: int) -> None:
471        """Configures the digital data output on LVDS lane 3
472
473        Arguments:
474            data:
475                The internal digital data bus lane that is being mapped
476
477        Raises:
478            None
479
480        Returns:
481            None
482        """
483        self.device.SET_LANE3_MUX_SEL(data)

Configures the digital data output on LVDS lane 3

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout4_mux(self, data: int) -> None:
485    def dout4_mux(self, data: int) -> None:
486        """Configures the digital data output on LVDS lane 4
487
488        Arguments:
489            data:
490                The internal digital data bus lane that is being mapped
491
492        Raises:
493            None
494
495        Returns:
496            None
497        """
498        self.device.SET_LANE4_MUX_SEL(data)

Configures the digital data output on LVDS lane 4

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout5_mux(self, data: int) -> None:
500    def dout5_mux(self, data: int) -> None:
501        """Configures the digital data output on LVDS lane 5
502
503        Arguments:
504            data:
505                The internal digital data bus lane that is being mapped
506
507        Raises:
508            None
509
510        Returns:
511            None
512        """
513        self.device.SET_LANE5_MUX_SEL(data)

Configures the digital data output on LVDS lane 5

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout6_mux(self, data: int) -> None:
515    def dout6_mux(self, data: int) -> None:
516        """Configures the digital data output on LVDS lane 6
517
518        Arguments:
519            data:
520                The internal digital data bus lane that is being mapped
521
522        Raises:
523            None
524
525        Returns:
526            None
527        """
528        self.device.SET_LANE6_MUX_SEL(data)

Configures the digital data output on LVDS lane 6

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout7_mux(self, data: int) -> None:
530    def dout7_mux(self, data: int) -> None:
531        """Configures the digital data output on LVDS lane 7
532
533        Arguments:
534            data:
535                The internal digital data bus lane that is being mapped
536
537        Raises:
538            None
539
540        Returns:
541            None
542        """
543        self.device.SET_LANE7_MUX_SEL(data)

Configures the digital data output on LVDS lane 7

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout8_mux(self, data: int) -> None:
545    def dout8_mux(self, data: int) -> None:
546        """Configures the digital data output on LVDS lane 8
547
548        Arguments:
549            data:
550                The internal digital data bus lane that is being mapped
551
552        Raises:
553            None
554
555        Returns:
556            None
557        """
558        self.device.SET_LANE8_MUX_SEL(data)

Configures the digital data output on LVDS lane 8

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout9_mux(self, data: int) -> None:
560    def dout9_mux(self, data: int) -> None:
561        """Configures the digital data output on LVDS lane 9
562
563        Arguments:
564            data:
565                The internal digital data bus lane that is being mapped
566
567        Raises:
568            None
569
570        Returns:
571            None
572        """
573        self.device.SET_LANE9_MUX_SEL(data)

Configures the digital data output on LVDS lane 9

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout10_mux(self, data: int) -> None:
575    def dout10_mux(self, data: int) -> None:
576        """Configures the digital data output on LVDS lane 10
577
578        Arguments:
579            data:
580                The internal digital data bus lane that is being mapped
581
582        Raises:
583            None
584
585        Returns:
586            None
587        """
588        self.device.SET_LANE10_MUX_SEL(data)

Configures the digital data output on LVDS lane 10

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout11_mux(self, data: int) -> None:
590    def dout11_mux(self, data: int) -> None:
591        """Configures the digital data output on LVDS lane 11
592
593        Arguments:
594            data:
595                The internal digital data bus lane that is being mapped
596
597        Raises:
598            None
599
600        Returns:
601            None
602        """
603        self.device.SET_LANE11_MUX_SEL(data)

Configures the digital data output on LVDS lane 11

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout12_mux(self, data: int) -> None:
605    def dout12_mux(self, data: int) -> None:
606        """Configures the digital data output on LVDS lane 12
607
608        Arguments:
609            data:
610                The internal digital data bus lane that is being mapped
611
612        Raises:
613            None
614
615        Returns:
616            None
617        """
618        self.device.SET_LANE12_MUX_SEL(data)

Configures the digital data output on LVDS lane 12

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout13_mux(self, data: int) -> None:
620    def dout13_mux(self, data: int) -> None:
621        """Configures the digital data output on LVDS lane 13
622
623        Arguments:
624            data:
625                The internal digital data bus lane that is being mapped
626
627        Raises:
628            None
629
630        Returns:
631            None
632        """
633        self.device.SET_LANE13_MUX_SEL(data)

Configures the digital data output on LVDS lane 13

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout14_mux(self, data: int) -> None:
635    def dout14_mux(self, data: int) -> None:
636        """Configures the digital data output on LVDS lane 14
637
638        Arguments:
639            data:
640                The internal digital data bus lane that is being mapped
641
642        Raises:
643            None
644
645        Returns:
646            None
647        """
648        self.device.SET_LANE14_MUX_SEL(data)

Configures the digital data output on LVDS lane 14

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def dout15_mux(self, data: int) -> None:
650    def dout15_mux(self, data: int) -> None:
651        """Configures the digital data output on LVDS lane 15
652
653        Arguments:
654            data:
655                The internal digital data bus lane that is being mapped
656
657        Raises:
658            None
659
660        Returns:
661            None
662        """
663        self.device.SET_LANE15_MUX_SEL(data)

Configures the digital data output on LVDS lane 15

Arguments:
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def high_fin(self, value: int) -> None:
665    def high_fin(self, value: int) -> None:
666        """Enable for best AC performance for input frequencies greater than 500 MHz
667
668        Arguments:
669            value: input value
670                - 0: Normal operation
671                - 1: Performance optimized for input frequencies greater than 500 MHz
672
673        Raises:
674            None
675
676        Returns:
677            None
678        """
679        self.device.SET_DIS_ANA_NL_CORR(value)

Enable for best AC performance for input frequencies greater than 500 MHz

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: Performance optimized for input frequencies greater than 500 MHz
Raises:
  • None
Returns:

None

def sysref_detect(self) -> int:
681    def sysref_detect(self) -> int:
682        """Indicates if a SYSREF signal is detected. Upon detection this bit stays high until it gets reset (0x102, D6) or a device reset is issued.
683
684        Arguments:
685            None
686
687        Raises:
688            None
689
690        Returns:
691            Status of the Sysref signal
692            
693            - 0: No Sysref signal detected
694            - 1: Sysref signal detected
695        """
696        return self.device.GET_SYSREF_DET()

Indicates if a SYSREF signal is detected. Upon detection this bit stays high until it gets reset (0x102, D6) or a device reset is issued.

Arguments:
  • None
Raises:
  • None
Returns:

Status of the Sysref signal

  • 0: No Sysref signal detected
  • 1: Sysref signal detected
def sysref_or(self) -> int:
698    def sysref_or(self) -> int:
699        """Output of the five SYSREF XOR flags logically OR'ed together
700
701        Arguments:
702            None
703
704        Raises:
705            None
706
707        Returns:
708            Status of the SYSREF flags OR'ed together
709            
710            - 0: No sysref flags raised
711            - 1: One of the five XOR flags is raised
712        """
713        return self.device.GET_SYSREF_OR()

Output of the five SYSREF XOR flags logically OR'ed together

Arguments:
  • None
Raises:
  • None
Returns:

Status of the SYSREF flags OR'ed together

  • 0: No sysref flags raised
  • 1: One of the five XOR flags is raised
def sysref_xor(self) -> int:
715    def sysref_xor(self) -> int:
716        """XOR flags from the SYSREF window monitoring circuitry. 
717        
718        The sampling clock falling edge is used to capture the SYSREF signal.
719        If a SYSREF signal transition happens within -60/+140 ps of the SYSREF capture, the appropriate XOR flag gets raised.
720        These bits are updated on every SYSREF rising edge.
721
722        Arguments:
723            None
724
725        Raises:
726            None
727
728        Returns:
729            List of 5 flags as follows
730
731            - X0: SYSREF leading sample clock by 20 to 60ps
732            - X1: SYSREF leading sample clock by 20ps to 0ps or SYSREF lagging sample clock by 0 to 20ps
733            - X2: SYSREF lagging sample clock by up to 20 to 60ps
734            - X3: SYSREF lagging sample clock by 60 to 100ps
735            - X4: SYSREF lagging sample clock by 100 to 140ps
736
737            With the corresponding values:
738            - 0: Flag not raised
739            - 1: Flag raised
740        """
741        return self.device.GET_SYSREF_XOR()

XOR flags from the SYSREF window monitoring circuitry.

The sampling clock falling edge is used to capture the SYSREF signal. If a SYSREF signal transition happens within -60/+140 ps of the SYSREF capture, the appropriate XOR flag gets raised. These bits are updated on every SYSREF rising edge.

Arguments:
  • None
Raises:
  • None
Returns:

List of 5 flags as follows

  • X0: SYSREF leading sample clock by 20 to 60ps
  • X1: SYSREF leading sample clock by 20ps to 0ps or SYSREF lagging sample clock by 0 to 20ps
  • X2: SYSREF lagging sample clock by up to 20 to 60ps
  • X3: SYSREF lagging sample clock by 60 to 100ps
  • X4: SYSREF lagging sample clock by 100 to 140ps

With the corresponding values:

  • 0: Flag not raised
  • 1: Flag raised
def gpio_config(self, value: int) -> None:
743    def gpio_config(self, value: int) -> None:
744        """Configures the functionaliy of the two GPIO pins
745
746        Arguments:
747            value: input value
748            
749        | Value  | GPIO 1              | GPIO 0              |
750        |:------:|:-------------------:|:-------------------:|
751        | 0      | NOT USED            | SYSREF              |
752        | 3      | GLOBAL POWER DOWN   | SYSREF              |
753        | 4      | EXTERNAL REFERENCE  | SYSREF              |
754        | 5      | NCO SWITCH 1        | NCO SWITCH 0        |
755        | 8      | NOT USED            | SYSREF              |
756        | 9      | OVR CHB/CHA         | SYSREF              |
757        | 10     | NOT USED            | GLOBAL POWER DOWN   |
758        | 11     | OVR CHB/CHA         | GLOBAL POWER DOWN   |
759        | 12     | OVR CHB             | OVR CHA             |
760
761        Raises:
762            None
763
764        Returns:
765            None
766        """
767        self.device.SET_GPIO_CONFIG(value)

Configures the functionaliy of the two GPIO pins

Arguments:
  • value: input value
Value GPIO 1 GPIO 0
0 NOT USED SYSREF
3 GLOBAL POWER DOWN SYSREF
4 EXTERNAL REFERENCE SYSREF
5 NCO SWITCH 1 NCO SWITCH 0
8 NOT USED SYSREF
9 OVR CHB/CHA SYSREF
10 NOT USED GLOBAL POWER DOWN
11 OVR CHB/CHA GLOBAL POWER DOWN
12 OVR CHB OVR CHA
Raises:
  • None
Returns:

None

def pattern_clk(self, value: int) -> None:
769    def pattern_clk(self, value: int) -> None:
770        """Controls the clock of the pattern signal generator.
771
772        Arguments:
773            value: input value
774                - 0: Normal operation
775                - 1: Decimation CLK is used for the pattern generator
776
777        Raises:
778            None
779
780        Returns:
781            None
782        """
783        self.device.SET_PATTERN_CLK(value)

Controls the clock of the pattern signal generator.

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: Decimation CLK is used for the pattern generator
Raises:
  • None
Returns:

None

def test_pattern(self, value: int) -> None:
785    def test_pattern(self, value: int) -> None:
786        """Controls the type of test pattern.
787        
788        The generated pattern is 20 bits wide. In 16 bit resolution mode, 16 MSBs of the pattern mode are sent out.
789        In 32 bit resolution mode, 12 zeros are padded to the generated pattern and sent out.
790
791        Arguments:
792            value: input value
793                - 0: Test pattern is disabled
794                - 1: Ramp pattern with a step of 1 (at 20 bit level, which is equivalent to 1/16 at 16 bit level)
795                - 2: Ramp pattern with a step value set by CUSTOM PATTERN.
796                - 3: Not used
797                - 4: Static pattern set by CUSTOM PATTERN
798                - 5: Pattern toggles between CUSTOM PATTERN and invert of CUSTOM PATTERN
799                - 6: Pattern toggles between CUSTOM PATTERN and 0
800
801        Raises:
802            None
803
804        Returns:
805            None
806        """
807        self.device.SET_TEST_PATTERN_MODE(value)

Controls the type of test pattern.

The generated pattern is 20 bits wide. In 16 bit resolution mode, 16 MSBs of the pattern mode are sent out. In 32 bit resolution mode, 12 zeros are padded to the generated pattern and sent out.

Arguments:
  • value: input value
    • 0: Test pattern is disabled
    • 1: Ramp pattern with a step of 1 (at 20 bit level, which is equivalent to 1/16 at 16 bit level)
    • 2: Ramp pattern with a step value set by CUSTOM PATTERN.
    • 3: Not used
    • 4: Static pattern set by CUSTOM PATTERN
    • 5: Pattern toggles between CUSTOM PATTERN and invert of CUSTOM PATTERN
    • 6: Pattern toggles between CUSTOM PATTERN and 0
Raises:
  • None
Returns:

None

def custom_pattern(self, value: int) -> None:
809    def custom_pattern(self, value: int) -> None:
810        """Controls the pattern generator. This controls different functions depending on the TEST PATTERN setting
811
812        Arguments:
813            value:
814                20-bit custom pattern data
815
816        Raises:
817            None
818
819        Returns:
820            None
821        """
822        # if value != 0:
823        #     if not ((int(log(value, 2)) + 1) <= 20):
824        #         raise Exception("Custom pattern value must be 20 bits long or less")
825        self.device.SET_CUSTOM_PATTERN(value)

Controls the pattern generator. This controls different functions depending on the TEST PATTERN setting

Arguments:
  • value: 20-bit custom pattern data
Raises:
  • None
Returns:

None

def digital_gain_cha(self, value: int) -> None:
827    def digital_gain_cha(self, value: int) -> None:
828        """Controls digital gain for channel A. Maximum gain is 6dB.
829
830        Arguments:
831            value:
832                Desired value to write into the register, where:
833                Gain = (20 x log(1+(Value / 128)))
834
835        Raises:
836            None
837
838        Returns:
839            None
840        """
841        self.device.SET_CH0_PROG_GAIN(value)

Controls digital gain for channel A. Maximum gain is 6dB.

Arguments:
  • value: Desired value to write into the register, where: Gain = (20 x log(1+(Value / 128)))
Raises:
  • None
Returns:

None

def digital_gain_chb(self, value: int) -> None:
843    def digital_gain_chb(self, value: int) -> None:
844        """Controls digital gain for channel B. Maximum gain is 6dB.
845
846        Arguments:
847            value:
848                Desired value to write into the register, where:
849                Gain = (20 x log(1+(Value / 128)))
850
851        Raises:
852            None
853
854        Returns:
855            None
856        """
857        self.device.SET_CH1_PROG_GAIN(value)

Controls digital gain for channel B. Maximum gain is 6dB.

Arguments:
  • value: Desired value to write into the register, where: Gain = (20 x log(1+(Value / 128)))
Raises:
  • None
Returns:

None

def sysref_mode(self, value: int) -> None:
859    def sysref_mode(self, value: int) -> None:
860        """Controls the global SYSREF mask
861
862        Arguments:
863            value: input value
864                - 0: Pass all SYSREF pulses
865                - 1: Pass the first SYSREF pulse and gates subsequent pulses
866                - 2: Gate all SYSREF pulses
867                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
868
869        Raises:
870            None
871
872        Returns:
873            None
874        """
875        self.device.SET_SYSREF_MODE(value)

Controls the global SYSREF mask

Arguments:
  • value: input value
    • 0: Pass all SYSREF pulses
    • 1: Pass the first SYSREF pulse and gates subsequent pulses
    • 2: Gate all SYSREF pulses
    • 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
Raises:
  • None
Returns:

None

def lvds_sysref_mask(self, value: int) -> None:
877    def lvds_sysref_mask(self, value: int) -> None:
878        """Controls the SYSREF pulse going to the LVDS block.
879
880        Arguments:
881            value: input value
882                - 0: Pass all SYSREF pulses
883                - 1: Pass the first SYSREF pulse and gates subsequent pulses
884                - 2: Gate all SYSREF pulses
885                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
886
887        Raises:
888            None
889
890        Returns:
891            None
892        """
893        self.device.SET_LVDS_SYSREF_MASK(value)

Controls the SYSREF pulse going to the LVDS block.

Arguments:
  • value: input value
    • 0: Pass all SYSREF pulses
    • 1: Pass the first SYSREF pulse and gates subsequent pulses
    • 2: Gate all SYSREF pulses
    • 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
Raises:
  • None
Returns:

None

def ddc_sysref_mask(self, value: int) -> None:
895    def ddc_sysref_mask(self, value: int) -> None:
896        """Controls the SYSREF pulse of DDC block.
897
898        Arguments:
899            value: input value
900                - 0: Pass all SYSREF pulses
901                - 1: Pass the first SYSREF pulse and gates subsequent pulses
902                - 2: Gate all SYSREF pulses
903                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
904
905        Raises:
906            None
907
908        Returns:
909            None
910        """
911        self.device.SET_DECIMATION_SYSREF_MASK(value)

Controls the SYSREF pulse of DDC block.

Arguments:
  • value: input value
    • 0: Pass all SYSREF pulses
    • 1: Pass the first SYSREF pulse and gates subsequent pulses
    • 2: Gate all SYSREF pulses
    • 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
Raises:
  • None
Returns:

None

def nco_sysref_mask(self, value: int) -> None:
913    def nco_sysref_mask(self, value: int) -> None:
914        """Controls the SYSREF pulse of NCO block.
915
916        Arguments:
917            value: input value
918                - 0: Pass all SYSREF pulses
919                - 1: Pass the first SYSREF pulse and gates subsequent pulses
920                - 2: Gate all SYSREF pulses
921                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
922
923        Raises:
924            None
925
926        Returns:
927            None
928        """
929        self.device.SET_NCO_SYSREF_MASK(value)

Controls the SYSREF pulse of NCO block.

Arguments:
  • value: input value
    • 0: Pass all SYSREF pulses
    • 1: Pass the first SYSREF pulse and gates subsequent pulses
    • 2: Gate all SYSREF pulses
    • 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
Raises:
  • None
Returns:

None

def timer_sysref_mask(self, value: int) -> None:
931    def timer_sysref_mask(self, value: int) -> None:
932        """Controls the SYSREF pulse of TIMER block.
933
934        Arguments:
935            value: input value
936                - 0: Pass all SYSREF pulses
937                - 1: Pass the first SYSREF pulse and gates subsequent pulses
938                - 2: Gate all SYSREF pulses
939                - 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
940
941        Raises:
942            None
943
944        Returns:
945            None
946        """
947        self.device.SET_TIMER_SYSREF_MASK(value)

Controls the SYSREF pulse of TIMER block.

Arguments:
  • value: input value
    • 0: Pass all SYSREF pulses
    • 1: Pass the first SYSREF pulse and gates subsequent pulses
    • 2: Gate all SYSREF pulses
    • 3: Issue new SYSREF pulse. The pulse is issued when the state transitions to 11
Raises:
  • None
Returns:

None

def sysref_time_stamp(self, value: int) -> None:
949    def sysref_time_stamp(self, value: int) -> None:
950        """Allows the SYSREF to be passed on the FRAME_INDICATOR lane. OVR_ON_LSB setting takes precedence
951
952        Arguments:
953            value: input value
954                - 0: Normal operation
955                - 3: Pass sysref time stamp on the frame indicator lane
956
957        Raises:
958            None
959
960        Returns:
961            None
962        """
963        self.device.SET_SYSREF_TIME_STAMP(value)

Allows the SYSREF to be passed on the FRAME_INDICATOR lane. OVR_ON_LSB setting takes precedence

Arguments:
  • value: input value
    • 0: Normal operation
    • 3: Pass sysref time stamp on the frame indicator lane
Raises:
  • None
Returns:

None

def gain_override(self, value: int) -> None:
965    def gain_override(self, value: int) -> None:
966        """Controls 6dB gain setting of the DDC. The 6dB gain is applied in COMPLEX DDC mode by default. This will force 6 dB gain on the DDC output, irrespective of the DDC mode
967
968        Arguments:
969            value: input value
970                - 0: Normal operation
971                - 2: Unity gain
972                - 3: 6dB gain override
973
974        Raises:
975            None
976
977        Returns:
978            None
979        """
980        self.device.SET_SIX_DB_GAIN_OVERRIDE(value)

Controls 6dB gain setting of the DDC. The 6dB gain is applied in COMPLEX DDC mode by default. This will force 6 dB gain on the DDC output, irrespective of the DDC mode

Arguments:
  • value: input value
    • 0: Normal operation
    • 2: Unity gain
    • 3: 6dB gain override
Raises:
  • None
Returns:

None

def complex_decimation(self, value: int) -> None:
982    def complex_decimation(self, value: int) -> None:
983        """Enables/disables complex decimation for all DDCs.
984
985        Arguments:
986            value: input value
987                - 0: Real Deciamtion
988                - 1: Complex Decimation
989
990        Raises:
991            None
992
993        Returns:
994            None
995        """
996        self.device.SET_EN_COMPLEX_DDC(value)

Enables/disables complex decimation for all DDCs.

Arguments:
  • value: input value
    • 0: Real Deciamtion
    • 1: Complex Decimation
Raises:
  • None
Returns:

None

def output_resolution(self, value: int) -> None:
 998    def output_resolution(self, value: int) -> None:
 999        """Configures the output resolution for 16-bit or 32-bit
1000
1001        Arguments:
1002            value: input value
1003                - 0: 16-bit output resolution
1004                - 1: 32-bit output resolution
1005
1006        Raises:
1007            None
1008
1009        Returns:
1010            None
1011        """
1012        self.device.SET_OUTPUT_RESOLUTION(value)

Configures the output resolution for 16-bit or 32-bit

Arguments:
  • value: input value
    • 0: 16-bit output resolution
    • 1: 32-bit output resolution
Raises:
  • None
Returns:

None

def output_format(self, value: int) -> None:
1014    def output_format(self, value: int) -> None:
1015        """Configures the output data format
1016
1017        Arguments:
1018            value: input value
1019                - 0: Output format is 2s complement
1020                - 1: Output format is offset binary
1021
1022        Raises:
1023            None
1024
1025        Returns:
1026            None
1027        """
1028        self.device.SET_OUTPUT_FORMAT(value)

Configures the output data format

Arguments:
  • value: input value
    • 0: Output format is 2s complement
    • 1: Output format is offset binary
Raises:
  • None
Returns:

None

def ddc0_mux(self, input: int) -> None:
1030    def ddc0_mux(self, input: int) -> None:
1031        """Sets the input data source to decimation filter 0.
1032
1033        Arguments:
1034            ddc:
1035                The DDC for which the input data source is being configured
1036            input:
1037                Input to the DDC
1038                - 0: Channel A
1039                - 1: Channel B
1040                - 2: 2x Average ((ChA + ChB)/2)
1041                - 3: 2x Average ((ChA - ChB)/2)
1042
1043        Raises:
1044            None
1045
1046        Returns:
1047            None
1048        """
1049        self.device.SET_DDC0_MUX(input)

Sets the input data source to decimation filter 0.

Arguments:
  • ddc: The DDC for which the input data source is being configured
  • input: Input to the DDC
    • 0: Channel A
    • 1: Channel B
    • 2: 2x Average ((ChA + ChB)/2)
    • 3: 2x Average ((ChA - ChB)/2)
Raises:
  • None
Returns:

None

def ddc1_mux(self, input: int) -> None:
1051    def ddc1_mux(self, input: int) -> None:
1052        """Sets the input data source to decimation filter 1.
1053
1054        Arguments:
1055            ddc:
1056                The DDC for which the input data source is being configured
1057            input:
1058                Input to the DDC
1059                - 0: Channel B
1060                - 1: Channel A
1061                - 2: 2x Average ((ChA + ChB)/2)
1062                - 3: 2x Average ((ChA - ChB)/2)
1063
1064        Raises:
1065            None
1066
1067        Returns:
1068            None
1069        """
1070        self.device.SET_DDC1_MUX(input)

Sets the input data source to decimation filter 1.

Arguments:
  • ddc: The DDC for which the input data source is being configured
  • input: Input to the DDC
    • 0: Channel B
    • 1: Channel A
    • 2: 2x Average ((ChA + ChB)/2)
    • 3: 2x Average ((ChA - ChB)/2)
Raises:
  • None
Returns:

None

def ddc2_mux(self, input: int) -> None:
1072    def ddc2_mux(self, input: int) -> None:
1073        """Sets the input data source to decimation filter 2.
1074
1075        Arguments:
1076            ddc:
1077                The DDC for which the input data source is being configured
1078            input:
1079                Input to the DDC
1080                - 0: Channel A
1081                - 1: Channel B
1082                - 2: 2x Average ((ChA + ChB)/2)
1083                - 3: 2x Average ((ChA - ChB)/2)
1084
1085        Raises:
1086            None
1087
1088        Returns:
1089            None
1090        """
1091        self.device.SET_DDC2_MUX(input)

Sets the input data source to decimation filter 2.

Arguments:
  • ddc: The DDC for which the input data source is being configured
  • input: Input to the DDC
    • 0: Channel A
    • 1: Channel B
    • 2: 2x Average ((ChA + ChB)/2)
    • 3: 2x Average ((ChA - ChB)/2)
Raises:
  • None
Returns:

None

def ddc3_mux(self, input: int) -> None:
1093    def ddc3_mux(self, input: int) -> None:
1094        """Sets the input data source to decimation filter 3.
1095
1096        Arguments:
1097            ddc:
1098                The DDC for which the input data source is being configured
1099            input:
1100                Input to the DDC
1101                - 0: Channel B
1102                - 1: Channel A
1103                - 2: 2x Average ((ChA + ChB)/2)
1104                - 3: 2x Average ((ChA - ChB)/2)
1105
1106        Raises:
1107            None
1108
1109        Returns:
1110            None
1111        """
1112        self.device.SET_DDC3_MUX(input)

Sets the input data source to decimation filter 3.

Arguments:
  • ddc: The DDC for which the input data source is being configured
  • input: Input to the DDC
    • 0: Channel B
    • 1: Channel A
    • 2: 2x Average ((ChA + ChB)/2)
    • 3: 2x Average ((ChA - ChB)/2)
Raises:
  • None
Returns:

None

def nco0_update(self, value: int) -> None:
1114    def nco0_update(self, value: int) -> None:
1115        """Updates the four NCO frequencies of NCO0.
1116
1117        Arguments:
1118            value: input value
1119                - 0: Normal operation
1120                - 1: Update NCO0 frequencies
1121
1122        Raises:
1123            None
1124
1125        Returns:
1126            None
1127        """
1128        self.device.SET_NCO0_UPDATE(value)

Updates the four NCO frequencies of NCO0.

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: Update NCO0 frequencies
Raises:
  • None
Returns:

None

def nco1_update(self, value: int) -> None:
1130    def nco1_update(self, value: int) -> None:
1131        """Updates the four NCO frequencies of NCO1.
1132
1133        Arguments:
1134            value: input value
1135                - 0: Normal operation
1136                - 1: Update NCO1 frequencies
1137
1138        Raises:
1139            None
1140
1141        Returns:
1142            None
1143        """
1144        self.device.SET_NCO1_UPDATE(value)

Updates the four NCO frequencies of NCO1.

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: Update NCO1 frequencies
Raises:
  • None
Returns:

None

def nco2_update(self, value: int) -> None:
1146    def nco2_update(self, value: int) -> None:
1147        """Updates the four NCO frequencies of NCO2.
1148
1149        Arguments:
1150            value: input value
1151                - 0: Normal operation
1152                - 1: Update NCO2 frequencies
1153
1154        Raises:
1155            None
1156
1157        Returns:
1158            None
1159        """
1160        self.device.SET_NCO2_UPDATE(value)

Updates the four NCO frequencies of NCO2.

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: Update NCO2 frequencies
Raises:
  • None
Returns:

None

def nco3_update(self, value: int) -> None:
1162    def nco3_update(self, value: int) -> None:
1163        """Updates the four NCO frequencies of NCO3.
1164
1165        Arguments:
1166            value: input value
1167                - 0: Normal operation
1168                - 1: Update NCO3 frequencies
1169
1170        Raises:
1171            None
1172
1173        Returns:
1174            None
1175        """
1176        self.device.SET_NCO3_UPDATE(value)

Updates the four NCO frequencies of NCO3.

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: Update NCO3 frequencies
Raises:
  • None
Returns:

None

def select_negative_image(self, value: int) -> None:
1178    def select_negative_image(self, value: int) -> None:
1179        """Controls the selection of the negative frequency image. Applicable only in Complex DDC mode.
1180
1181        Arguments:
1182            value: input value
1183                - 0: Normal operation
1184                - 1: Negative image
1185
1186        Raises:
1187            None
1188
1189        Returns:
1190            None
1191        """
1192        self.device.SET_NCO_SEL_NEG_IMAGE(value)

Controls the selection of the negative frequency image. Applicable only in Complex DDC mode.

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: Negative image
Raises:
  • None
Returns:

None

def nco_mode(self, value: int) -> None:
1194    def nco_mode(self, value: int) -> None:
1195        """Configures the NCOs operating mode.
1196
1197        Arguments:
1198            value: input value
1199                - 0: Phase continuous
1200                - 1: Infinite phase coherent
1201
1202        Raises:
1203            None
1204
1205        Returns:
1206            None
1207        """
1208        self.device.SET_NCO_MODE(value)

Configures the NCOs operating mode.

Arguments:
  • value: input value
    • 0: Phase continuous
    • 1: Infinite phase coherent
Raises:
  • None
Returns:

None

def low_latency_enable(self, value: int) -> None:
1210    def low_latency_enable(self, value: int) -> None:
1211        """Enables low latency mode by byapssing all digital features
1212
1213        Arguments:
1214            value: input value
1215                - 0: Normal Operation
1216                - 1: Low Latency Mode
1217
1218        Raises:
1219            None
1220
1221        Returns:
1222            None
1223        """
1224        self.device.SET_ENABLE_LOW_LATENCY(value)

Enables low latency mode by byapssing all digital features

Arguments:
  • value: input value
    • 0: Normal Operation
    • 1: Low Latency Mode
Raises:
  • None
Returns:

None

def disable_nco_auto_update(self, value: int) -> None:
1226    def disable_nco_auto_update(self, value: int) -> None:
1227        """Disables the automatic update when switching the NCOs using GPIO pins
1228
1229        Arguments:
1230            value: input value
1231                - 0: Automatic update enabled
1232                - 1: Automatic update disabled
1233
1234        Raises:
1235            None
1236
1237        Returns:
1238            None
1239        """
1240        self.device.SET_DISABLE_NCO_AUTO_UPDATE(value)

Disables the automatic update when switching the NCOs using GPIO pins

Arguments:
  • value: input value
    • 0: Automatic update enabled
    • 1: Automatic update disabled
Raises:
  • None
Returns:

None

def nco_select_enable(self, value: int) -> None:
1242    def nco_select_enable(self, value: int) -> None:
1243        """This bit enables NCO frequency selection via SPI register 0x166 instead of GPIO pins.
1244
1245        Arguments:
1246            value: input value
1247                - 0: NCO Select via GPIO Pins
1248                - 1: NCO Select via SPI Write
1249
1250        Raises:
1251            None
1252
1253        Returns:
1254            None
1255        """
1256        self.device.SET_ENABLE_NCO_SEL(value)

This bit enables NCO frequency selection via SPI register 0x166 instead of GPIO pins.

Arguments:
  • value: input value
    • 0: NCO Select via GPIO Pins
    • 1: NCO Select via SPI Write
Raises:
  • None
Returns:

None

def nco_common_update(self, value: int) -> None:
1258    def nco_common_update(self, value: int) -> None:
1259        """Updates the four NCO frequencies of all NCOs.
1260
1261        Arguments:
1262            value: input value
1263                - 0: Normal operation
1264                - 1: Update NCO frequencies
1265
1266        Raises:
1267            None
1268
1269        Returns:
1270            None
1271        """
1272        self.device.SET_NCO_COMMON_UPDATE(value)

Updates the four NCO frequencies of all NCOs.

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: Update NCO frequencies
Raises:
  • None
Returns:

None

def ddc0_nco_select(self, nco: int) -> None:
1274    def ddc0_nco_select(self, nco: int) -> None:
1275        """Selects which of the 4 frequencies is active for DDC0.
1276
1277        Arguments:
1278            nco:
1279                NCO word to set as the active frequency
1280
1281        Raises:
1282            None
1283
1284        Returns:
1285            None
1286        """
1287        self.device.SET_DDC0_NCO_SEL(nco)

Selects which of the 4 frequencies is active for DDC0.

Arguments:
  • nco: NCO word to set as the active frequency
Raises:
  • None
Returns:

None

def ddc1_nco_select(self, nco: int) -> None:
1289    def ddc1_nco_select(self, nco: int) -> None:
1290        """Selects which of the 4 frequencies is active for DDC1.
1291
1292        Arguments:
1293            nco:
1294                NCO word to set as the active frequency
1295
1296        Raises:
1297            None
1298
1299        Returns:
1300            None
1301        """
1302        self.device.SET_DDC1_NCO_SEL(nco)

Selects which of the 4 frequencies is active for DDC1.

Arguments:
  • nco: NCO word to set as the active frequency
Raises:
  • None
Returns:

None

def ddc2_nco_select(self, nco: int) -> None:
1304    def ddc2_nco_select(self, nco: int) -> None:
1305        """Selects which of the 4 frequencies is active for DDC2.
1306
1307        Arguments:
1308            nco:
1309                NCO word to set as the active frequency
1310
1311        Raises:
1312            None
1313
1314        Returns:
1315            None
1316        """
1317        self.device.SET_DDC2_NCO_SEL(nco)

Selects which of the 4 frequencies is active for DDC2.

Arguments:
  • nco: NCO word to set as the active frequency
Raises:
  • None
Returns:

None

def ddc3_nco_select(self, nco: int) -> None:
1319    def ddc3_nco_select(self, nco: int) -> None:
1320        """Selects which of the 4 frequencies is active for DDC3.
1321
1322        Arguments:
1323            nco:
1324                NCO word to set as the active frequency
1325
1326        Raises:
1327            None
1328
1329        Returns:
1330            None
1331        """
1332        self.device.SET_DDC3_NCO_SEL(nco)

Selects which of the 4 frequencies is active for DDC3.

Arguments:
  • nco: NCO word to set as the active frequency
Raises:
  • None
Returns:

None

def ddc0_decimation(self, value: int) -> None:
1334    def ddc0_decimation(self, value: int) -> None:
1335        """Sets the decimation filter factors for DDC0 when using unequal decimation factors.
1336
1337        Arguments:
1338            value:
1339                value to write to the register such that Decimation Factor = 2^value.
1340
1341        Raises:
1342            None
1343
1344        Returns:
1345            None
1346        """
1347        self.device.SET_DDC0_DECIMATION_MODE(value)

Sets the decimation filter factors for DDC0 when using unequal decimation factors.

Arguments:
  • value: value to write to the register such that Decimation Factor = 2^value.
Raises:
  • None
Returns:

None

def ddc1_decimation(self, value: int) -> None:
1349    def ddc1_decimation(self, value: int) -> None:
1350        """Sets the decimation filter factors for DDC1 when using unequal decimation factors.
1351
1352        Arguments:
1353            value:
1354                value to write to the register such that Decimation Factor = 2^value.
1355
1356        Raises:
1357            None
1358
1359        Returns:
1360            None
1361        """
1362        self.device.SET_DDC1_DECIMATION_MODE(value)

Sets the decimation filter factors for DDC1 when using unequal decimation factors.

Arguments:
  • value: value to write to the register such that Decimation Factor = 2^value.
Raises:
  • None
Returns:

None

def ddc2_decimation(self, value: int) -> None:
1364    def ddc2_decimation(self, value: int) -> None:
1365        """Sets the decimation filter factors for DDC2 when using unequal decimation factors.
1366
1367        Arguments:
1368            value:
1369                value to write to the register such that Decimation Factor = 2^value.
1370
1371        Raises:
1372            None
1373
1374        Returns:
1375            None
1376        """
1377        self.device.SET_DDC2_DECIMATION_MODE(value)

Sets the decimation filter factors for DDC2 when using unequal decimation factors.

Arguments:
  • value: value to write to the register such that Decimation Factor = 2^value.
Raises:
  • None
Returns:

None

def ddc3_decimation(self, value: int) -> None:
1379    def ddc3_decimation(self, value: int) -> None:
1380        """Sets the decimation filter factors for DDC3 when using unequal decimation factors.
1381
1382        Arguments:
1383            value:
1384                value to write to the register such that Decimation Factor = 2^value.
1385
1386        Raises:
1387            None
1388
1389        Returns:
1390            None
1391        """
1392        self.device.SET_DDC3_DECIMATION_MODE(value)

Sets the decimation filter factors for DDC3 when using unequal decimation factors.

Arguments:
  • value: value to write to the register such that Decimation Factor = 2^value.
Raises:
  • None
Returns:

None

def unequal_decimation(self, value: int) -> None:
1394    def unequal_decimation(self, value: int) -> None:
1395        """Enables configuration of DDC0 thru DDC3 to have unequal decimation factors.
1396
1397        Arguments:
1398            value: input value
1399                - 0: Normal operation
1400                - 1: Unequal decimation factors enabled
1401
1402        Raises:
1403            None:
1404
1405        Returns:
1406            None
1407        """
1408        self.device.SET_SELECT_INDEPENDENT_DECIMATION(value)

Enables configuration of DDC0 thru DDC3 to have unequal decimation factors.

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: Unequal decimation factors enabled
Raises:
  • None:
Returns:

None

def number_of_ddcs(self, value: int) -> None:
1410    def number_of_ddcs(self, value: int) -> None:
1411        """This register configures the # of active DDCs.
1412
1413        Arguments:
1414            value: input value
1415                - 0: Single DDC per channel (Total two DDCs are enabled)
1416                - 1: Dual DDCs per channel (Total 4 DDCs are enabled)
1417                - 2: Just one DDC is enabled (1 DDC is active)
1418                - 3: Dual DDC for a single channel (Total two DDCs are enabled)
1419
1420        Raises:
1421            None
1422
1423        Returns:
1424            None
1425        """
1426        lsb = value & 1
1427        msb = value >> 1
1428        self.device.SET_EN_DUAL_BAND(lsb)
1429        self.device.SET_DIS_DUAL_CHANNEL(msb)

This register configures the # of active DDCs.

Arguments:
  • value: input value
    • 0: Single DDC per channel (Total two DDCs are enabled)
    • 1: Dual DDCs per channel (Total 4 DDCs are enabled)
    • 2: Just one DDC is enabled (1 DDC is active)
    • 3: Dual DDC for a single channel (Total two DDCs are enabled)
Raises:
  • None
Returns:

None

def common_decimation(self, value: int) -> None:
1431    def common_decimation(self, value: int) -> None:
1432        """Sets the decimation filter factor for all active DDCs.
1433
1434        Arguments:
1435            value:
1436                value to write to the register such that Decimation Factor = 2^value.
1437
1438        Raises:
1439            None
1440
1441        Returns:
1442            None
1443        """
1444        self.device.SET_COMMON_DECIMATION_MODE(value)

Sets the decimation filter factor for all active DDCs.

Arguments:
  • value: value to write to the register such that Decimation Factor = 2^value.
Raises:
  • None
Returns:

None

def update_nyqusit_zone(self, value: int) -> None:
1446    def update_nyqusit_zone(self, value: int) -> None:
1447        """Must be pulsed after the Nyquist zone if programmed.
1448        
1449        A 0 to 1 transition on this bit copies the NYQUIST ZONE field to an internal register.
1450
1451        Argument:
1452            value: input value
1453                - 0: Normal Operation
1454                - 1: Nyquist zone value is updated
1455
1456        Raises:
1457            None
1458
1459        Returns:
1460            None
1461        """
1462        self.device.SET_UPDATE_NYQUIST(value)

Must be pulsed after the Nyquist zone if programmed.

A 0 to 1 transition on this bit copies the NYQUIST ZONE field to an internal register.

Argument:

value: input value - 0: Normal Operation - 1: Nyquist zone value is updated

Raises:
  • None
Returns:

None

def nyquist_zone(self, value: int) -> None:
1464    def nyquist_zone(self, value: int) -> None:
1465        """Sets the nyquist zone of operation.
1466        
1467        The internal calibration of the device depends on the NYQUIST ZONE of the signal being sampled.
1468        This field must be programmed based on the operating Nyquist zone.
1469
1470        Arguments:
1471            value:
1472                Operating nyquist zone (0 - 7)
1473
1474        Raises:
1475            None
1476
1477        Returns:
1478            None
1479        """
1480        self.device.SET_NYQUIST_ZONE(value)

Sets the nyquist zone of operation.

The internal calibration of the device depends on the NYQUIST ZONE of the signal being sampled. This field must be programmed based on the operating Nyquist zone.

Arguments:
  • value: Operating nyquist zone (0 - 7)
Raises:
  • None
Returns:

None

def ddc0_nco_frequency0(self, value: int) -> None:
1482    def ddc0_nco_frequency0(self, value: int) -> None:
1483        """Configures the 48-bit NCO frequency word 0 of DDC0.
1484
1485        Arguments:
1486            value:
1487                Value to write to the NCO frequency word, such that:\n
1488                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1489                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1490
1491        Raises:
1492            None
1493
1494        Returns:
1495            None
1496        """
1497        self.device.SET_DDC0_NCO_FREQ0(value)

Configures the 48-bit NCO frequency word 0 of DDC0.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc0_nco_frequency1(self, value: int) -> None:
1499    def ddc0_nco_frequency1(self, value: int) -> None:
1500        """Configures the 48-bit NCO frequency word 1 of DDC0.
1501
1502        Arguments:
1503            value:
1504                Value to write to the NCO frequency word, such that:\n
1505                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1506                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1507
1508        Raises:
1509            None
1510
1511        Returns:
1512            None
1513        """
1514        self.device.SET_DDC0_NCO_FREQ1(value)

Configures the 48-bit NCO frequency word 1 of DDC0.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc0_nco_frequency2(self, value: int) -> None:
1516    def ddc0_nco_frequency2(self, value: int) -> None:
1517        """Configures the 48-bit NCO frequency word 2 of DDC0.
1518
1519        Arguments:
1520            value:
1521                Value to write to the NCO frequency word, such that:\n
1522                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1523                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1524
1525        Raises:
1526            None
1527
1528        Returns:
1529            None
1530        """
1531        self.device.SET_DDC0_NCO_FREQ2(value)

Configures the 48-bit NCO frequency word 2 of DDC0.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc0_nco_frequency3(self, value: int) -> None:
1533    def ddc0_nco_frequency3(self, value: int) -> None:
1534        """Configures the 48-bit NCO frequency word 3 of DDC0.
1535
1536        Arguments:
1537            value:
1538                Value to write to the NCO frequency word, such that:\n
1539                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1540                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1541
1542        Raises:
1543            None
1544
1545        Returns:
1546            None
1547        """
1548        self.device.SET_DDC0_NCO_FREQ3(value)

Configures the 48-bit NCO frequency word 3 of DDC0.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc1_nco_frequency0(self, value: int) -> None:
1550    def ddc1_nco_frequency0(self, value: int) -> None:
1551        """Configures the 48-bit NCO frequency word 0 of DDC1.
1552
1553        Arguments:
1554            value:
1555                Value to write to the NCO frequency word, such that:\n
1556                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1557                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1558
1559        Raises:
1560            None
1561
1562        Returns:
1563            None
1564        """
1565        self.device.SET_DDC1_NCO_FREQ0(value)

Configures the 48-bit NCO frequency word 0 of DDC1.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc1_nco_frequency1(self, value: int) -> None:
1567    def ddc1_nco_frequency1(self, value: int) -> None:
1568        """Configures the 48-bit NCO frequency word 1 of DDC1.
1569
1570        Arguments:
1571            value:
1572                Value to write to the NCO frequency word, such that:\n
1573                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1574                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1575
1576        Raises:
1577            None
1578
1579        Returns:
1580            None
1581        """
1582        self.device.SET_DDC1_NCO_FREQ1(value)

Configures the 48-bit NCO frequency word 1 of DDC1.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc1_nco_frequency2(self, value: int) -> None:
1584    def ddc1_nco_frequency2(self, value: int) -> None:
1585        """Configures the 48-bit NCO frequency word 2 of DDC1.
1586
1587        Arguments:
1588            value:
1589                Value to write to the NCO frequency word, such that:\n
1590                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1591                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1592
1593        Raises:
1594            None
1595
1596        Returns:
1597            None
1598        """
1599        self.device.SET_DDC1_NCO_FREQ2(value)

Configures the 48-bit NCO frequency word 2 of DDC1.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc1_nco_frequency3(self, value: int) -> None:
1601    def ddc1_nco_frequency3(self, value: int) -> None:
1602        """Configures the 48-bit NCO frequency word 3 of DDC1.
1603
1604        Arguments:
1605            value:
1606                Value to write to the NCO frequency word, such that:\n
1607                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1608                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1609
1610        Raises:
1611            None
1612
1613        Returns:
1614            None
1615        """
1616        self.device.SET_DDC1_NCO_FREQ3(value)

Configures the 48-bit NCO frequency word 3 of DDC1.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc2_nco_frequency0(self, value: int) -> None:
1618    def ddc2_nco_frequency0(self, value: int) -> None:
1619        """Configures the 48-bit NCO frequency word 0 of DDC2.
1620
1621        Arguments:
1622            value:
1623                Value to write to the NCO frequency word, such that:\n
1624                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1625                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1626
1627        Raises:
1628            None
1629
1630        Returns:
1631            None
1632        """
1633        self.device.SET_DDC2_NCO_FREQ0(value)

Configures the 48-bit NCO frequency word 0 of DDC2.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc2_nco_frequency1(self, value: int) -> None:
1635    def ddc2_nco_frequency1(self, value: int) -> None:
1636        """Configures the 48-bit NCO frequency word 1 of DDC2.
1637
1638        Arguments:
1639            value:
1640                Value to write to the NCO frequency word, such that:\n
1641                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1642                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1643
1644        Raises:
1645            None
1646
1647        Returns:
1648            None
1649        """
1650        self.device.SET_DDC2_NCO_FREQ1(value)

Configures the 48-bit NCO frequency word 1 of DDC2.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc2_nco_frequency2(self, value: int) -> None:
1652    def ddc2_nco_frequency2(self, value: int) -> None:
1653        """Configures the 48-bit NCO frequency word 2 of DDC2.
1654
1655        Arguments:
1656            value:
1657                Value to write to the NCO frequency word, such that:\n
1658                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1659                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1660
1661        Raises:
1662            None
1663
1664        Returns:
1665            None
1666        """
1667        self.device.SET_DDC2_NCO_FREQ2(value)

Configures the 48-bit NCO frequency word 2 of DDC2.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc2_nco_frequency3(self, value: int) -> None:
1669    def ddc2_nco_frequency3(self, value: int) -> None:
1670        """Configures the 48-bit NCO frequency word 3 of DDC2.
1671
1672        Arguments:
1673            value:
1674                Value to write to the NCO frequency word, such that:\n
1675                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1676                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1677
1678        Raises:
1679            None
1680
1681        Returns:
1682            None
1683        """
1684        self.device.SET_DDC2_NCO_FREQ3(value)

Configures the 48-bit NCO frequency word 3 of DDC2.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc3_nco_frequency0(self, value: int) -> None:
1686    def ddc3_nco_frequency0(self, value: int) -> None:
1687        """Configures the 48-bit NCO frequency word 0 of DDC3.
1688
1689        Arguments:
1690            value:
1691                Value to write to the NCO frequency word, such that:\n
1692                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1693                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1694
1695        Raises:
1696            None
1697
1698        Returns:
1699            None
1700        """
1701        self.device.SET_DDC3_NCO_FREQ0(value)

Configures the 48-bit NCO frequency word 0 of DDC3.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc3_nco_frequency1(self, value: int) -> None:
1703    def ddc3_nco_frequency1(self, value: int) -> None:
1704        """Configures the 48-bit NCO frequency word 1 of DDC3.
1705
1706        Arguments:
1707            value:
1708                Value to write to the NCO frequency word, such that:\n
1709                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1710                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1711
1712        Raises:
1713            None
1714
1715        Returns:
1716            None
1717        """
1718        self.device.SET_DDC3_NCO_FREQ1(value)

Configures the 48-bit NCO frequency word 1 of DDC3.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc3_nco_frequency2(self, value: int) -> None:
1720    def ddc3_nco_frequency2(self, value: int) -> None:
1721        """Configures the 48-bit NCO frequency word 2 of DDC3.
1722
1723        Arguments:
1724            value:
1725                Value to write to the NCO frequency word, such that:\n
1726                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1727                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1728
1729        Raises:
1730            None
1731
1732        Returns:
1733            None
1734        """
1735        self.device.SET_DDC3_NCO_FREQ2(value)

Configures the 48-bit NCO frequency word 2 of DDC3.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc3_nco_frequency3(self, value: int) -> None:
1737    def ddc3_nco_frequency3(self, value: int) -> None:
1738        """Configures the 48-bit NCO frequency word 3 of DDC3.
1739
1740        Arguments:
1741            value:
1742                Value to write to the NCO frequency word, such that:\n
1743                When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS\n
1744                When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS
1745
1746        Raises:
1747            None
1748
1749        Returns:
1750            None
1751        """
1752        self.device.SET_DDC3_NCO_FREQ3(value)

Configures the 48-bit NCO frequency word 3 of DDC3.

Arguments:
  • value: Value to write to the NCO frequency word, such that:

    When 0 > NCO frequency ≥ FS/2: value = fNCO * 2^48 / FS

    When -FS/2 ≤ NCO frequency < 0: value = (fNCO + FS) * 2^48 / FS

Raises:
  • None
Returns:

None

def ddc0_nco_phase0(self, value: int) -> None:
1754    def ddc0_nco_phase0(self, value: int) -> None:
1755        """Configures the starting phase for NCO Frequency 0 of DDC0
1756
1757        Arguments:
1758            value:
1759                Value to write to the NCO phase word, such that:
1760                value = 90° / Phase
1761        Raises:
1762            None
1763
1764        Returns:
1765            None
1766        """
1767        self.device.SET_DDC0_NCO_PHASE0(value)

Configures the starting phase for NCO Frequency 0 of DDC0

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc0_nco_phase1(self, value: int) -> None:
1769    def ddc0_nco_phase1(self, value: int) -> None:
1770        """Configures the starting phase for NCO Frequency 1 of DDC0
1771
1772        Arguments:
1773            value:
1774                Value to write to the NCO phase word, such that:
1775                value = 90° / Phase
1776        Raises:
1777            None
1778
1779        Returns:
1780            None
1781        """
1782        self.device.SET_DDC0_NCO_PHASE1(value)

Configures the starting phase for NCO Frequency 1 of DDC0

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc0_nco_phase2(self, value: int) -> None:
1784    def ddc0_nco_phase2(self, value: int) -> None:
1785        """Configures the starting phase for NCO Frequency 2 of DDC0
1786
1787        Arguments:
1788            value:
1789                Value to write to the NCO phase word, such that:
1790                value = 90° / Phase
1791        Raises:
1792            None
1793
1794        Returns:
1795            None
1796        """
1797        self.device.SET_DDC0_NCO_PHASE2(value)

Configures the starting phase for NCO Frequency 2 of DDC0

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc0_nco_phase3(self, value: int) -> None:
1799    def ddc0_nco_phase3(self, value: int) -> None:
1800        """Configures the starting phase for NCO Frequency 3 of DDC0
1801
1802        Arguments:
1803            value:
1804                Value to write to the NCO phase word, such that:
1805                value = 90° / Phase
1806        Raises:
1807            None
1808
1809        Returns:
1810            None
1811        """
1812        self.device.SET_DDC0_NCO_PHASE3(value)

Configures the starting phase for NCO Frequency 3 of DDC0

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc1_nco_phase0(self, value: int) -> None:
1814    def ddc1_nco_phase0(self, value: int) -> None:
1815        """Configures the starting phase for NCO Frequency 0 of DDC1
1816
1817        Arguments:
1818            value:
1819                Value to write to the NCO phase word, such that:
1820                value = 90° / Phase
1821        Raises:
1822            None
1823
1824        Returns:
1825            None
1826        """
1827        self.device.SET_DDC1_NCO_PHASE0(value)

Configures the starting phase for NCO Frequency 0 of DDC1

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc1_nco_phase1(self, value: int) -> None:
1829    def ddc1_nco_phase1(self, value: int) -> None:
1830        """Configures the starting phase for NCO Frequency 1 of DDC1
1831
1832        Arguments:
1833            value:
1834                Value to write to the NCO phase word, such that:
1835                value = 90° / Phase
1836        Raises:
1837            None
1838
1839        Returns:
1840            None
1841        """
1842        self.device.SET_DDC1_NCO_PHASE1(value)

Configures the starting phase for NCO Frequency 1 of DDC1

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc1_nco_phase2(self, value: int) -> None:
1844    def ddc1_nco_phase2(self, value: int) -> None:
1845        """Configures the starting phase for NCO Frequency 2 of DDC1
1846
1847        Arguments:
1848            value:
1849                Value to write to the NCO phase word, such that:
1850                value = 90° / Phase
1851        Raises:
1852            None
1853
1854        Returns:
1855            None
1856        """
1857        self.device.SET_DDC1_NCO_PHASE2(value)

Configures the starting phase for NCO Frequency 2 of DDC1

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc1_nco_phase3(self, value: int) -> None:
1859    def ddc1_nco_phase3(self, value: int) -> None:
1860        """Configures the starting phase for NCO Frequency 3 of DDC1
1861
1862        Arguments:
1863            value:
1864                Value to write to the NCO phase word, such that:
1865                value = 90° / Phase
1866        Raises:
1867            None
1868
1869        Returns:
1870            None
1871        """
1872        self.device.SET_DDC1_NCO_PHASE3(value)

Configures the starting phase for NCO Frequency 3 of DDC1

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc2_nco_phase0(self, value: int) -> None:
1874    def ddc2_nco_phase0(self, value: int) -> None:
1875        """Configures the starting phase for NCO Frequency 0 of DDC2
1876
1877        Arguments:
1878            value:
1879                Value to write to the NCO phase word, such that:
1880                value = 90° / Phase
1881        Raises:
1882            None
1883
1884        Returns:
1885            None
1886        """
1887        self.device.SET_DDC2_NCO_PHASE0(value)

Configures the starting phase for NCO Frequency 0 of DDC2

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc2_nco_phase1(self, value: int) -> None:
1889    def ddc2_nco_phase1(self, value: int) -> None:
1890        """Configures the starting phase for NCO Frequency 1 of DDC2
1891
1892        Arguments:
1893            value:
1894                Value to write to the NCO phase word, such that:
1895                value = 90° / Phase
1896        Raises:
1897            None
1898
1899        Returns:
1900            None
1901        """
1902        self.device.SET_DDC2_NCO_PHASE1(value)

Configures the starting phase for NCO Frequency 1 of DDC2

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc2_nco_phase2(self, value: int) -> None:
1904    def ddc2_nco_phase2(self, value: int) -> None:
1905        """Configures the starting phase for NCO Frequency 2 of DDC2
1906
1907        Arguments:
1908            value:
1909                Value to write to the NCO phase word, such that:
1910                value = 90° / Phase
1911        Raises:
1912            None
1913
1914        Returns:
1915            None
1916        """
1917        self.device.SET_DDC2_NCO_PHASE2(value)

Configures the starting phase for NCO Frequency 2 of DDC2

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc2_nco_phase3(self, value: int) -> None:
1919    def ddc2_nco_phase3(self, value: int) -> None:
1920        """Configures the starting phase for NCO Frequency 3 of DDC2
1921
1922        Arguments:
1923            value:
1924                Value to write to the NCO phase word, such that:
1925                value = 90° / Phase
1926        Raises:
1927            None
1928
1929        Returns:
1930            None
1931        """
1932        self.device.SET_DDC2_NCO_PHASE3(value)

Configures the starting phase for NCO Frequency 3 of DDC2

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc3_nco_phase0(self, value: int) -> None:
1934    def ddc3_nco_phase0(self, value: int) -> None:
1935        """Configures the starting phase for NCO Frequency 0 of DDC3
1936
1937        Arguments:
1938            value:
1939                Value to write to the NCO phase word, such that:
1940                value = 90° / Phase
1941        Raises:
1942            None
1943
1944        Returns:
1945            None
1946        """
1947        self.device.SET_DDC3_NCO_PHASE0(value)

Configures the starting phase for NCO Frequency 0 of DDC3

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc3_nco_phase1(self, value: int) -> None:
1949    def ddc3_nco_phase1(self, value: int) -> None:
1950        """Configures the starting phase for NCO Frequency 1 of DDC3
1951
1952        Arguments:
1953            value:
1954                Value to write to the NCO phase word, such that:
1955                value = 90° / Phase
1956        Raises:
1957            None
1958
1959        Returns:
1960            None
1961        """
1962        self.device.SET_DDC3_NCO_PHASE1(value)

Configures the starting phase for NCO Frequency 1 of DDC3

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc3_nco_phase2(self, value: int) -> None:
1964    def ddc3_nco_phase2(self, value: int) -> None:
1965        """Configures the starting phase for NCO Frequency 2 of DDC3
1966
1967        Arguments:
1968            value:
1969                Value to write to the NCO phase word, such that:
1970                value = 90° / Phase
1971        Raises:
1972            None
1973
1974        Returns:
1975            None
1976        """
1977        self.device.SET_DDC3_NCO_PHASE2(value)

Configures the starting phase for NCO Frequency 2 of DDC3

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def ddc3_nco_phase3(self, value: int) -> None:
1979    def ddc3_nco_phase3(self, value: int) -> None:
1980        """Configures the starting phase for NCO Frequency 3 of DDC3
1981
1982        Arguments:
1983            value:
1984                Value to write to the NCO phase word, such that:
1985                value = 90° / Phase
1986        Raises:
1987            None
1988
1989        Returns:
1990            None
1991        """
1992        self.device.SET_DDC3_NCO_PHASE3(value)

Configures the starting phase for NCO Frequency 3 of DDC3

Arguments:
  • value: Value to write to the NCO phase word, such that: value = 90° / Phase
Raises:
  • None
Returns:

None

def enable_dclk_divider(self, value: int) -> None:
1994    def enable_dclk_divider(self, value: int) -> None:
1995        """Enables the Data Clock divider for higher decimation rates.
1996
1997        Arguments:
1998            value: input value
1999                - 0: DCLK divider is disabled. DCLK is equal to the Sample CLK
2000                - 1: DCLK divider is enabled. DCLK is divided down from Sample CLK
2001
2002        Raises:
2003            None
2004
2005        Returns:
2006            None
2007        """
2008        self.device.SET_DIG_CLK_DDC(value)

Enables the Data Clock divider for higher decimation rates.

Arguments:
  • value: input value
    • 0: DCLK divider is disabled. DCLK is equal to the Sample CLK
    • 1: DCLK divider is enabled. DCLK is divided down from Sample CLK
Raises:
  • None
Returns:

None

def dclk_powerdown(self, value: int) -> None:
2010    def dclk_powerdown(self, value: int) -> None:
2011        """Powers down the LVDS output clock.
2012
2013        Arguments:
2014            value: input value
2015                - 0: Normal operation
2016                - 1: Dclk powered down
2017
2018        Raises:
2019            None
2020
2021        Returns:
2022            None
2023        """
2024        self.device.SET_DCLK_PDN(value)

Powers down the LVDS output clock.

Arguments:
  • value: input value
    • 0: Normal operation
    • 1: Dclk powered down
Raises:
  • None
Returns:

None

def pulse_overrange_clear(self) -> None:
2035    def pulse_overrange_clear(self) -> None:
2036        """Macro Function. Clears the Digital Overrange by pulsing a value of 2 on the OVR_CLR register field
2037
2038        Arguments:
2039            None
2040
2041        Raises:
2042            None
2043
2044        Returns:
2045            None
2046        """
2047        self.device.SET_DIG_OVR_CLEAR(0x0)
2048        sleep(0.1)
2049        self.device.SET_DIG_OVR_CLEAR(0x2)
2050        sleep(0.1)
2051        self.device.SET_DIG_OVR_CLEAR(0x0)

Macro Function. Clears the Digital Overrange by pulsing a value of 2 on the OVR_CLR register field

Arguments:
  • None
Raises:
  • None
Returns:

None

def invert_lvds_lanes(self, lanes: List[int]) -> None:
2053    def invert_lvds_lanes(self, lanes: List[int]) -> None:
2054        """Macro Function. Inverts the polarity of individual LVDS output lanes.
2055
2056        Arguments:
2057            lanes:
2058                List of 16 lanes with the corresponding values:
2059                - 0: Polarity as shown in pin diagram.
2060                - 1: Polarity inverted
2061
2062        Raises:
2063            None
2064
2065        Returns:
2066            None
2067        """
2068        lanes = int("".join(map(str, lanes)), 2)
2069        self.device.SET_LVDS_DATA_INV(lanes)

Macro Function. Inverts the polarity of individual LVDS output lanes.

Arguments:
  • lanes: List of 16 lanes with the corresponding values:
    • 0: Polarity as shown in pin diagram.
    • 1: Polarity inverted
Raises:
  • None
Returns:

None

def powerdown_lvds_lanes(self, lanes: List[int]) -> None:
2071    def powerdown_lvds_lanes(self, lanes: List[int]) -> None:
2072        """Macro Function. Powers down the individual LVDS output lanes and puts LVDS pins into high impedance state.
2073
2074        Arguments:
2075            lanes:
2076                List of bits which enable or disable the LVDS lanes as follows
2077                - 0: Normal operation
2078                - 1: Powered down
2079
2080        Raises:
2081            None
2082
2083        Returns:
2084            None
2085        """
2086        lanes = int("".join(map(str, lanes)), 2)
2087        self.device.SET_LVDS_DATA_PDN(lanes)

Macro Function. Powers down the individual LVDS output lanes and puts LVDS pins into high impedance state.

Arguments:
  • lanes: List of bits which enable or disable the LVDS lanes as follows
    • 0: Normal operation
    • 1: Powered down
Raises:
  • None
Returns:

None

def dout_mux(self, lane: int, data: int) -> None:
2089    def dout_mux(self, lane: int, data: int) -> None:
2090        """Macro Function. Configures the data bus assignments for each individual output lane
2091
2092        Arguments:
2093            lane:
2094                The DOUT output pin to be mapped to
2095            data:
2096                The internal digital data bus lane that is being mapped
2097
2098        Raises:
2099            None
2100
2101        Returns:
2102            None
2103        """
2104        if lane == 0:
2105            self.device.SET_LANE0_MUX_SEL(data)
2106        elif lane == 1:
2107            self.device.SET_LANE1_MUX_SEL(data)
2108        elif lane == 2:
2109            self.device.SET_LANE2_MUX_SEL(data)
2110        elif lane == 3:
2111            self.device.SET_LANE3_MUX_SEL(data)
2112        elif lane == 4:
2113            self.device.SET_LANE4_MUX_SEL(data)
2114        elif lane == 5:
2115            self.device.SET_LANE5_MUX_SEL(data)
2116        elif lane == 6:
2117            self.device.SET_LANE6_MUX_SEL(data)
2118        elif lane == 7:
2119            self.device.SET_LANE7_MUX_SEL(data)
2120        elif lane == 8:
2121            self.device.SET_LANE8_MUX_SEL(data)
2122        elif lane == 9:
2123            self.device.SET_LANE9_MUX_SEL(data)
2124        elif lane == 10:
2125            self.device.SET_LANE10_MUX_SEL(data)
2126        elif lane == 11:
2127            self.device.SET_LANE11_MUX_SEL(data)
2128        elif lane == 12:
2129            self.device.SET_LANE12_MUX_SEL(data)
2130        elif lane == 13:
2131            self.device.SET_LANE13_MUX_SEL(data)
2132        elif lane == 14:
2133            self.device.SET_LANE14_MUX_SEL(data)
2134        elif lane == 15:
2135            self.device.SET_LANE15_MUX_SEL(data)

Macro Function. Configures the data bus assignments for each individual output lane

Arguments:
  • lane: The DOUT output pin to be mapped to
  • data: The internal digital data bus lane that is being mapped
Raises:
  • None
Returns:

None

def lvds_mirror_all(self, lane: int) -> None:
2137    def lvds_mirror_all(self, lane: int) -> None:
2138        """Macro Function. Mirrors all LVDS lanes to data of chosen lane
2139
2140        Arguments:
2141            lane:
2142                The desired lane data to mirror to all output lanes
2143
2144        Raises:
2145            None
2146
2147        Returns:
2148            None
2149        """
2150        for i in range(0, 16):
2151            self.dout_mux(i, lane)

Macro Function. Mirrors all LVDS lanes to data of chosen lane

Arguments:
  • lane: The desired lane data to mirror to all output lanes
Raises:
  • None
Returns:

None

def cha_digital_gain(self, value: int) -> None:
2153    def cha_digital_gain(self, value: int) -> None:
2154        """Macro Function. Controls digital gain for channel A. Maximum gain is 6dB.
2155
2156        Arguments:
2157            value:
2158                Desired gain value in dB
2159
2160        Raises:
2161            None
2162
2163        Returns:
2164            None
2165        """
2166        gain = 20 * log(1 + (value / 128), 10)
2167        self.device.SET_CH0_PROG_GAIN(gain)

Macro Function. Controls digital gain for channel A. Maximum gain is 6dB.

Arguments:
  • value: Desired gain value in dB
Raises:
  • None
Returns:

None

def chb_digital_gain(self, value: int) -> None:
2169    def chb_digital_gain(self, value: int) -> None:
2170        """Macro Function. Controls digital gain for channel B. Maximum gain is 6dB.
2171
2172        Arguments:
2173            value:
2174                Desired gain value in dB
2175
2176        Raises:
2177            None
2178
2179        Returns:
2180            None
2181        """
2182        gain = 20 * log(1 + (value / 128), 10)
2183        self.device.SET_CH1_PROG_GAIN(gain)

Macro Function. Controls digital gain for channel B. Maximum gain is 6dB.

Arguments:
  • value: Desired gain value in dB
Raises:
  • None
Returns:

None

def sysref_pulse(self) -> None:
2185    def sysref_pulse(self) -> None:
2186        """Macro Function. Pulses the sysref signal
2187
2188        Arguments:
2189            None
2190
2191        Raises:
2192            None
2193
2194        Returns:
2195            None
2196        """
2197        self.sysref_mode(0)
2198        sleep(0.1)
2199        self.sysref_mode(3)
2200        sleep(0.1)
2201        self.sysref_mode(0)

Macro Function. Pulses the sysref signal

Arguments:
  • None
Raises:
  • None
Returns:

None

def ddc_input_source(self, ddc: int, input: int) -> None:
2203    def ddc_input_source(self, ddc: int, input: int) -> None:
2204        """Macro Function. Sets the input data source to each of the decimation filters.
2205
2206        Arguments:
2207            ddc:
2208                The DDC for which the input data source is being configured
2209            input:
2210                Input to the DDC
2211                - 0: Channel A
2212                - 1: Channel B
2213                - 2: 2x Average ((ChA + ChB)/2)
2214                - 3: 2x Average ((ChA - ChB)/2)
2215
2216        Raises:
2217            None
2218
2219        Returns:
2220            None
2221        """
2222        if ddc == 0:
2223            self.device.SET_DDC0_MUX(input)
2224        elif ddc == 1:
2225            if input == 0:
2226                input = 1
2227            elif input == 1:
2228                input = 0
2229            self.device.SET_DDC1_MUX(input)
2230        elif ddc == 2:
2231            self.device.SET_DDC2_MUX(input)
2232        elif ddc == 3:
2233            if input == 0:
2234                input = 1
2235            elif input == 1:
2236                input = 0
2237            self.device.SET_DDC3_MUX(input)

Macro Function. Sets the input data source to each of the decimation filters.

Arguments:
  • ddc: The DDC for which the input data source is being configured
  • input: Input to the DDC
    • 0: Channel A
    • 1: Channel B
    • 2: 2x Average ((ChA + ChB)/2)
    • 3: 2x Average ((ChA - ChB)/2)
Raises:
  • None
Returns:

None

def nco_update(self, nco: int) -> None:
2239    def nco_update(self, nco: int) -> None:
2240        """Macro Function. Updates the frequency of the selected NCO by pulsing a value of 1 on the corresponding NCO_UPDATE field
2241
2242        Arguments:
2243            nco:
2244                NCO that is being configured
2245
2246        Raises:
2247            None
2248
2249        Returns:
2250            None
2251        """
2252        if nco == 0:
2253            self.device.SET_NCO0_UPDATE(0)
2254            sleep(0.1)
2255            self.device.SET_NCO0_UPDATE(1)
2256            sleep(0.1)
2257            self.device.SET_NCO0_UPDATE(1)
2258        elif nco == 1:
2259            self.device.SET_NCO1_UPDATE(0)
2260            sleep(0.1)
2261            self.device.SET_NCO1_UPDATE(1)
2262            sleep(0.1)
2263            self.device.SET_NCO1_UPDATE(1)
2264        elif nco == 2:
2265            self.device.SET_NCO2_UPDATE(0)
2266            sleep(0.1)
2267            self.device.SET_NCO2_UPDATE(1)
2268            sleep(0.1)
2269            self.device.SET_NCO2_UPDATE(1)
2270        elif nco == 3:
2271            self.device.SET_NCO3_UPDATE(0)
2272            sleep(0.1)
2273            self.device.SET_NCO3_UPDATE(1)
2274            sleep(0.1)
2275            self.device.SET_NCO3_UPDATE(1)

Macro Function. Updates the frequency of the selected NCO by pulsing a value of 1 on the corresponding NCO_UPDATE field

Arguments:
  • nco: NCO that is being configured
Raises:
  • None
Returns:

None

def nco_update_common(self) -> None:
2277    def nco_update_common(self) -> None:
2278        """Macro Function. Updates the four NCO frequencies of all NCOs by pulsing a vlaue of 1 on the NCO_COMMON_UPDATE field
2279
2280        Arguments:
2281            None
2282
2283        Raises:
2284            None
2285
2286        Returns:
2287            None
2288        """
2289        self.device.SET_NCO_COMMON_UPDATE(0)
2290        sleep(0.1)
2291        self.device.SET_NCO_COMMON_UPDATE(1)
2292        sleep(0.1)
2293        self.device.SET_NCO_COMMON_UPDATE(0)

Macro Function. Updates the four NCO frequencies of all NCOs by pulsing a vlaue of 1 on the NCO_COMMON_UPDATE field

Arguments:
  • None
Raises:
  • None
Returns:

None

def ddc_nco_select(self, ddc: int, nco: int) -> None:
2295    def ddc_nco_select(self, ddc: int, nco: int) -> None:
2296        """Macro Function. These bits select which of the 4 frequencies are active in the respective DDCs/NCOs.
2297
2298        Arguments:
2299            ddc:
2300                DDC of which to configure the nco frequency
2301            nco:
2302                NCO frequency to set as the active frequency
2303
2304        Raises:
2305            None
2306
2307        Returns:
2308            None
2309        """
2310        if ddc == 0:
2311            self.device.SET_DDC0_NCO_SEL(nco)
2312        elif ddc == 1:
2313            self.device.SET_DDC1_NCO_SEL(nco)
2314        elif ddc == 2:
2315            self.device.SET_DDC2_NCO_SEL(nco)
2316        elif ddc == 3:
2317            self.device.SET_DDC3_NCO_SEL(nco)

Macro Function. These bits select which of the 4 frequencies are active in the respective DDCs/NCOs.

Arguments:
  • ddc: DDC of which to configure the nco frequency
  • nco: NCO frequency to set as the active frequency
Raises:
  • None
Returns:

None

def ddc_decimation_factor(self, ddc: int, factor: int) -> None:
2319    def ddc_decimation_factor(self, ddc: int, factor: int) -> None:
2320        """Macro Function. Sets the decimation factor for each DDC
2321
2322        Arguments:
2323            ddc:
2324                The DDC for which the decimation factor is being configured
2325            factor:
2326                Desired decimation factor
2327
2328        Raises:
2329            None
2330
2331        Returns:
2332            None
2333        """
2334        if factor == 0:
2335            n = factor
2336        else:
2337            n = int(log(factor, 2))
2338
2339        self.device.SET_SELECT_INDEPENDENT_DECIMATION(
2340            1
2341        )  # Configure for different decimation factors for each DDC
2342
2343        if ddc == 0:
2344            self.device.SET_DDC0_DECIMATION_MODE(n)
2345        elif ddc == 1:
2346            self.device.SET_DDC1_DECIMATION_MODE(n)
2347        elif ddc == 2:
2348            self.device.SET_DDC2_DECIMATION_MODE(n)
2349        elif ddc == 3:
2350            self.device.SET_DDC3_DECIMATION_MODE(n)

Macro Function. Sets the decimation factor for each DDC

Arguments:
  • ddc: The DDC for which the decimation factor is being configured
  • factor: Desired decimation factor
Raises:
  • None
Returns:

None

def decimation_factor_common(self, factor: int) -> None:
2352    def decimation_factor_common(self, factor: int) -> None:
2353        """Macro Function. Enables decimation for all DDCs and sets the common decimation factor for all DDCs
2354
2355        Arguments:
2356            factor:
2357                Desired decimation factor
2358
2359        Raises:
2360            None
2361
2362        Returns:
2363            None
2364        """
2365        if factor == 0:
2366            n = factor
2367        else:
2368            n = int(log(factor, 2))
2369
2370        self.device.SET_SELECT_INDEPENDENT_DECIMATION(
2371            0
2372        )  # Configure for common decimation factors for all DDCs
2373        self.device.SET_COMMON_DECIMATION_MODE(n)

Macro Function. Enables decimation for all DDCs and sets the common decimation factor for all DDCs

Arguments:
  • factor: Desired decimation factor
Raises:
  • None
Returns:

None

def ddc_nco_frequency(self, ddc: int, nco: int, freq: int) -> None:
2375    def ddc_nco_frequency(self, ddc: int, nco: int, freq: int) -> None:
2376        """Macro Function. Configures the 48-bit frequency words for the four DDCs/NCOs.
2377
2378        Arguments:
2379            ddc:
2380                DDC of which the frequency is being configured
2381            nco:
2382                NCO frequency which is being configured (0-3)
2383            freq:
2384                Desired frequency
2385
2386        Raises:
2387            None
2388
2389        Returns:
2390            None
2391        """
2392        if freq > 0:
2393            nco_word = int(
2394                freq * (2**48) / self.fs
2395            )  # Formula for calulating this value is in the datasheet
2396        else:
2397            nco_word = int(
2398                ((self.device.fs + freq) * (2**48) / self.fs) - 1
2399            )  # Formula for calulating this value is in the datasheet
2400
2401        if ddc == 0:
2402            if nco == 0:
2403                self.device.SET_DDC0_NCO_FREQ0(nco_word)
2404            elif nco == 1:
2405                self.device.SET_DDC0_NCO_FREQ1(nco_word)
2406            elif nco == 2:
2407                self.device.SET_DDC0_NCO_FREQ2(nco_word)
2408            elif nco == 3:
2409                self.device.SET_DDC0_NCO_FREQ3(nco_word)
2410        elif ddc == 1:
2411            if nco == 0:
2412                self.device.SET_DDC1_NCO_FREQ0(nco_word)
2413            elif nco == 1:
2414                self.device.SET_DDC1_NCO_FREQ1(nco_word)
2415            elif nco == 2:
2416                self.device.SET_DDC1_NCO_FREQ2(nco_word)
2417            elif nco == 3:
2418                self.device.SET_DDC1_NCO_FREQ3(nco_word)
2419        elif ddc == 2:
2420            if nco == 0:
2421                self.device.SET_DDC2_NCO_FREQ0(nco_word)
2422            elif nco == 1:
2423                self.device.SET_DDC2_NCO_FREQ1(nco_word)
2424            elif nco == 2:
2425                self.device.SET_DDC2_NCO_FREQ2(nco_word)
2426            elif nco == 3:
2427                self.device.SET_DDC2_NCO_FREQ3(nco_word)
2428        elif ddc == 3:
2429            if nco == 0:
2430                self.device.SET_DDC3_NCO_FREQ0(nco_word)
2431            elif nco == 1:
2432                self.device.SET_DDC3_NCO_FREQ1(nco_word)
2433            elif nco == 2:
2434                self.device.SET_DDC3_NCO_FREQ2(nco_word)
2435            elif nco == 3:
2436                self.device.SET_DDC3_NCO_FREQ3(nco_word)

Macro Function. Configures the 48-bit frequency words for the four DDCs/NCOs.

Arguments:
  • ddc: DDC of which the frequency is being configured
  • nco: NCO frequency which is being configured (0-3)
  • freq: Desired frequency
Raises:
  • None
Returns:

None

def ddc_nco_phase(self, ddc: int, nco: int, phase: int) -> None:
2438    def ddc_nco_phase(self, ddc: int, nco: int, phase: int) -> None:
2439        """Macro Function. Configure the starting phase of the frequency for the DDCs/NCOs. The phase value is: 90° / <16-bit register>
2440
2441        Arguments:
2442            ddc:
2443                DDC of which the phase is being configured
2444            nco:
2445                NCO of which the phase is being configured
2446            phase:
2447                desired phase in degrees
2448
2449        Raises:
2450            None
2451
2452        Returns:
2453            None
2454        """
2455        if phase == 0:
2456            phaseval = 0
2457        else:
2458            phaseval = int(90 / phase)
2459
2460        if ddc == 0:
2461            if nco == 0:
2462                self.device.SET_DDC0_NCO_PHASE0(phaseval)
2463            elif nco == 1:
2464                self.device.SET_DDC0_NCO_PHASE1(phaseval)
2465            elif nco == 2:
2466                self.device.SET_DDC0_NCO_PHASE2(phaseval)
2467            elif nco == 3:
2468                self.device.SET_DDC0_NCO_PHASE3(phaseval)
2469        elif ddc == 1:
2470            if nco == 0:
2471                self.device.SET_DDC0_NCO_PHASE0(phaseval)
2472            elif nco == 1:
2473                self.device.SET_DDC1_NCO_PHASE1(phaseval)
2474            elif nco == 2:
2475                self.device.SET_DDC2_NCO_PHASE2(phaseval)
2476            elif nco == 3:
2477                self.device.SET_DDC3_NCO_PHASE3(phaseval)
2478        elif ddc == 2:
2479            if nco == 0:
2480                self.device.SET_DDC0_NCO_PHASE0(phaseval)
2481            elif nco == 1:
2482                self.device.SET_DDC1_NCO_PHASE1(phaseval)
2483            elif nco == 2:
2484                self.device.SET_DDC2_NCO_PHASE2(phaseval)
2485            elif nco == 3:
2486                self.device.SET_DDC3_NCO_PHASE3(phaseval)
2487        elif ddc == 3:
2488            if nco == 0:
2489                self.device.SET_DDC0_NCO_PHASE0(phaseval)
2490            elif nco == 1:
2491                self.device.SET_DDC1_NCO_PHASE1(phaseval)
2492            elif nco == 2:
2493                self.device.SET_DDC2_NCO_PHASE2(phaseval)
2494            elif nco == 3:
2495                self.device.SET_DDC3_NCO_PHASE3(phaseval)

Macro Function. Configure the starting phase of the frequency for the DDCs/NCOs. The phase value is: 90° / <16-bit register>

Arguments:
  • ddc: DDC of which the phase is being configured
  • nco: NCO of which the phase is being configured
  • phase: desired phase in degrees
Raises:
  • None
Returns:

None

def read_all_regs(self) -> None:
2497    def read_all_regs(self) -> None:
2498        """Macro Function. Reads all registers for configuration debug purposes.
2499
2500        Arguments:
2501            None
2502
2503        Raises:
2504            None
2505
2506        Returns:
2507            None
2508        """
2509        self.device.debugReadback()

Macro Function. Reads all registers for configuration debug purposes.

Arguments:
  • None
Raises:
  • None
Returns:

None