SR_PRIV void analyzer_read_start(libusb_device_handle *devh)
{
- int i;
-
analyzer_write_status(devh, 3, STATUS_FLAG_20 | STATUS_FLAG_READ);
- for (i = 0; i < 8; i++)
- (void)gl_reg_read(devh, READ_RAM_STATUS);
+ /* Prep for bulk reads */
+ gl_reg_read_buf(devh, READ_RAM_STATUS, NULL, 0);
}
SR_PRIV int analyzer_read_data(libusb_device_handle *devh, void *buffer,
ret = gl_read_data(devh);
return ret;
}
+
+SR_PRIV int gl_reg_read_buf(libusb_device_handle *devh, unsigned int reg,
+ unsigned char *buf, unsigned int len)
+{
+ int ret;
+ unsigned int i;
+
+ ret = gl_write_address(devh, reg);
+ if (ret < 0)
+ return ret;
+ for (i = 0; i < len; i++) {
+ ret = gl_read_data(devh);
+ if (ret < 0)
+ return ret;
+ buf[i] = ret;
+ }
+ return 0;
+}
SR_PRIV int gl_reg_write(libusb_device_handle *devh, unsigned int reg,
unsigned int val);
SR_PRIV int gl_reg_read(libusb_device_handle *devh, unsigned int reg);
-
+SR_PRIV int gl_reg_read_buf(libusb_device_handle *devh, unsigned int reg,
+ unsigned char *buf, unsigned int len);
#endif