diff --git a/DSView/res/DSCopeC20.bin b/DSView/res/DSCopeC20.bin new file mode 100755 index 00000000..aad0f0b5 Binary files /dev/null and b/DSView/res/DSCopeC20.bin differ diff --git a/DSView/res/DSCopeC20.fw b/DSView/res/DSCopeC20.fw new file mode 100755 index 00000000..797af396 Binary files /dev/null and b/DSView/res/DSCopeC20.fw differ diff --git a/DSView/res/DSCopeC20P.fw b/DSView/res/DSCopeC20P.fw new file mode 100755 index 00000000..25916777 Binary files /dev/null and b/DSView/res/DSCopeC20P.fw differ diff --git a/libsigrok4DSL/hardware/DSL/command.h b/libsigrok4DSL/hardware/DSL/command.h index 80ae79b7..391902aa 100644 --- a/libsigrok4DSL/hardware/DSL/command.h +++ b/libsigrok4DSL/hardware/DSL/command.h @@ -45,6 +45,9 @@ #define VTH_ADDR 0x78 #define EEWP_ADDR 0x70 #define COMB_ADDR 0x68 +#define EXT_I2CSEL 0x71 +#define FPGA_I2CADDR 0x21 +#define EXT_I2CADDR 0x50 enum { DSL_CTL_FW_VERSION = 0, diff --git a/libsigrok4DSL/hardware/DSL/dscope.c b/libsigrok4DSL/hardware/DSL/dscope.c index d1965384..418a7d8e 100644 --- a/libsigrok4DSL/hardware/DSL/dscope.c +++ b/libsigrok4DSL/hardware/DSL/dscope.c @@ -1679,6 +1679,7 @@ static int dev_acquisition_start(struct sr_dev_inst *sdi, void *cb_data) int ret; struct ctl_wr_cmd wr_cmd; + if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; diff --git a/libsigrok4DSL/hardware/DSL/dsl.c b/libsigrok4DSL/hardware/DSL/dsl.c index 985b25f2..e19a75c4 100755 --- a/libsigrok4DSL/hardware/DSL/dsl.c +++ b/libsigrok4DSL/hardware/DSL/dsl.c @@ -271,7 +271,29 @@ SR_PRIV int dsl_wr_reg(const struct sr_dev_inst *sdi, uint8_t addr, uint8_t valu hdl = usb->devhdl; wr_cmd.header.dest = DSL_CTL_I2C_REG; - wr_cmd.header.offset = addr; + wr_cmd.header.offset = (FPGA_I2CADDR << 8) + addr; + wr_cmd.header.size = 1; + wr_cmd.data[0] = value; + if ((ret = command_ctl_wr(hdl, wr_cmd)) != SR_OK) { + sr_err("Sent DSL_CTL_I2C_REG command failed."); + return SR_ERR; + } + + return SR_OK; +} + +SR_PRIV int dsl_wr_ext(const struct sr_dev_inst *sdi, uint8_t addr, uint8_t value) +{ + struct sr_usb_dev_inst *usb; + struct libusb_device_handle *hdl; + struct ctl_wr_cmd wr_cmd; + int ret; + + usb = sdi->conn; + hdl = usb->devhdl; + + wr_cmd.header.dest = DSL_CTL_I2C_REG; + wr_cmd.header.offset = (EXT_I2CADDR << 8) + addr; wr_cmd.header.size = 1; wr_cmd.data[0] = value; if ((ret = command_ctl_wr(hdl, wr_cmd)) != SR_OK) { @@ -1112,7 +1134,7 @@ SR_PRIV int dsl_dev_status_get(const struct sr_dev_inst *sdi, struct sr_status * usb = sdi->conn; if (prg && (devc->status == DSL_START)) { rd_cmd.header.dest = DSL_CTL_DSO_MEASURE; - rd_cmd.header.offset = begin; + rd_cmd.header.offset = (FPGA_I2CADDR << 8) + begin; rd_cmd.header.size = end - begin + 1; rd_cmd.data = (unsigned char*)status; ret = command_ctl_rd(usb->devhdl, rd_cmd); diff --git a/libsigrok4DSL/hardware/DSL/dsl.h b/libsigrok4DSL/hardware/DSL/dsl.h index dc166736..a84f0659 100644 --- a/libsigrok4DSL/hardware/DSL/dsl.h +++ b/libsigrok4DSL/hardware/DSL/dsl.h @@ -257,6 +257,18 @@ static const struct DSL_profile supported_DSCope[] = { "DSCope20.bin", DEV_CAPS_16BIT}, + {0x2A0E, 0x0023, NULL, "DSCope C20", NULL, + "DSCopeC20.fw", + "DSCopeC20.bin", + "DSCopeC20.bin", + DEV_CAPS_16BIT}, + + {0x2A0E, 0x0024, NULL, "DSCope C20P", NULL, + "DSCopeC20P.fw", + "DSCopeC20.bin", + "DSCopeC20.bin", + DEV_CAPS_16BIT}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; @@ -409,6 +421,7 @@ 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_wr_ext(const struct sr_dev_inst *sdi, uint8_t addr, uint8_t value); 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);