dsl.h 41.4 KB
Newer Older
Andy Dneg's avatar
Andy Dneg committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
/*
 * This file is part of the libsigrok project.
 *
 * Copyright (C) 2013 Bert Vermeulen <bert@biot.com>
 * Copyright (C) 2013 DreamSourceLab <support@dreamsourcelab.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef LIBDSL_HARDWARE_DSL_H
#define LIBDSL_HARDWARE_DSL_H

#include <glib.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "command.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <errno.h>
#include <assert.h>

#include <sys/stat.h>
#include <inttypes.h>

#undef min
#define min(a,b) ((a)<(b)?(a):(b))
#undef max
#define max(a,b) ((a)>(b)?(a):(b))

/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "DSL Hardware: "
#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)

#define USB_INTERFACE		0
#define USB_CONFIGURATION	1
#define NUM_TRIGGER_STAGES	16
#define NUM_SIMUL_TRANSFERS	64
57
#define MAX_EMPTY_POLL      16
Andy Dneg's avatar
Andy Dneg committed
58 59 60

#define DSL_REQUIRED_VERSION_MAJOR	2
#define DSL_REQUIRED_VERSION_MINOR	0
61
#define DSL_HDL_VERSION             0x0D
Andy Dneg's avatar
Andy Dneg committed
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87

/* hardware Capabilities */
#define CAPS_MODE_LOGIC (1 << 0)
#define CAPS_MODE_ANALOG (1 << 1)
#define CAPS_MODE_DSO (1 << 2)

#define CAPS_FEATURE_NONE 0
// voltage threshold
#define CAPS_FEATURE_VTH (1 << 0)
// with external buffer
#define CAPS_FEATURE_BUF (1 << 1)
// pre offset control
#define CAPS_FEATURE_PREOFF (1 << 2)
// small startup eemprom
#define CAPS_FEATURE_SEEP (1 << 3)
// zero calibration ability
#define CAPS_FEATURE_ZERO (1 << 4)
// use HMCAD1511 adc chip
#define CAPS_FEATURE_HMCAD1511 (1 << 5)
// usb 3.0
#define CAPS_FEATURE_USB30 (1 << 6)
// pogopin panel
#define CAPS_FEATURE_POGOPIN (1 << 7)
// use ADF4360-7 vco chip
#define CAPS_FEATURE_ADF4360 (1 << 8)
// 20M bandwidth limitation
88 89 90 91 92 93 94
#define CAPS_FEATURE_20M (1 << 9)
// use startup flash (fx3)
#define CAPS_FEATURE_FLASH (1 << 10)
// 32 channels
#define CAPS_FEATURE_LA_CH32 (1 << 11)
// auto tunning vgain
#define CAPS_FEATURE_AUTO_VGAIN (1 << 12)
Andy Dneg's avatar
Andy Dneg committed
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
/* end */


#define DSLOGIC_ATOMIC_BITS 6
#define DSLOGIC_ATOMIC_SAMPLES (1 << DSLOGIC_ATOMIC_BITS)
#define DSLOGIC_ATOMIC_SIZE (1 << (DSLOGIC_ATOMIC_BITS - 3))
#define DSLOGIC_ATOMIC_MASK (0xFFFF << DSLOGIC_ATOMIC_BITS)

/*
 * for basic configuration
 */
#define TRIG_EN_BIT 0
#define CLK_TYPE_BIT 1
#define CLK_EDGE_BIT 2
#define RLE_MODE_BIT 3
#define DSO_MODE_BIT 4
#define HALF_MODE_BIT 5
#define QUAR_MODE_BIT 6
#define ANALOG_MODE_BIT 7
#define FILTER_BIT 8
#define INSTANT_BIT 9
#define STRIG_MODE_BIT 11
#define STREAM_MODE_BIT 12
#define LPB_TEST_BIT 13
#define EXT_TEST_BIT 14
#define INT_TEST_BIT 15

#define bmNONE          0
#define bmEEWP          (1 << 0)
#define bmFORCE_RDY     (1 << 1)
#define bmFORCE_STOP    (1 << 2)
#define bmSCOPE_SET     (1 << 3)
#define bmSCOPE_CLR     (1 << 4)
#define bmBW20M_SET     (1 << 5)
#define bmBW20M_CLR     (1 << 6)

/*
 * packet content check
 */
#define TRIG_CHECKID 0x55555555
#define DSO_PKTID 0xa500

137 138 139 140 141
/*
 * zero configuration
 */
#define DSO_ZERO_PAGE 8
#define MAX_ACC_VARIANCE 0.0005
Andy Dneg's avatar
Andy Dneg committed
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
/*
 * for DSCope device
 * trans: x << 8 + y
 * x = vpos(coarse), each step(1024 total) indicate x(mv) at 1/20 attenuation, and x/10(mv) at 1/2 attenuation
 * y = voff(fine), each step(1024 total) indicate y/100(mv) at 1/20 attenuation, adn y/1000(mv) at 1/2 attenuation
 * voff: x << 10 + y
 * x = vpos(coarse) default bias
 * y = voff(fine) default bias
 * the final offset: x+DSCOPE_CONSTANT_BIAS->vpos(coarse); y->voff(fine)
 */
#define DSCOPE_CONSTANT_BIAS 160
#define DSCOPE_TRANS_CMULTI   10
#define DSCOPE_TRANS_FMULTI   100.0

/*
 * for DSCope20 device
 * trans: the whole windows offset map to the offset pwm(1024 total)
 * voff: offset pwm constant bias to balance circuit offset
 */
#define CALI_VGAIN_RANGE 100

enum LANGUAGE {
    LANGUAGE_CN = 25,
    LANGUAGE_EN = 31,
};

struct DSL_caps {
    uint64_t mode_caps;
    uint64_t feature_caps;
    uint64_t channels;
172
    uint64_t total_ch_num;
Andy Dneg's avatar
Andy Dneg committed
173 174 175 176 177 178 179 180 181 182 183 184 185 186
    uint64_t hw_depth;
    uint64_t dso_depth;
    uint8_t intest_channel;
    const uint64_t *vdivs;
    const uint64_t *samplerates;
    uint8_t vga_id;
    uint16_t default_channelmode;
    uint64_t default_samplerate;
    uint64_t default_samplelimit;
    uint16_t default_pwmtrans;
    uint16_t default_pwmmargin;
    uint32_t ref_min;
    uint32_t ref_max;
    uint16_t default_comb_comp;
187 188
    uint64_t half_samplerate;
    uint64_t quarter_samplerate;
Andy Dneg's avatar
Andy Dneg committed
189 190 191 192 193
};

struct DSL_profile {
    uint16_t vid;
    uint16_t pid;
194
    enum libusb_speed usb_speed;
Andy Dneg's avatar
Andy Dneg committed
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350

    const char *vendor;
    const char *model;
    const char *model_version;

    const char *firmware;

    const char *fpga_bit33;
    const char *fpga_bit50;

    struct DSL_caps dev_caps;
};

static const uint64_t vdivs10to2000[] = {
    SR_mV(10),
    SR_mV(20),
    SR_mV(50),
    SR_mV(100),
    SR_mV(200),
    SR_mV(500),
    SR_V(1),
    SR_V(2),
    0,
};

static const uint64_t samplerates100[] = {
    SR_HZ(10),
    SR_HZ(20),
    SR_HZ(50),
    SR_HZ(100),
    SR_HZ(200),
    SR_HZ(500),
    SR_KHZ(1),
    SR_KHZ(2),
    SR_KHZ(5),
    SR_KHZ(10),
    SR_KHZ(20),
    SR_KHZ(40),
    SR_KHZ(50),
    SR_KHZ(100),
    SR_KHZ(200),
    SR_KHZ(400),
    SR_KHZ(500),
    SR_MHZ(1),
    SR_MHZ(2),
    SR_MHZ(4),
    SR_MHZ(5),
    SR_MHZ(10),
    SR_MHZ(20),
    SR_MHZ(25),
    SR_MHZ(50),
    SR_MHZ(100),
    0,
};

