Skip to content

Commit

Permalink
needed a dummy api for when building on machines without Alazar drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-freeman committed May 22, 2018
1 parent fa85e61 commit da2b785
Showing 1 changed file with 290 additions and 0 deletions.
290 changes: 290 additions & 0 deletions place/plugins/alazartech/dummy_atsapi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
#pylint: skip-file
"""Dummy API
Used to prevent error messages when PLACE is run on systems without the Alazar
drivers.
"""
class Board:
pass

INTERNAL_CLOCK = 0x1
EXTERNAL_CLOCK = 0x2
FAST_EXTERNAL_CLOCK = 0x2
MEDIUM_EXTERNAL_CLOCK = 0x3
SLOW_EXTERNAL_CLOCK = 0x4
EXTERNAL_CLOCK_AC = 0x5
EXTERNAL_CLOCK_DC = 0x6
EXTERNAL_CLOCK_10MHz_REF = 0x7
INTERNAL_CLOCK_10MHz_REF = 0x8
EXTERNAL_CLOCK_10MHz_PXI = 0xA
INTERNAL_CLOCK_DIV_4 = 0xF
INTERNAL_CLOCK_DIV_5 = 0x10
MASTER_CLOCK = 0x11
INTERNAL_CLOCK_SET_VCO = 0x12

SAMPLE_RATE_1KSPS = 0x1
SAMPLE_RATE_2KSPS = 0x2
SAMPLE_RATE_5KSPS = 0x5
SAMPLE_RATE_10KSPS = 0x8
SAMPLE_RATE_20KSPS = 0xA
SAMPLE_RATE_50KSPS = 0xC
SAMPLE_RATE_100KSPS = 0xE
SAMPLE_RATE_200KSPS = 0x10
SAMPLE_RATE_500KSPS = 0x12
SAMPLE_RATE_1MSPS = 0x14
SAMPLE_RATE_2MSPS = 0x18
SAMPLE_RATE_5MSPS = 0x1A
SAMPLE_RATE_10MSPS = 0x1C
SAMPLE_RATE_20MSPS = 0x1E
SAMPLE_RATE_25MSPS = 0x21
SAMPLE_RATE_50MSPS = 0x22
SAMPLE_RATE_100MSPS = 0x24
SAMPLE_RATE_125MSPS = 0x25
SAMPLE_RATE_160MSPS = 0x26
SAMPLE_RATE_180MSPS = 0x27
SAMPLE_RATE_200MSPS = 0x28
SAMPLE_RATE_250MSPS = 0x2B
SAMPLE_RATE_400MSPS = 0x2D
SAMPLE_RATE_500MSPS = 0x30
SAMPLE_RATE_800MSPS = 0x32
SAMPLE_RATE_1000MSPS = 0x35
SAMPLE_RATE_1200MSPS = 0x37
SAMPLE_RATE_1500MSPS = 0x3A
SAMPLE_RATE_1600MSPS = 0x3B
SAMPLE_RATE_1800MSPS = 0x3D
SAMPLE_RATE_2000MSPS = 0x3F
SAMPLE_RATE_2400MSPS = 0x6A
SAMPLE_RATE_3000MSPS = 0x75
SAMPLE_RATE_3600MSPS = 0x7B
SAMPLE_RATE_4000MSPS = 0x80
SAMPLE_RATE_USER_DEF = 0x40

CLOCK_EDGE_RISING = 0
CLOCK_EDGE_FALLING = 1

CHANNEL_A = 1
CHANNEL_B = 2
CHANNEL_C = 4
CHANNEL_D = 8
CHANNEL_E = 16
CHANNEL_F = 32
CHANNEL_G = 64
CHANNEL_H = 128
CHANNEL_I = 256
CHANNEL_J = 512
CHANNEL_K = 1024
CHANNEL_L = 2048
CHANNEL_M = 4096
CHANNEL_N = 8192
CHANNEL_O = 16384
CHANNEL_P = 32768

