return SR_OK;
}
+SR_PRIV int command_get_revid_version(libusb_device_handle *devhdl,
+ uint8_t *revid)
+{
+ int ret;
+
+ ret = libusb_control_transfer(devhdl, LIBUSB_REQUEST_TYPE_VENDOR |
+ LIBUSB_ENDPOINT_IN, CMD_GET_REVID_VERSION, 0x0000, 0x0000,
+ revid, 1, 100);
+
+ if (ret < 0) {
+ sr_err("fx2lafw: Unable to get REVID: %d.", ret);
+ return SR_ERR;
+ }
+
+ return SR_OK;
+}
+
SR_PRIV int command_start_acquisition(libusb_device_handle *devhdl,
uint64_t samplerate)
{
/* Protocol commands */
#define CMD_GET_FW_VERSION 0xb0
#define CMD_START 0xb1
+#define CMD_GET_REVID_VERSION 0xb2
#define CMD_START_FLAGS_CLK_SRC_POS 6
SR_PRIV int command_get_fw_version(libusb_device_handle *devhdl,
struct version_info *vi);
-
+SR_PRIV int command_get_revid_version(libusb_device_handle *devhdl,
+ uint8_t *revid);
SR_PRIV int command_start_acquisition(libusb_device_handle *devhdl,
uint64_t samplerate);
struct context *ctx;
struct version_info vi;
int ret, skip, i;
+ uint8_t revid;
if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
return SR_ERR;
break;
}
+ ret = command_get_revid_version(ctx->usb->devhdl, &revid);
+ if (ret != SR_OK) {
+ sr_err("fx2lafw: Failed to retrieve REVID.");
+ break;
+ }
+
if (vi.major != FX2LAFW_VERSION_MAJOR ||
vi.minor != FX2LAFW_VERSION_MINOR) {
- sr_err("fx2lafw: Expected firmware version %d.%02d "
- "got %d.%02d.", FX2LAFW_VERSION_MAJOR,
+ sr_err("fx2lafw: Expected firmware version %d.%d "
+ "got %d.%d.", FX2LAFW_VERSION_MAJOR,
FX2LAFW_VERSION_MINOR, vi.major, vi.minor);
break;
}
sdi->status = SR_ST_ACTIVE;
sr_info("fx2lafw: Opened device %d on %d.%d "
- "interface %d, firmware version %d.%02d",
+ "interface %d, firmware %d.%d, REVID %d.",
sdi->index, ctx->usb->bus, ctx->usb->address,
- USB_INTERFACE, vi.major, vi.minor);
+ USB_INTERFACE, vi.major, vi.minor, revid);
break;
}