static const uint64_t samplerates400[] = {
    SR_HZ(10),
    SR_HZ(20),
    SR_HZ(50),
    SR_HZ(100),
    SR_HZ(200),
    SR_HZ(500),
    SR_KHZ(1),
    SR_KHZ(2),
    SR_KHZ(5),
    SR_KHZ(10),
    SR_KHZ(20),
    SR_KHZ(40),
    SR_KHZ(50),
    SR_KHZ(100),
    SR_KHZ(200),
    SR_KHZ(400),
    SR_KHZ(500),
    SR_MHZ(1),
    SR_MHZ(2),
    SR_MHZ(4),
    SR_MHZ(5),
    SR_MHZ(10),
    SR_MHZ(20),
    SR_MHZ(25),
    SR_MHZ(50),
    SR_MHZ(100),
    SR_MHZ(200),
    SR_MHZ(400),
    0,
};

static const uint64_t samplerates1000[] = {
    SR_HZ(10),
    SR_HZ(20),
    SR_HZ(50),
    SR_HZ(100),
    SR_HZ(200),
    SR_HZ(500),
    SR_KHZ(1),
    SR_KHZ(2),
    SR_KHZ(5),
    SR_KHZ(10),
    SR_KHZ(20),
    SR_KHZ(40),
    SR_KHZ(50),
    SR_KHZ(100),
    SR_KHZ(200),
    SR_KHZ(400),
    SR_KHZ(500),
    SR_MHZ(1),
    SR_MHZ(2),
    SR_MHZ(4),
    SR_MHZ(5),
    SR_MHZ(10),
    SR_MHZ(20),
    SR_MHZ(25),
    SR_MHZ(50),
    SR_MHZ(100),
    SR_MHZ(125),
    SR_MHZ(250),
    SR_MHZ(500),
    SR_GHZ(1),
    0,
};

struct DSL_vga {
    uint8_t id;
    uint64_t key;
    uint64_t vgain;
    uint16_t preoff;
    uint16_t preoff_comp;
};
static const struct DSL_vga vga_defaults[] = {
    {1, 10,   0x162400, (32<<10)+558, (32<<10)+558},
    {1, 20,   0x14C000, (32<<10)+558, (32<<10)+558},
    {1, 50,   0x12E800, (32<<10)+558, (32<<10)+558},
    {1, 100,  0x118000, (32<<10)+558, (32<<10)+558},
    {1, 200,  0x102400, (32<<10)+558, (32<<10)+558},
    {1, 500,  0x2E800,  (32<<10)+558, (32<<10)+558},
    {1, 1000, 0x18000,  (32<<10)+558, (32<<10)+558},
    {1, 2000, 0x02400,  (32<<10)+558, (32<<10)+558},

    {2, 10,   0x1DA800, 45, 1024-920-45},
    {2, 20,   0x1A7200, 45, 1024-920-45},
    {2, 50,   0x164200, 45, 1024-920-45},
    {2, 100,  0x131800, 45, 1024-920-45},
    {2, 200,  0xBD000,  45, 1024-920-45},
    {2, 500,  0x7AD00,  45, 1024-920-45},
    {2, 1000, 0x48800,  45, 1024-920-45},
    {2, 2000, 0x12000,  45, 1024-920-45},

    {3, 10,   0x1C5C00, 45, 1024-920-45},
    {3, 20,   0x19EB00, 45, 1024-920-45},
    {3, 50,   0x16AE00, 45, 1024-920-45},
    {3, 100,  0x143D00, 45, 1024-920-45},
    {3, 200,  0xB1000,  45, 1024-920-45},
    {3, 500,  0x7F000,  45, 1024-920-45},
    {3, 1000, 0x57200,  45, 1024-920-45},
    {3, 2000, 0x2DD00,  45, 1024-920-45},

351 352 353 354 355 356 357 358
    {4, 10,   0x1C6C00, 60, 1024-900-60},
    {4, 20,   0x19E000, 60, 1024-900-60},
    {4, 50,   0x16A800, 60, 1024-900-60},
    {4, 100,  0x142800, 60, 1024-900-60},
    {4, 200,  0xC7F00,  60, 1024-900-60},
    {4, 500,  0x94000,  60, 1024-900-60},
    {4, 1000, 0x6CF00,  60, 1024-900-60},
    {4, 2000, 0x44F00,  60, 1024-900-60},
Andy Dneg's avatar
Andy Dneg committed
359 360 361 362 363 364 365 366 367

    {0, 0, 0, 0, 0}
};

enum CHANNEL_ID {
    DSL_STREAM20x16 = 0,
    DSL_STREAM25x12,
    DSL_STREAM50x6,
    DSL_STREAM100x3,
368 369 370 371 372 373 374 375 376 377 378 379 380 381

    DSL_STREAM20x16_3DN2,
    DSL_STREAM25x12_3DN2,
    DSL_STREAM50x6_3DN2,
    DSL_STREAM100x3_3DN2,

    DSL_STREAM10x32_32_3DN2,
    DSL_STREAM20x16_32_3DN2,
    DSL_STREAM25x12_32_3DN2,
    DSL_STREAM50x6_32_3DN2,
    DSL_STREAM100x3_32_3DN2,

    DSL_STREAM50x32,
    DSL_STREAM100x30,
Andy Dneg's avatar
Andy Dneg committed
382
    DSL_STREAM250x12,
383 384
    DSL_STREAM125x16_16,
    DSL_STREAM250x12_16,
Andy Dneg's avatar
Andy Dneg committed
385 386 387 388 389 390
    DSL_STREAM500x6,
    DSL_STREAM1000x3,

    DSL_BUFFER100x16,
    DSL_BUFFER200x8,
    DSL_BUFFER400x4,
391 392

    DSL_BUFFER250x32,
Andy Dneg's avatar
Andy Dneg committed
393 394 395 396
    DSL_BUFFER500x16,
    DSL_BUFFER1000x8,

    DSL_ANALOG10x2,
397
    DSL_ANALOG10x2_500,
Andy Dneg's avatar
Andy Dneg committed
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429

    DSL_DSO200x2,
    DSL_DSO1000x2,
};

struct DSL_channels {
    enum CHANNEL_ID id;
    enum OPERATION_MODE mode;
    enum CHANNEL_TYPE type;
    gboolean stream;
    uint16_t num;
    uint16_t vld_num;
    uint8_t unit_bits;
    uint64_t min_samplerate;
    uint64_t max_samplerate;
    uint64_t hw_min_samplerate;
    uint64_t hw_max_samplerate;
    uint8_t pre_div;
    const char *descr;
    const char *descr_cn;
};