channels = [
CHANNEL_A,
CHANNEL_B,
CHANNEL_C,
CHANNEL_D,
CHANNEL_E,
CHANNEL_F,
CHANNEL_G,
CHANNEL_H,
CHANNEL_I,
CHANNEL_J,
CHANNEL_K,
CHANNEL_L,
CHANNEL_M,
CHANNEL_N,
CHANNEL_O,
CHANNEL_P
]

ADMA_TRADITIONAL_MODE = 0
ADMA_NPT = 0x200
ADMA_CONTINUOUS_MODE = 0x100
ADMA_TRIGGERED_STREAMING = 0x400
ADMA_EXTERNAL_STARTCAPTURE = 0x1
ADMA_ENABLE_RECORD_HEADERS = 0x8
ADMA_ALLOC_BUFFERS = 0x20
ADMA_FIFO_ONLY_STREAMING = 0x800
ADMA_INTERLEAVE_SAMPLES = 0x1000
ADMA_GET_PROCESSED_DATA = 0x2000
ADMA_DSP = 0x4000

ATS850 = 1
ATS310 = 2
ATS330 = 3
ATS855 = 4
ATS315 = 5
ATS335 = 6
ATS460 = 7
ATS860 = 8
ATS660 = 9
ATS665 = 10
ATS9462 = 11
ATS9434 = 12
ATS9870 = 13
ATS9350 = 14
ATS9325 = 15
ATS9440 = 16
ATS9410 = 17
ATS9351 = 18
ATS9310 = 19
ATS9461 = 20
ATS9850 = 21
ATS9625 = 22
ATG6500 = 23
ATS9626 = 24
ATS9360 = 25
AXI9870 = 26
ATS9370 = 27
ATU7825 = 28
ATS9373 = 29
ATS9416 = 30

boardNames = {
ATS850 : "ATS850" ,
ATS310 : "ATS310" ,
ATS330 : "ATS330" ,
ATS855 : "ATS855" ,
ATS315 : "ATS315" ,
ATS335 : "ATS335" ,
ATS460 : "ATS460" ,
ATS860 : "ATS860" ,
ATS660 : "ATS660" ,
ATS665 : "ATS665" ,
ATS9462: "ATS9462",
ATS9434: "ATS9434",
ATS9870: "ATS9870",
ATS9350: "ATS9350",
ATS9325: "ATS9325",
ATS9440: "ATS9440",
ATS9410: "ATS9410",
ATS9351: "ATS9351",
ATS9310: "ATS9310",
ATS9461: "ATS9461",
ATS9850: "ATS9850",
ATS9625: "ATS9625",
ATG6500: "ATG6500",
ATS9626: "ATS9626",
ATS9360: "ATS9360",
AXI9870: "AXI9870",
ATS9370: "ATS9370",
ATU7825: "ATU7825",
ATS9373: "ATS9373",
ATS9416: "ATS9416"
};

INPUT_RANGE_PM_40_MV = 0x2
INPUT_RANGE_PM_50_MV = 0x3
INPUT_RANGE_PM_80_MV = 0x4
INPUT_RANGE_PM_100_MV = 0x5
INPUT_RANGE_PM_200_MV = 0x6
INPUT_RANGE_PM_400_MV = 0x7
INPUT_RANGE_PM_500_MV = 0x8
INPUT_RANGE_PM_800_MV = 0x9
INPUT_RANGE_PM_1_V = 0xA
INPUT_RANGE_PM_2_V = 0xB
INPUT_RANGE_PM_4_V = 0xC
INPUT_RANGE_PM_5_V = 0xD
INPUT_RANGE_PM_8_V = 0xE
INPUT_RANGE_PM_10_V = 0xF
INPUT_RANGE_PM_20_V = 0x10
INPUT_RANGE_PM_40_V = 0x11
INPUT_RANGE_PM_16_V = 0x12
INPUT_RANGE_HIFI = 0x20
INPUT_RANGE_PM_1_V_25 = 0x21
INPUT_RANGE_PM_2_V_5 = 0x25
INPUT_RANGE_PM_125_MV = 0x28
INPUT_RANGE_PM_250_MV = 0x30

