def ltc2376_16_dc1805a_d(num_samples,
                         verbose=False,
                         do_plot=False,
                         do_write_to_file=False):
    # connect to the DC1805A-D and do a collection
    with Dc1805aD(verbose) as controller:
        # You can call this multiple times with the same controller if you need to
        data = controller.collect(num_samples, consts.TRIGGER_NONE)

        if do_plot:
            funcs.plot(controller.get_num_bits(), data, verbose=verbose)
        if do_write_to_file:
            funcs.write_to_file_32_bit("data.txt", data, verbose=verbose)
        return data
Пример #2
0
def ltc2185_dc1620(num_samples,
                   spi_registers,
                   verbose=False,
                   do_plot=False,
                   do_write_to_file=False):
    with Dc1620(spi_registers, verbose) as controller:
        # You can call this multiple times with the same controller if you need to
        data = controller.collect(num_samples, consts.TRIGGER_NONE)
        data = data[::2]
        if do_plot:
            funcs.plot(data)
        if do_write_to_file:
            funcs.write_to_file_32_bit(data, "data.txt")
        return data
def ltc2500_32_dc2222a_a(num_samples,
                         df,
                         filter_type,
                         enable_dge,
                         enable_dgc,
                         verify,
                         is_distributed_rd,
                         is_filtered_data,
                         verbose=False,
                         do_plot=False,
                         do_write_to_file=False):
    with Dc2222aA(df, filter_type, enable_dge, enable_dgc, verify,
                  is_distributed_rd, is_filtered_data, verbose) as controller:
        # You can call this multiple times with the same controller if you need tos
        data, cm_data, of_data = controller.collect(num_samples,
                                                    consts.TRIGGER_NONE)

        # To change the df, verify, and/or distributed read, call the following
        # function before a collect.
        # config_cpld(df, verify, is_distributed_rd)

        if do_plot:
            funcs.plot(controller.get_num_bits(), data, verbose=verbose)

            if cm_data is not None:

                plt.figure(2)
                plt.plot(cm_data)
                plt.title('Common Mode Time Domain Samples')
                plt.show()
            if of_data is not None:
                plt.figure(3)
                plt.plot(of_data)
                plt.title('Overflow Bit Time Domain Samples')
                plt.show()

        if do_write_to_file:
            funcs.write_to_file_32_bit("data.txt", data, verbose=verbose)
            if cm_data is not None:
                funcs.write_to_file_32_bit("cm_data.txt",
                                           cm_data,
                                           verbose=verbose)
        return data
def ltc2380_24_dc2289a_a(num_samples,
                         osr,
                         verify,
                         is_disributed_rd,
                         verbose=False,
                         do_plot=False,
                         do_write_to_file=False):
    with Dc2289aA(osr, verify, is_disributed_rd, verbose) as controller:
        # You can call this multiple times with the same controller if you need to
        data = controller.collect(num_samples, consts.TRIGGER_NONE)

        # To change the OSR, verify, and/or distributed read, call the following
        # function before a collect.
        # config_cpld(osr, verify, is_disributed_rd)

        if do_plot:
            funcs.plot(controller.get_num_bits(), data, verbose=verbose)
        if do_write_to_file:
            funcs.write_to_file_32_bit("data.txt", data, verbose=verbose)
        return data