}
}
+static int digital_frame_size(const struct sr_dev_inst *sdi)
+{
+ struct dev_context *devc = sdi->priv;
+
+ switch (devc->model->series) {
+ case RIGOL_VS5000:
+ return VS5000_DIGITAL_WAVEFORM_SIZE;
+ case RIGOL_DS1000:
+ return DS1000_DIGITAL_WAVEFORM_SIZE;
+ default:
+ return 0;
+ }
+}
+
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_probe_group *probe_group)
{
devc->channel_entry = devc->enabled_digital_probes;
devc->analog_frame_size = analog_frame_size(sdi);
+ devc->digital_frame_size = digital_frame_size(sdi);
if (devc->model->protocol == PROTOCOL_LEGACY) {
/* Fetch the first frame. */
devc->num_block_bytes = len;
} else {
devc->num_block_bytes = probe->type == SR_PROBE_ANALOG ?
- (devc->model->series == RIGOL_VS5000 ?
- VS5000_ANALOG_LIVE_WAVEFORM_SIZE :
- DS1000_ANALOG_LIVE_WAVEFORM_SIZE) :
- DIGITAL_WAVEFORM_SIZE;
+ devc->analog_frame_size : devc->digital_frame_size;
}
devc->num_block_read = 0;
}
devc->num_frame_samples += len;
if (devc->num_frame_samples < (probe->type == SR_PROBE_ANALOG ?
- devc->analog_frame_size : DIGITAL_WAVEFORM_SIZE))
+ devc->analog_frame_size : devc->digital_frame_size))
/* Don't have the whole frame yet. */
return TRUE;
#define LOG_PREFIX "rigol-ds"
+/* Analog waveform block sizes */
#define DS1000_ANALOG_LIVE_WAVEFORM_SIZE 600
#define DS2000_ANALOG_LIVE_WAVEFORM_SIZE 1400
#define VS5000_ANALOG_LIVE_WAVEFORM_SIZE 2048
#define DSO1000_ANALOG_LIVE_WAVEFORM_SIZE 600
-/* Needs to be made configurable later */
#define DS2000_ANALOG_MEM_WAVEFORM_SIZE_1C 14000
#define DS2000_ANALOG_MEM_WAVEFORM_SIZE_2C 7000
-#define DIGITAL_WAVEFORM_SIZE 1210
+
+/* Digital waveform block size */
+#define DS1000_DIGITAL_WAVEFORM_SIZE 1200
+#define VS5000_DIGITAL_WAVEFORM_SIZE 4096
+
/* Size of acquisition buffers */
#define ACQ_BUFFER_SIZE 32768
void *cb_data;
enum data_source data_source;
uint64_t analog_frame_size;
+ uint64_t digital_frame_size;
/* Device settings */
gboolean analog_channels[MAX_ANALOG_PROBES];