AC_COUPLING = 1
DC_COUPLING = 2

TRIG_ENGINE_J = 0
TRIG_ENGINE_K = 1

TRIG_ENGINE_OP_J = 0
TRIG_ENGINE_OP_K = 1
TRIG_ENGINE_OP_J_OR_K = 2
TRIG_ENGINE_OP_J_AND_K = 3
TRIG_ENGINE_OP_J_XOR_K = 4
TRIG_ENGINE_OP_J_AND_NOT_K = 5
TRIG_ENGINE_OP_NOT_J_AND_K = 6

TRIG_CHAN_A = 0
TRIG_CHAN_B = 1
TRIG_CHAN_C = 4
TRIG_CHAN_D = 5
TRIG_EXTERNAL = 2
TRIG_DISABLE = 3

TRIGGER_SLOPE_POSITIVE = 1
TRIGGER_SLOPE_NEGATIVE = 2

IMPEDANCE_1M_OHM = 1
IMPEDANCE_50_OHM = 2
IMPEDANCE_75_OHM = 4
IMPEDANCE_300_OHM = 8

ETR_5V = 0
ETR_1V = 1
ETR_TTL = 2
ETR_2V5 = 3

LED_OFF = 0
LED_ON = 1

LSB_DEFAULT = 0
LSB_EXT_TRIG = 1
LSB_AUX_IN_0 = 2 # deprecated
LSB_AUX_IN_1 = 3
LSB_AUX_IN_2 = 2

AUX_OUT_TRIGGER = 0
AUX_IN_TRIGGER_ENABLE = 1
AUX_OUT_PACER = 2
AUX_IN_AUXILIARY = 13
AUX_OUT_SERIAL_DATA = 14

SETGET_ASYNC_BUFFCOUNT = 0x10000040
SET_DATA_FORMAT = 0x10000041
ECC_MODE = 0x10000048

TRIGGER_SLOPE_POSITIVE = 1
TRIGGER_SLOPE_NEGATIVE = 2

CRA_MODE_DISABLE = 0
CRA_MODE_ENABLE_FPGA_AVE = 1
CRA_OPTION_UNSIGNED = 0
CRA_OPTION_SIGNED = 1

TIMESTAMP_RESET_FIRSTTIME_ONLY = 0
TIMESTAMP_RESET_ALWAYS = 1

POWER_OFF = 0
POWER_ON = 1

DSP_WINDOW_NONE = 0
DSP_WINDOW_HANNING = 1
DSP_WINDOW_HAMMING = 2
DSP_WINDOW_BLACKMAN = 3
DSP_WINDOW_BLACKMAN_HARRIS = 4
DSP_WINDOW_BARTLETT = 5

DSP_MODULE_NONE = 0xFFFF
DSP_MODULE_FFT = 0x10000
DSP_MODULE_PCD = 0x10001

FFT_OUTPUT_FORMAT_U32 = 0x0
FFT_OUTPUT_FORMAT_U16_LOG = 0x1
FFT_OUTPUT_FORMAT_U16_AMP2 = 0x101
FFT_OUTPUT_FORMAT_U8_LOG = 0x2
FFT_OUTPUT_FORMAT_U8_AMP2 = 0x102
FFT_OUTPUT_FORMAT_REAL_S32 = 0x3
FFT_OUTPUT_FORMAT_IMAG_S32 = 0x4
FFT_OUTPUT_FORMAT_FLOAT_AMP2 = 0xA
FFT_OUTPUT_FORMAT_FLOAT_LOG = 0xB
FFT_OUTPUT_FORMAT_RAW_PLUS_FFT = 0x1000

FFT_FOOTER_NONE = 0x0
FFT_FOOTER_NPT = 0x1

0 comments on commit da2b785

Please sign in to comment.