static const struct DSL_channels channel_modes[] = {
    // LA Stream
    {DSL_STREAM20x16,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE,  16, 16, 1, SR_KHZ(10), SR_MHZ(20),
     SR_KHZ(10), SR_MHZ(100), 1, "Use 16 Channels (Max 20MHz)", "使用16个通道(最大采样率 20MHz)"},
    {DSL_STREAM25x12,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE,  16, 12, 1, SR_KHZ(10), SR_MHZ(25),
     SR_KHZ(10), SR_MHZ(100), 1, "Use 12 Channels (Max 25MHz)", "使用12个通道(最大采样率 25MHz)"},
    {DSL_STREAM50x6,   LOGIC,  SR_CHANNEL_LOGIC,  TRUE,  16, 6,  1, SR_KHZ(10), SR_MHZ(50),
     SR_KHZ(10), SR_MHZ(100), 1, "Use 6 Channels (Max 50MHz)", "使用6个通道(最大采样率 50MHz)"},
    {DSL_STREAM100x3,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE,  16, 3,  1, SR_KHZ(10), SR_MHZ(100),
     SR_KHZ(10), SR_MHZ(100), 1, "Use 3 Channels (Max 100MHz)", "使用3个通道(最大采样率 100MHz)"},
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457

    {DSL_STREAM20x16_3DN2,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 16, 16, 1, SR_KHZ(10), SR_MHZ(20),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 16 Channels (Max 20MHz)", "使用16个通道(最大采样率 20MHz)"},
    {DSL_STREAM25x12_3DN2,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 16, 12, 1, SR_KHZ(10), SR_MHZ(25),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 12 Channels (Max 25MHz)", "使用12个通道(最大采样率 25MHz)"},
    {DSL_STREAM50x6_3DN2,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 16, 6, 1, SR_KHZ(10), SR_MHZ(50),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 6 Channels (Max 50MHz)", "使用6个通道(最大采样率 50MHz)"},
    {DSL_STREAM100x3_3DN2,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 16, 3, 1, SR_KHZ(10), SR_MHZ(100),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 3 Channels (Max 100MHz)", "使用3个通道(最大采样率 100MHz)"},

    {DSL_STREAM10x32_32_3DN2,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 32, 32, 1, SR_KHZ(10), SR_MHZ(10),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 32 Channels (Max 10MHz)", "使用32个通道(最大采样率 10MHz)"},
    {DSL_STREAM20x16_32_3DN2,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 32, 16, 1, SR_KHZ(10), SR_MHZ(20),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 16 Channels (Max 20MHz)", "使用16个通道(最大采样率 20MHz)"},
    {DSL_STREAM25x12_32_3DN2,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 32, 12, 1, SR_KHZ(10), SR_MHZ(25),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 12 Channels (Max 25MHz)", "使用12个通道(最大采样率 25MHz)"},
    {DSL_STREAM50x6_32_3DN2,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 32, 6, 1, SR_KHZ(10), SR_MHZ(50),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 6 Channels (Max 50MHz)", "使用6个通道(最大采样率 50MHz)"},
    {DSL_STREAM100x3_32_3DN2,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 32, 3, 1, SR_KHZ(10), SR_MHZ(100),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 3 Channels (Max 100MHz)", "使用3个通道(最大采样率 100MHz)"},

    {DSL_STREAM50x32,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 32, 32, 1, SR_KHZ(10), SR_MHZ(50),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 32 Channels (Max 50MHz)", "使用32个通道(最大采样率 50MHz)"},
    {DSL_STREAM100x30,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 32, 30, 1, SR_KHZ(10), SR_MHZ(100),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 30 Channels (Max 100MHz)", "使用30个通道(最大采样率 100MHz)"},
    {DSL_STREAM250x12,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 32, 12, 1, SR_KHZ(10), SR_MHZ(250),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 12 Channels (Max 250MHz)", "使用12个通道(最大采样率 250MHz)"},
    {DSL_STREAM125x16_16,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 16, 16, 1, SR_KHZ(10), SR_MHZ(125),
Andy Dneg's avatar
Andy Dneg committed
458
     SR_KHZ(10), SR_MHZ(500), 5, "Use 16 Channels (Max 125MHz)", "使用16个通道(最大采样率 125MHz)"},
459
    {DSL_STREAM250x12_16,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 16, 12, 1, SR_KHZ(10), SR_MHZ(250),
Andy Dneg's avatar
Andy Dneg committed
460 461 462
     SR_KHZ(10), SR_MHZ(500), 5, "Use 12 Channels (Max 250MHz)", "使用12个通道(最大采样率 250MHz)"},
    {DSL_STREAM500x6,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE,  16, 6,  1, SR_KHZ(10), SR_MHZ(500),
     SR_KHZ(10), SR_MHZ(500), 5, "Use 6 Channels (Max 500MHz)", "使用6个通道(最大采样率 500MHz)"},
463
    {DSL_STREAM1000x3,  LOGIC,  SR_CHANNEL_LOGIC,  TRUE, 8, 3,  1, SR_KHZ(10), SR_GHZ(1),
Andy Dneg's avatar
Andy Dneg committed
464 465 466 467 468 469 470 471 472
     SR_KHZ(10), SR_MHZ(500), 5, "Use 3 Channels (Max 1GHz)", "使用3个通道(最大采样率 1GHz)"},

    // LA Buffer
    {DSL_BUFFER100x16, LOGIC,  SR_CHANNEL_LOGIC,  FALSE, 16, 16, 1, SR_KHZ(10), SR_MHZ(100),
     SR_KHZ(10), SR_MHZ(100), 1, "Use Channels 0~15 (Max 100MHz)", "使用通道 0~15 (最大采样率 100MHz)"},
    {DSL_BUFFER200x8,  LOGIC,  SR_CHANNEL_LOGIC,  FALSE, 8, 8,  1, SR_KHZ(10), SR_MHZ(200),
     SR_KHZ(10), SR_MHZ(100), 1, "Use Channels 0~7 (Max 200MHz)", "使用通道 0~7 (最大采样率 200MHz)"},
    {DSL_BUFFER400x4,  LOGIC,  SR_CHANNEL_LOGIC,  FALSE, 4, 4,  1, SR_KHZ(10), SR_MHZ(400),
     SR_KHZ(10), SR_MHZ(100), 1, "Use Channels 0~3 (Max 400MHz)", "使用通道 0~3 (最大采样率 400MHz)"},
473 474 475

    {DSL_BUFFER250x32,  LOGIC,  SR_CHANNEL_LOGIC,  FALSE, 32, 32,  1, SR_KHZ(10), SR_MHZ(250),
     SR_KHZ(10), SR_MHZ(500), 5, "Use Channels 0~31 (Max 250MHz)", "使用通道 0~31 (最大采样率 250MHz)"},
Andy Dneg's avatar
Andy Dneg committed
476 477 478 479 480 481 482 483
    {DSL_BUFFER500x16,  LOGIC,  SR_CHANNEL_LOGIC,  FALSE, 16, 16,  1, SR_KHZ(10), SR_MHZ(500),
     SR_KHZ(10), SR_MHZ(500), 5, "Use Channels 0~15 (Max 500MHz)", "使用通道 0~15 (最大采样率 500MHz)"},
    {DSL_BUFFER1000x8,  LOGIC,  SR_CHANNEL_LOGIC,  FALSE, 8, 8,  1, SR_KHZ(10), SR_GHZ(1),
     SR_KHZ(10), SR_MHZ(500), 5, "Use Channels 0~7 (Max 1GHz)", "使用通道 0~7 (最大采样率 1GHz)"},

    // DAQ
    {DSL_ANALOG10x2,   ANALOG, SR_CHANNEL_ANALOG, TRUE,  2, 2,  8, SR_HZ(10),  SR_MHZ(10),
     SR_KHZ(10), SR_MHZ(100), 1, "Use Channels 0~1 (Max 10MHz)", "使用通道 0~1 (最大采样率 10MHz)"},
484 485
    {DSL_ANALOG10x2_500,   ANALOG, SR_CHANNEL_ANALOG, TRUE,  2, 2,  8, SR_HZ(10),  SR_MHZ(10),
     SR_KHZ(10), SR_MHZ(500), 1, "Use Channels 0~1 (Max 10MHz)", "使用通道 0~1 (最大采样率 10MHz)"},
Andy Dneg's avatar
Andy Dneg committed
486 487 488 489 490

    // OSC
    {DSL_DSO200x2,     DSO,    SR_CHANNEL_DSO,    FALSE, 2, 2,  8, SR_KHZ(10), SR_MHZ(200),
     SR_KHZ(10), SR_MHZ(100), 1, "Use Channels 0~1 (Max 200MHz)", "使用通道 0~1 (最大采样率 200MHz)"},
    {DSL_DSO1000x2,    DSO,    SR_CHANNEL_DSO,    FALSE, 2, 2,  8, SR_KHZ(10), SR_GHZ(1),
491
     SR_KHZ(10), SR_MHZ(500), 1, "Use Channels 0~1 (Max 1GHz)", "使用通道 0~1 (最大采样率 1GHz)"}
Andy Dneg's avatar
Andy Dneg committed
492 493 494 495 496 497
};

static const struct DSL_profile supported_DSLogic[] = {
    /*
     * DSLogic
     */
498
    {0x2A0E, 0x0001, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSLogic", NULL,
Andy Dneg's avatar
Andy Dneg committed
499 500 501 502 503 504 505 506 507
     "DSLogic.fw",
     "DSLogic33.bin",
     "DSLogic50.bin",
     {CAPS_MODE_LOGIC,
      CAPS_FEATURE_SEEP | CAPS_FEATURE_BUF,
      (1 << DSL_STREAM20x16) | (1 << DSL_STREAM25x12) | (1 << DSL_STREAM50x6) | (1 << DSL_STREAM100x3) |
      (1 << DSL_BUFFER100x16) | (1 << DSL_BUFFER200x8) | (1 << DSL_BUFFER400x4) |
      (1 << DSL_ANALOG10x2) |
      (1 << DSL_DSO200x2),
508
      16,
Andy Dneg's avatar
Andy Dneg committed
509 510 511 512 513 514 515 516 517 518 519 520 521
      SR_MB(256),
      SR_Mn(2),
      DSL_BUFFER100x16,
      vdivs10to2000,
      samplerates400,
      0,
      DSL_STREAM20x16,
      SR_MHZ(1),
      SR_Mn(1),
      0,
      0,
      0,
      0,
522 523 524
      0,
      SR_MHZ(200),
      SR_MHZ(400)}
Andy Dneg's avatar
Andy Dneg committed
525 526
    },

527
    {0x2A0E, 0x0003, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSLogic Pro", NULL,
Andy Dneg's avatar
Andy Dneg committed
528 529 530 531 532 533 534
     "DSLogicPro.fw",
     "DSLogicPro.bin",
     "DSLogicPro.bin",
     {CAPS_MODE_LOGIC,
      CAPS_FEATURE_SEEP | CAPS_FEATURE_VTH | CAPS_FEATURE_BUF,
      (1 << DSL_STREAM20x16) | (1 << DSL_STREAM25x12) | (1 << DSL_STREAM50x6) | (1 << DSL_STREAM100x3) |
      (1 << DSL_BUFFER100x16) | (1 << DSL_BUFFER200x8) | (1 << DSL_BUFFER400x4),
535
      16,
Andy Dneg's avatar
Andy Dneg committed
536 537 538 539 540 541 542 543 544 545 546 547 548
      SR_MB(256),
      0,
      DSL_BUFFER100x16,
      0,
      samplerates400,
      0,
      DSL_STREAM20x16,
      SR_MHZ(1),
      SR_Mn(1),
      0,
      0,
      0,
      0,
549 550 551
      0,
      SR_MHZ(200),
      SR_MHZ(400)}
Andy Dneg's avatar
Andy Dneg committed
552 553
    },

554
    {0x2A0E, 0x0020, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSLogic PLus", NULL,
Andy Dneg's avatar
Andy Dneg committed
555 556 557 558 559 560 561
     "DSLogicPlus.fw",
     "DSLogicPlus.bin",
     "DSLogicPlus.bin",
     {CAPS_MODE_LOGIC,
      CAPS_FEATURE_VTH | CAPS_FEATURE_BUF,
      (1 << DSL_STREAM20x16) | (1 << DSL_STREAM25x12) | (1 << DSL_STREAM50x6) | (1 << DSL_STREAM100x3) |
      (1 << DSL_BUFFER100x16) | (1 << DSL_BUFFER200x8) | (1 << DSL_BUFFER400x4),
562
      16,
Andy Dneg's avatar
Andy Dneg committed
563 564 565 566 567 568 569 570 571 572 573 574 575
      SR_MB(256),
      0,
      DSL_BUFFER100x16,
      0,
      samplerates400,
      0,
      DSL_STREAM20x16,
      SR_MHZ(1),
      SR_Mn(1),
      0,
      0,
      0,
      0,
576 577 578
      0,
      SR_MHZ(200),
      SR_MHZ(400)}
Andy Dneg's avatar
Andy Dneg committed
579 580
    },

581
    {0x2A0E, 0x0021, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSLogic Basic", NULL,
Andy Dneg's avatar
Andy Dneg committed
582 583 584 585 586 587 588
     "DSLogicBasic.fw",
     "DSLogicBasic.bin",
     "DSLogicBasic.bin",
     {CAPS_MODE_LOGIC,
      CAPS_FEATURE_VTH,
      (1 << DSL_STREAM20x16) | (1 << DSL_STREAM25x12) | (1 << DSL_STREAM50x6) | (1 << DSL_STREAM100x3) |
      (1 << DSL_BUFFER100x16) | (1 << DSL_BUFFER200x8) | (1 << DSL_BUFFER400x4),
589
      16,
Andy Dneg's avatar
Andy Dneg committed
590 591 592 593 594 595 596 597 598 599 600 601 602
      SR_KB(256),
      0,
      DSL_STREAM20x16,
      0,
      samplerates400,
      0,
      DSL_STREAM20x16,
      SR_MHZ(1),
      SR_Mn(1),
      0,
      0,
      0,
      0,
603 604 605
      0,
      SR_MHZ(200),
      SR_MHZ(400)}
Andy Dneg's avatar
Andy Dneg committed
606 607
    },

608
    {0x2A0E, 0x0029, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSLogic U2Basic", NULL,
Andy Dneg's avatar
Andy Dneg committed
609 610 611 612
     "DSLogicU2Basic.fw",
     "DSLogicU2Basic.bin",
     "DSLogicU2Basic.bin",
     {CAPS_MODE_LOGIC,
613
      CAPS_FEATURE_VTH | CAPS_FEATURE_BUF,
Andy Dneg's avatar
Andy Dneg committed
614 615
      (1 << DSL_STREAM20x16) | (1 << DSL_STREAM25x12) | (1 << DSL_STREAM50x6) | (1 << DSL_STREAM100x3) |
      (1 << DSL_BUFFER100x16),
616
      16,
Andy Dneg's avatar
Andy Dneg committed
617 618
      SR_MB(64),
      0,
619
      DSL_BUFFER100x16,
Andy Dneg's avatar
Andy Dneg committed
620 621 622 623 624 625 626 627 628 629
      0,
      samplerates100,
      0,
      DSL_STREAM20x16,
      SR_MHZ(1),
      SR_Mn(1),
      0,
      0,
      0,
      0,
630 631 632
      0,
      SR_MHZ(200),
      SR_MHZ(400)}
Andy Dneg's avatar
Andy Dneg committed
633 634
    },

635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742
    {0x2A0E, 0x002A, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSLogic U3Pro16", NULL,
     "DSLogicU3Pro16.fw",
     "DSLogicU3Pro16.bin",
     "DSLogicU3Pro16.bin",
     {CAPS_MODE_LOGIC,
      CAPS_FEATURE_VTH | CAPS_FEATURE_BUF | CAPS_FEATURE_USB30  | CAPS_FEATURE_ADF4360,
      (1 << DSL_STREAM20x16_3DN2) | (1 << DSL_STREAM25x12_3DN2) | (1 << DSL_STREAM50x6_3DN2) | (1 << DSL_STREAM100x3_3DN2) |
      (1 << DSL_BUFFER500x16) | (1 << DSL_BUFFER1000x8),
      16,
      SR_GB(2),
      0,
      DSL_BUFFER500x16,
      0,
      samplerates1000,
      0,
      DSL_STREAM20x16_3DN2,
      SR_MHZ(1),
      SR_Mn(1),
      0,
      0,
      0,
      0,
      0,
      SR_MHZ(500),
      SR_GHZ(1)}
    },

    {0x2A0E, 0x002A, LIBUSB_SPEED_SUPER, "DreamSourceLab", "DSLogic U3Pro16", NULL,
     "DSLogicU3Pro16.fw",
     "DSLogicU3Pro16.bin",
     "DSLogicU3Pro16.bin",
     {CAPS_MODE_LOGIC,
      CAPS_FEATURE_VTH | CAPS_FEATURE_BUF | CAPS_FEATURE_USB30 | CAPS_FEATURE_ADF4360,
      (1 << DSL_STREAM125x16_16) | (1 << DSL_STREAM250x12_16) | (1 << DSL_STREAM500x6) | (1 << DSL_STREAM1000x3) |
      (1 << DSL_BUFFER500x16) | (1 << DSL_BUFFER1000x8),
      16,
      SR_GB(2),
      0,
      DSL_BUFFER500x16,
      0,
      samplerates1000,
      0,
      DSL_STREAM125x16_16,
      SR_MHZ(1),
      SR_Mn(1),
      0,
      0,
      0,
      0,
      0,
      SR_MHZ(500),
      SR_GHZ(1)}
    },

    {0x2A0E, 0x002C, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSLogic U3Pro32", NULL,
     "DSLogicU3Pro32.fw",
     "DSLogicU3Pro32.bin",
     "DSLogicU3Pro32.bin",
     {CAPS_MODE_LOGIC,
      CAPS_FEATURE_VTH | CAPS_FEATURE_BUF | CAPS_FEATURE_USB30  | CAPS_FEATURE_ADF4360 | CAPS_FEATURE_LA_CH32,
      (1 << DSL_STREAM10x32_32_3DN2) | (1 << DSL_STREAM20x16_32_3DN2) | (1 << DSL_STREAM25x12_32_3DN2) | (1 << DSL_STREAM50x6_32_3DN2) | (1 << DSL_STREAM100x3_32_3DN2) |
      (1 << DSL_BUFFER500x16) | (1 << DSL_BUFFER1000x8),
      32,
      SR_GB(2),
      0,
      DSL_BUFFER250x32,
      0,
      samplerates1000,
      0,
      DSL_STREAM10x32_32_3DN2,
      SR_MHZ(1),
      SR_Mn(1),
      0,
      0,
      0,
      0,
      0,
      SR_MHZ(500),
      SR_GHZ(1)}
    },

    {0x2A0E, 0x002C, LIBUSB_SPEED_SUPER, "DreamSourceLab", "DSLogic U3Pro32", NULL,
     "DSLogicU3Pro32.fw",
     "DSLogicU3Pro32.bin",
     "DSLogicU3Pro32.bin",
     {CAPS_MODE_LOGIC,
      CAPS_FEATURE_VTH | CAPS_FEATURE_BUF | CAPS_FEATURE_USB30 | CAPS_FEATURE_ADF4360 | CAPS_FEATURE_LA_CH32,
      (1 << DSL_STREAM50x32) | (1 << DSL_STREAM100x30) | (1 << DSL_STREAM250x12) | (1 << DSL_STREAM500x6) | (1 << DSL_STREAM1000x3) |
      (1 << DSL_BUFFER250x32) | (1 << DSL_BUFFER500x16) | (1 << DSL_BUFFER1000x8),
      32,
      SR_GB(2),
      0,
      DSL_BUFFER250x32,
      0,
      samplerates1000,
      0,
      DSL_STREAM50x32,
      SR_MHZ(1),
      SR_Mn(1),
      0,
      0,
      0,
      0,
      0,
      SR_MHZ(500),
      SR_GHZ(1)}
    },

743
    { 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
Andy Dneg's avatar
Andy Dneg committed
744 745 746 747 748 749
};

static const struct DSL_profile supported_DSCope[] = {
    /*
     * DSCope
     */
750
    {0x2A0E, 0x0002, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSCope", NULL,
Andy Dneg's avatar
Andy Dneg committed
751 752 753 754 755 756 757
     "DSCope.fw",
     "DSCope.bin",
     "DSCope.bin",
     {CAPS_MODE_ANALOG | CAPS_MODE_DSO,
      CAPS_FEATURE_ZERO | CAPS_FEATURE_PREOFF | CAPS_FEATURE_SEEP | CAPS_FEATURE_BUF,
      (1 << DSL_ANALOG10x2) |
      (1 << DSL_DSO200x2),
758
      2,
Andy Dneg's avatar
Andy Dneg committed
759 760 761 762 763 764 765 766 767 768 769 770 771
      SR_MB(256),
      SR_Mn(2),
      0,
      vdivs10to2000,
      samplerates400,
      1,
      DSL_DSO200x2,
      SR_MHZ(100),
      SR_Mn(1),
      (129<<8)+167,
      1024-920,
      1,
      255,
772 773 774
      0,
      SR_HZ(0),
      SR_HZ(0)}
Andy Dneg's avatar
Andy Dneg committed
775 776
    },

777
    {0x2A0E, 0x0004, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSCope20", NULL,
Andy Dneg's avatar
Andy Dneg committed
778 779 780 781 782 783 784
     "DSCope20.fw",
     "DSCope20.bin",
     "DSCope20.bin",
     {CAPS_MODE_ANALOG | CAPS_MODE_DSO,
      CAPS_FEATURE_ZERO | CAPS_FEATURE_SEEP | CAPS_FEATURE_BUF,
      (1 << DSL_ANALOG10x2) |
      (1 << DSL_DSO200x2),
785
      2,
Andy Dneg's avatar
Andy Dneg committed
786 787 788 789 790 791 792 793 794 795 796 797 798
      SR_MB(256),
      SR_Mn(2),
      0,
      vdivs10to2000,
      samplerates400,
      2,
      DSL_DSO200x2,
      SR_MHZ(100),
      SR_Mn(1),
      920,
      1024-920,
      1,
      255,
799 800 801
      0,
      SR_HZ(0),
      SR_HZ(0)}
Andy Dneg's avatar
Andy Dneg committed
802 803
    },

804
    {0x2A0E, 0x0022, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSCope B20", NULL,
Andy Dneg's avatar
Andy Dneg committed
805 806 807 808 809 810 811
     "DSCopeB20.fw",
     "DSCope20.bin",
     "DSCope20.bin",
     {CAPS_MODE_ANALOG | CAPS_MODE_DSO,
      CAPS_FEATURE_ZERO | CAPS_FEATURE_BUF,
      (1 << DSL_ANALOG10x2) |
      (1 << DSL_DSO200x2),
812
      2,
Andy Dneg's avatar
Andy Dneg committed
813 814 815 816 817 818 819 820 821 822 823 824 825
      SR_MB(256),
      SR_Mn(2),
      0,
      vdivs10to2000,
      samplerates400,
      2,
      DSL_DSO200x2,
      SR_MHZ(100),
      SR_Mn(1),
      920,
      1024-920,
      1,
      255,
826 827 828
      0,
      SR_HZ(0),
      SR_HZ(0)}
Andy Dneg's avatar
Andy Dneg committed
829 830
    },

831
    {0x2A0E, 0x0023, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSCope C20", NULL,
Andy Dneg's avatar
Andy Dneg committed
832 833 834 835 836 837 838
     "DSCopeC20.fw",
     "DSCopeC20P.bin",
     "DSCopeC20P.bin",
     {CAPS_MODE_ANALOG | CAPS_MODE_DSO,
      CAPS_FEATURE_ZERO | CAPS_FEATURE_BUF,
      (1 << DSL_ANALOG10x2) |
      (1 << DSL_DSO200x2),
839
      2,
Andy Dneg's avatar
Andy Dneg committed
840 841 842 843 844 845 846 847 848 849 850 851 852
      SR_MB(256),
      SR_Mn(2),
      0,
      vdivs10to2000,
      samplerates400,
      3,
      DSL_DSO200x2,
      SR_MHZ(100),
      SR_Mn(1),
      920,
      1024-920,
      1,
      255,
853 854 855
      0,
      SR_HZ(0),
      SR_HZ(0)}
Andy Dneg's avatar
Andy Dneg committed
856 857 858
    },


859
    {0x2A0E, 0x0024, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSCope C20P", NULL,
Andy Dneg's avatar
Andy Dneg committed
860 861 862 863 864 865 866
     "DSCopeC20P.fw",
     "DSCopeC20P.bin",
     "DSCopeC20P.bin",
     {CAPS_MODE_ANALOG | CAPS_MODE_DSO,
      CAPS_FEATURE_ZERO | CAPS_FEATURE_BUF | CAPS_FEATURE_POGOPIN,
      (1 << DSL_ANALOG10x2) |
      (1 << DSL_DSO200x2),
867
      2,
Andy Dneg's avatar
Andy Dneg committed
868 869 870 871 872 873 874 875 876 877 878 879 880
      SR_MB(256),
      SR_Mn(2),
      0,
      vdivs10to2000,
      samplerates400,
      3,
      DSL_DSO200x2,
      SR_MHZ(100),
      SR_Mn(1),
      920,
      1024-920,
      1,
      255,
881 882 883
      0,
      SR_HZ(0),
      SR_HZ(0)}
Andy Dneg's avatar
Andy Dneg committed
884 885
    },

886
    {0x2A0E, 0x0025, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSCope C20", NULL,
Andy Dneg's avatar
Andy Dneg committed
887 888 889 890 891 892 893
     "DSCopeC20B.fw",
     "DSCopeC20B.bin",
     "DSCopeC20B.bin",
     {CAPS_MODE_ANALOG | CAPS_MODE_DSO,
      CAPS_FEATURE_ZERO,
      (1 << DSL_ANALOG10x2) |
      (1 << DSL_DSO200x2),
894
      2,
Andy Dneg's avatar
Andy Dneg committed
895 896 897 898 899 900 901 902 903 904 905 906 907
      SR_KB(256),
      SR_Kn(20),
      0,
      vdivs10to2000,
      samplerates400,
      3,
      DSL_DSO200x2,
      SR_MHZ(100),
      SR_Kn(10),
      920,
      1024-920,
      1,
      255,
908 909 910
      0,
      SR_HZ(0),
      SR_HZ(0)}
Andy Dneg's avatar
Andy Dneg committed
911 912
    },

913
    {0x2A0E, 0x0026, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSCope U2B20", NULL,
Andy Dneg's avatar
Andy Dneg committed
914 915 916 917
     "DSCopeU2B20.fw",
     "DSCopeU2B20.bin",
     "DSCopeU2B20.bin",
     {CAPS_MODE_ANALOG | CAPS_MODE_DSO,
918
      CAPS_FEATURE_ZERO | CAPS_FEATURE_AUTO_VGAIN,
Andy Dneg's avatar
Andy Dneg committed
919 920
      (1 << DSL_ANALOG10x2) |
      (1 << DSL_DSO200x2),
921
      2,
Andy Dneg's avatar
Andy Dneg committed
922 923 924 925 926 927 928 929 930
      SR_KB(256),
      SR_Kn(20),
      0,
      vdivs10to2000,
      samplerates400,
      4,
      DSL_DSO200x2,
      SR_MHZ(100),
      SR_Kn(10),
931 932
      930,
      1024-930,
Andy Dneg's avatar
Andy Dneg committed
933 934
      10,
      245,
935 936 937
      22,
      SR_HZ(0),
      SR_HZ(0)}
Andy Dneg's avatar
Andy Dneg committed
938 939
    },

940
    {0x2A0E, 0x0027, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSCope U2P20", NULL,
Andy Dneg's avatar
Andy Dneg committed
941 942 943 944
     "DSCopeU2P20.fw",
     "DSCopeU2P20.bin",
     "DSCopeU2P20.bin",
     {CAPS_MODE_ANALOG | CAPS_MODE_DSO,
945
      CAPS_FEATURE_ZERO | CAPS_FEATURE_BUF | CAPS_FEATURE_POGOPIN | CAPS_FEATURE_AUTO_VGAIN,
Andy Dneg's avatar
Andy Dneg committed
946 947
      (1 << DSL_ANALOG10x2) |
      (1 << DSL_DSO200x2),
948
      2,
Andy Dneg's avatar
Andy Dneg committed
949 950 951 952 953 954 955 956 957
      SR_MB(256),
      SR_Mn(2),
      0,
      vdivs10to2000,
      samplerates400,
      4,
      DSL_DSO200x2,
      SR_MHZ(100),
      SR_Mn(1),
958 959
      930,
      1024-930,
Andy Dneg's avatar
Andy Dneg committed
960 961
      10,
      245,
962 963 964
      22,
      SR_HZ(0),
      SR_HZ(0)}
Andy Dneg's avatar
Andy Dneg committed
965 966
    },

967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046
    {0x2A0E, 0x0028, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSCope U2B100", NULL,
     "DSCopeU2B100.fw",
     "DSCopeU2B100.bin",
     "DSCopeU2B100.bin",
     {CAPS_MODE_ANALOG | CAPS_MODE_DSO,
      CAPS_FEATURE_ZERO | CAPS_FEATURE_HMCAD1511 | CAPS_FEATURE_20M,
      (1 << DSL_ANALOG10x2_500) |
      (1 << DSL_DSO1000x2),
      2,
      SR_KB(256),
      SR_Kn(20),
      0,
      vdivs10to2000,
      samplerates1000,
      4,
      DSL_DSO1000x2,
      SR_MHZ(500),
      SR_Kn(10),
      850,
      1024-850,
      10,
      245,
      80,
      SR_HZ(0),
      SR_HZ(0)}
    },

    {0x2A0E, 0x002B, LIBUSB_SPEED_HIGH, "DreamSourceLab", "DSCope U3P100", NULL,
     "DSCopeU3P100.fw",
     "DSCopeU3P100.bin",
     "DSCopeU3P100.bin",
     {CAPS_MODE_ANALOG | CAPS_MODE_DSO,
      CAPS_FEATURE_ZERO | CAPS_FEATURE_FLASH | CAPS_FEATURE_USB30 | CAPS_FEATURE_HMCAD1511 | CAPS_FEATURE_20M,
      (1 << DSL_ANALOG10x2_500) |
      (1 << DSL_DSO1000x2),
      2,
      SR_GB(2),
      SR_Mn(2),
      0,
      vdivs10to2000,
      samplerates1000,
      4,
      DSL_DSO1000x2,
      SR_MHZ(500),
      SR_Mn(1),
      900,
      1024-900,
      10,
      245,
      60,
      SR_HZ(0),
      SR_HZ(0)}
    },

    {0x2A0E, 0x002B, LIBUSB_SPEED_SUPER, "DreamSourceLab", "DSCope U3P100", NULL,
     "DSCopeU3P100.fw",
     "DSCopeU3P100.bin",
     "DSCopeU3P100.bin",
     {CAPS_MODE_ANALOG | CAPS_MODE_DSO,
      CAPS_FEATURE_ZERO | CAPS_FEATURE_FLASH | CAPS_FEATURE_USB30 | CAPS_FEATURE_HMCAD1511 | CAPS_FEATURE_20M,
      (1 << DSL_ANALOG10x2_500) |
      (1 << DSL_DSO1000x2),
      2,
      SR_GB(2),
      SR_Mn(2),
      0,
      vdivs10to2000,
      samplerates1000,
      4,
      DSL_DSO1000x2,
      SR_MHZ(500),
      SR_Mn(1),
      900,
      1024-900,
      10,
      245,
      60,
      SR_HZ(0),
      SR_HZ(0)}
    },
Andy Dneg's avatar
Andy Dneg committed
1047

1048
    { 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
Andy Dneg's avatar
Andy Dneg committed
1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124
};

static const gboolean default_ms_en[] = {
    FALSE, /* DSO_MS_BEGIN */
    TRUE,  /* DSO_MS_FREQ */
    FALSE, /* DSO_MS_PERD */
    TRUE,  /* DSO_MS_VMAX */
    TRUE,  /* DSO_MS_VMIN */
    FALSE, /* DSO_MS_VRMS */
    FALSE, /* DSO_MS_VMEA */
    FALSE, /* DSO_MS_VP2P */
};

enum {
    DSL_ERROR = -1,
    DSL_INIT = 0,
    DSL_START = 1,
    DSL_READY = 2,
    DSL_TRIGGERED = 3,
    DSL_DATA = 4,
    DSL_STOP = 5,
    DSL_FINISH = 7,
    DSL_ABORT = 8,
};

struct DSL_context {
    const struct DSL_profile *profile;
	/*
     * Since we can't keep track of an DSL device after upgrading
	 * the firmware (it renumerates into a different device address
	 * after the upgrade) this is like a global lock. No device will open
	 * until a proper delay after the last device was upgraded.
	 */
	int64_t fw_updated;

	/* Device/capture settings */
	uint64_t cur_samplerate;
	uint64_t limit_samples;
    uint64_t actual_samples;
    uint64_t actual_bytes;

	/* Operational settings */
    gboolean clock_type;
    gboolean clock_edge;
    gboolean rle_mode;
    gboolean rle_support;
    gboolean instant;
    uint16_t op_mode;
    gboolean stream;
    uint8_t  test_mode;
    uint16_t buf_options;
    enum CHANNEL_ID ch_mode;
    uint16_t samplerates_min_index;
    uint16_t samplerates_max_index;
    uint16_t th_level;
    double vth;
    uint16_t filter;
	uint16_t trigger_mask[NUM_TRIGGER_STAGES];
	uint16_t trigger_value[NUM_TRIGGER_STAGES];
	int trigger_stage;
	uint16_t trigger_buffer[NUM_TRIGGER_STAGES];
    uint64_t timebase;
    uint8_t max_height;
    uint8_t trigger_channel;
    uint8_t trigger_slope;
    uint8_t trigger_source;
    uint8_t trigger_hrate;
    uint32_t trigger_hpos;
    uint64_t trigger_holdoff;
    uint8_t trigger_margin;
    gboolean zero;
    gboolean cali;
    gboolean tune;
    int16_t tune_index;
    int zero_stage;
    int zero_pcnt;
1125 1126 1127
    gboolean zero_branch;
    gboolean zero_comb_fgain;
    gboolean zero_comb;
Andy Dneg's avatar
Andy Dneg committed
1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155
    int tune_stage;
    int tune_pcnt;
    struct sr_channel *tune_probe;
    gboolean roll;
    gboolean data_lock;
    uint16_t unit_pitch;

    uint64_t num_samples;
    uint64_t num_bytes;
	int submitted_transfers;
	int empty_transfer_count;
    int instant_tail_bytes;

	void *cb_data;
	unsigned int num_transfers;
	struct libusb_transfer **transfers;
	int *usbfd;

    int pipe_fds[2];
    GIOChannel *channel;

    int status;
    int trf_completed;
    gboolean mstatus_valid;
    struct sr_status mstatus;
    gboolean abort;
    gboolean overflow;
    int bw_limit;
1156
    int empty_poll_count;
Andy Dneg's avatar
Andy Dneg committed
1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179

    int language;
};

/*
 * hardware setting for each capture
 */
struct DSL_setting {
    uint32_t sync;

    uint16_t mode_header;                   // 0
    uint16_t mode;
    uint16_t divider_header;                // 1-2
    uint16_t div_l;
    uint16_t div_h;
    uint16_t count_header;                  // 3-4
    uint16_t cnt_l;
    uint16_t cnt_h;
    uint16_t trig_pos_header;               // 5-6
    uint16_t tpos_l;
    uint16_t tpos_h;
    uint16_t trig_glb_header;               // 7
    uint16_t trig_glb;
1180
    uint16_t dso_count_header;              // 8-9
Andy Dneg's avatar
Andy Dneg committed
1181 1182
    uint16_t dso_cnt_l;
    uint16_t dso_cnt_h;
1183 1184 1185 1186 1187
    uint16_t ch_en_header;                  // 10-11
    uint16_t ch_en_l;
    uint16_t ch_en_h;
    uint16_t fgain_header;                  // 12
    uint16_t fgain;
Andy Dneg's avatar
Andy Dneg committed
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202

    uint16_t trig_header;                   // 64
    uint16_t trig_mask0[NUM_TRIGGER_STAGES];
    uint16_t trig_mask1[NUM_TRIGGER_STAGES];
    uint16_t trig_value0[NUM_TRIGGER_STAGES];
    uint16_t trig_value1[NUM_TRIGGER_STAGES];
    uint16_t trig_edge0[NUM_TRIGGER_STAGES];
    uint16_t trig_edge1[NUM_TRIGGER_STAGES];
    uint16_t trig_logic0[NUM_TRIGGER_STAGES];
    uint16_t trig_logic1[NUM_TRIGGER_STAGES];
    uint32_t trig_count[NUM_TRIGGER_STAGES];

    uint32_t end_sync;
};

1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217
struct DSL_setting_ext32 {
    uint32_t sync;

    uint16_t trig_header;                   // 96
    uint16_t trig_mask0[NUM_TRIGGER_STAGES];
    uint16_t trig_mask1[NUM_TRIGGER_STAGES];
    uint16_t trig_value0[NUM_TRIGGER_STAGES];
    uint16_t trig_value1[NUM_TRIGGER_STAGES];
    uint16_t trig_edge0[NUM_TRIGGER_STAGES];
    uint16_t trig_edge1[NUM_TRIGGER_STAGES];

    uint16_t align_bytes;
    uint32_t end_sync;
};

Andy Dneg's avatar
Andy Dneg committed
1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333
struct DSL_adc_config {
    uint8_t dest;
    uint8_t cnt;
    uint8_t delay;
    uint8_t byte[4];
};
static const struct DSL_adc_config adc_single_ch0[] = {
    {ADCC_ADDR+1, 3,   0,   {0x03, 0x01, 0x00, 0x00}}, // reset & power down
    {ADCC_ADDR,   4,   0,   {0x00, 0x01, 0x00, 0x31}}, // 1x channel 1/1 clock
    {ADCC_ADDR+1, 1,   0,   {0x01, 0x00, 0x00, 0x00}}, // power up
    {ADCC_ADDR,   4,   0,   {0x00, 0x02, 0x02, 0x3A}}, // adc0: ch0 adc1: ch0
    {ADCC_ADDR,   4,   0,   {0x00, 0x02, 0x02, 0x3B}}, // adc2: ch0 adc3: ch0
    {ADCC_ADDR,   4,   0,   {0x00, 0x00, 0x00, 0x42}}, // phase_ddr: 270 deg
    {ADCC_ADDR,   4,   0,   {0x00, 0x34, 0x00, 0x50}}, // adc core current: -40% (lower performance) / VCM: +-700uA
    {ADCC_ADDR,   4,   0,   {0x00, 0x22, 0x02, 0x11}}, // lvds drive strength: 1.5mA(RSDS)
    {ADCC_ADDR,   4,   0,   {0x00, 0x7F, 0x00, 0x24}}, // invert all channel
    {ADCC_ADDR,   4,   0,   {0x00, 0x00, 0x00, 0x55}}, // full-scale range: -10%
    {ADCC_ADDR,   4,   0,   {0x00, 0x02, 0x00, 0x33}}, // x-gain disabled / fine-gain enabled
    {ADCC_ADDR,   4,   0,   {0x00, 0x00, 0x03, 0x2B}}, // coarse_gain: 3dB(1.4125x)
    {0, 0, 0, {0, 0, 0, 0}}
};
static const struct DSL_adc_config adc_single_ch3[] = {
    {ADCC_ADDR+1, 3,   0,   {0x03, 0x01, 0x00, 0x00}}, // reset & power down
    {ADCC_ADDR,   4,   0,   {0x00, 0x01, 0x00, 0x31}}, // 1x channel 1/1 clock
    {ADCC_ADDR+1, 1,   0,   {0x01, 0x00, 0x00, 0x00}}, // power up
    {ADCC_ADDR,   4,   0,   {0x00, 0x10, 0x10, 0x3A}}, // adc0: ch3 adc1: ch3
    {ADCC_ADDR,   4,   0,   {0x00, 0x10, 0x10, 0x3B}}, // adc2: ch3 adc3: ch3
    {ADCC_ADDR,   4,   0,   {0x00, 0x00, 0x00, 0x42}}, // phase_ddr: 270 deg
    {ADCC_ADDR,   4,   0,   {0x00, 0x34, 0x00, 0x50}}, // adc core current: -40% (lower performance) / VCM: +-700uA
    {ADCC_ADDR,   4,   0,   {0x00, 0x22, 0x02, 0x11}}, // lvds drive strength: 1.5mA(RSDS)
    {ADCC_ADDR,   4,   0,   {0x00, 0x00, 0x00, 0x24}}, // invert none channel
    {ADCC_ADDR,   4,   0,   {0x00, 0x00, 0x00, 0x55}}, // full-scale range: -10%
    {ADCC_ADDR,   4,   0,   {0x00, 0x02, 0x00, 0x33}}, // x-gain disabled / fine-gain enabled
    {ADCC_ADDR,   4,   0,   {0x00, 0x00, 0x03, 0x2B}}, // coarse_gain: 3dB(1.4125x)
    {0, 0, 0, {0, 0, 0, 0}}
};
static const struct DSL_adc_config adc_dual_ch03[] = {
    {ADCC_ADDR+1, 3,   0,   {0x03, 0x01, 0x00, 0x00}}, // reset & power down
    {ADCC_ADDR,   4,   0,   {0x00, 0x02, 0x01, 0x31}}, // 2x channel 1/2 clock
    {ADCC_ADDR+1, 1,   0,   {0x01, 0x00, 0x00, 0x00}}, // power up
    {ADCC_ADDR,   4,   0,   {0x00, 0x02, 0x02, 0x3A}}, // adc0: ch0 adc1: ch0
    {ADCC_ADDR,   4,   0,   {0x00, 0x10, 0x10, 0x3B}}, // adc2: ch3 adc3: ch3
    {ADCC_ADDR,   4,   0,   {0x00, 0x00, 0x00, 0x42}}, // phase_ddr: 270 deg
    {ADCC_ADDR,   4,   0,   {0x00, 0x34, 0x00, 0x50}}, // adc core current: -40% (lower performance) / VCM: +-700uA
    {ADCC_ADDR,   4,   0,   {0x00, 0x22, 0x02, 0x11}}, // lvds drive strength: 1.5mA(RSDS)
    {ADCC_ADDR,   4,   0,   {0x00, 0x11, 0x00, 0x24}}, // invert 0 channel
    {ADCC_ADDR,   4,   0,   {0x00, 0x00, 0x00, 0x55}}, // full-scale range: -10%
    {ADCC_ADDR,   4,   0,   {0x00, 0x02, 0x00, 0x33}}, // x-gain disabled / fine-gain enabled
    {ADCC_ADDR,   4,   0,   {0x00, 0x33, 0x00, 0x2B}}, // coarse_gain: 3dB(1.4125x)
//    {ADCC_ADDR,   4,   0,   {0x00, 0x03, 0x00, 0x33}}, // x-gain enabled / fine-gain enabled
//    {ADCC_ADDR,   4,   0,   {0x00, 0x11, 0x00, 0x2B}}, // coarse_gain: 1.25x
    //{ADCC_ADDR,   4,   0,   {0x00, 0x40, 0x00, 0x34}}, // fine_gain: 1.0077x
    //{ADCC_ADDR,   4,   0,   {0x00, 0x00, 0x60, 0x35}}, // fine_gain: 1.0077x
    //{ADCC_ADDR,   4,   0,   {0x00, 0x10, 0x00, 0x25}}, // fix pattern test
    //{ADCC_ADDR,   4,   0,   {0x00, 0x00, 0xab, 0x26}}, // test pattern
    {0, 0, 0, {0, 0, 0, 0}}
};
static const struct DSL_adc_config adc_init_fix[] = {
    {ADCC_ADDR+1, 3,   0,   {0x03, 0x01, 0x00, 0x00}}, // reset & power down
    {ADCC_ADDR,   4,   0,   {0x00, 0x02, 0x01, 0x31}}, // 2x channel 1/2 clock
    {ADCC_ADDR+1, 1,   0,   {0x01, 0x00, 0x00, 0x00}}, // power up
    {ADCC_ADDR,   4,   0,   {0x00, 0x02, 0x02, 0x3A}}, // adc0: ch0 adc1: ch0
    {ADCC_ADDR,   4,   0,   {0x00, 0x10, 0x10, 0x3B}}, // adc2: ch3 adc3: ch3
    {ADCC_ADDR,   4,   0,   {0x00, 0x00, 0x00, 0x42}}, // phase_ddr: 270 deg
    {ADCC_ADDR,   4,   0,   {0x00, 0x34, 0x00, 0x50}}, // adc core current: -40% (lower performance) / VCM: +-700uA
    {ADCC_ADDR,   4,   0,   {0x00, 0x22, 0x02, 0x11}}, // lvds drive strength: 1.5mA(RSDS)
    {ADCC_ADDR,   4,   0,   {0x00, 0x10, 0x00, 0x25}}, // fix pattern test
    {ADCC_ADDR,   4,   0,   {0x00, 0x00, 0x55, 0x26}}, // test pattern
    {0, 0, 0, {0, 0, 0, 0}}
};
static const struct DSL_adc_config adc_clk_init_1g[] = {
    {ADCC_ADDR+2, 1,   0,   {0x01, 0x00, 0x00, 0x00}}, // power up
    {ADCC_ADDR,   4,   0,   {0x01, 0x61, 0x00, 0x30}}, //
    {ADCC_ADDR,   4,   0,   {0x01, 0x40, 0xF1, 0x46}}, //
    {ADCC_ADDR,   4,   10,  {0x01, 0x62, 0x3D, 0x00}}, //
    {0, 0, 0, {0, 0, 0, 0}}
};
static const struct DSL_adc_config adc_clk_init_500m[] = {
    {ADCC_ADDR+2, 1,   0,   {0x01, 0x00, 0x00, 0x00}}, // power up
    {ADCC_ADDR,   4,   0,   {0x01, 0x61, 0x00, 0x30}}, //
    {ADCC_ADDR,   4,   0,   {0x01, 0x40, 0xF1, 0x46}}, //
    {ADCC_ADDR,   4,   10,  {0x01, 0x62, 0x3D, 0x40}}, //
    {0, 0, 0, {0, 0, 0, 0}}
};
static const struct DSL_adc_config adc_power_down[] = {
    //{ADCC_ADDR+2, 1,   0,   {0x00, 0x00, 0x00, 0x00}}, // ADC_CLK power down
    {ADCC_ADDR+1, 1,   0,   {0x00, 0x00, 0x00, 0x00}}, // ADC power down
    {0, 0, 0, {0, 0, 0, 0}}
};
static const struct DSL_adc_config adc_power_up[] = {
    {ADCC_ADDR+1, 1,   0,   {0x01, 0x00, 0x00, 0x00}}, // ADC power up
    //{ADCC_ADDR+2, 1,   0,   {0x01, 0x00, 0x00, 0x00}}, // ADC_CLK power up
    {0, 0, 0, {0, 0, 0, 0}}
};

SR_PRIV int dsl_adjust_probes(struct sr_dev_inst *sdi, int num_probes);
SR_PRIV int dsl_setup_probes(struct sr_dev_inst *sdi, int num_probes);
SR_PRIV const GSList *dsl_mode_list(const struct sr_dev_inst *sdi);
SR_PRIV void dsl_adjust_samplerate(struct DSL_context *devc);

SR_PRIV int dsl_en_ch_num(const struct sr_dev_inst *sdi);
SR_PRIV gboolean dsl_check_conf_profile(libusb_device *dev);
SR_PRIV int dsl_configure_probes(const struct sr_dev_inst *sdi);
SR_PRIV uint64_t dsl_channel_depth(const struct sr_dev_inst *sdi);

SR_PRIV int dsl_wr_reg(const struct sr_dev_inst *sdi, uint8_t addr, uint8_t value);
SR_PRIV int dsl_rd_reg(const struct sr_dev_inst *sdi, uint8_t addr, uint8_t *value);
SR_PRIV int dsl_wr_ext(const struct sr_dev_inst *sdi, uint8_t addr, uint8_t value);
SR_PRIV int dsl_rd_ext(const struct sr_dev_inst *sdi, unsigned char *ctx, uint16_t addr, uint8_t len);

SR_PRIV int dsl_wr_dso(const struct sr_dev_inst *sdi, uint64_t cmd);
SR_PRIV int dsl_wr_nvm(const struct sr_dev_inst *sdi, unsigned char *ctx, uint16_t addr, uint8_t len);
SR_PRIV int dsl_rd_nvm(const struct sr_dev_inst *sdi, unsigned char *ctx, uint16_t addr, uint8_t len);
SR_PRIV int dsl_rd_probe(const struct sr_dev_inst *sdi, unsigned char *ctx, uint16_t addr, uint8_t len);

SR_PRIV int dsl_config_adc(const struct sr_dev_inst *sdi, const struct DSL_adc_config *config);
1334 1335 1336 1337 1338 1339 1340
SR_PRIV double dsl_adc_code2fgain(uint8_t code);
SR_PRIV uint8_t dsl_adc_fgain2code(double gain);
SR_PRIV int dsl_config_adc_fgain(const struct sr_dev_inst *sdi, uint8_t branch, double gain0, double gain1);
SR_PRIV int dsl_config_fpga_fgain(const struct sr_dev_inst *sdi);
SR_PRIV int dsl_skew_fpga_fgain(const struct sr_dev_inst *sdi, gboolean comb, double skew[]);
SR_PRIV int dsl_probe_cali_fgain(struct DSL_context *devc, struct sr_channel *probe, double mean, gboolean comb, gboolean reset);
SR_PRIV gboolean dsl_probe_fgain_inrange(struct sr_channel *probe, gboolean comb, double skew[]);
Andy Dneg's avatar
Andy Dneg committed
1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356

SR_PRIV int dsl_fpga_arm(const struct sr_dev_inst *sdi);
SR_PRIV int dsl_fpga_config(struct libusb_device_handle *hdl, const char *filename);

SR_PRIV int dsl_config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                      const struct sr_channel *ch,
                      const struct sr_channel_group *cg);
SR_PRIV int dsl_config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
                      struct sr_channel *ch,
                      struct sr_channel_group *cg );
SR_PRIV int dsl_config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                       const struct sr_channel_group *cg);

SR_PRIV int dsl_dev_open(struct sr_dev_driver *di, struct sr_dev_inst *sdi, gboolean *fpga_done);
SR_PRIV int dsl_dev_close(struct sr_dev_inst *sdi);
SR_PRIV int dsl_dev_acquisition_stop(const struct sr_dev_inst *sdi, void *cb_data);
1357
SR_PRIV int dsl_dev_status_get(const struct sr_dev_inst *sdi, struct sr_status *status, gboolean prg);
Andy Dneg's avatar
Andy Dneg committed
1358 1359 1360 1361 1362 1363

SR_PRIV unsigned int dsl_get_timeout(const struct sr_dev_inst *sdi);
SR_PRIV int dsl_start_transfers(const struct sr_dev_inst *sdi);
SR_PRIV int dsl_header_size(const struct DSL_context *devc);

#endif