rigol-ds: Experimental support for segmented data with PROTOCOL_V3 models
This commit is contained in:
parent
19f31c8ace
commit
06ed999aa4
|
@ -876,9 +876,11 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||||
gboolean some_digital;
|
gboolean some_digital;
|
||||||
GSList *l;
|
GSList *l;
|
||||||
char *cmd;
|
char *cmd;
|
||||||
|
int protocol;
|
||||||
|
|
||||||
scpi = sdi->conn;
|
scpi = sdi->conn;
|
||||||
devc = sdi->priv;
|
devc = sdi->priv;
|
||||||
|
protocol = devc->model->series->protocol;
|
||||||
|
|
||||||
devc->num_frames = 0;
|
devc->num_frames = 0;
|
||||||
devc->num_frames_segmented = 0;
|
devc->num_frames_segmented = 0;
|
||||||
|
@ -902,7 +904,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||||
/* Only one list entry for older protocols. All channels are
|
/* Only one list entry for older protocols. All channels are
|
||||||
* retrieved together when this entry is processed. */
|
* retrieved together when this entry is processed. */
|
||||||
if (ch->enabled && (
|
if (ch->enabled && (
|
||||||
devc->model->series->protocol > PROTOCOL_V3 ||
|
protocol > PROTOCOL_V3 ||
|
||||||
!some_digital))
|
!some_digital))
|
||||||
devc->enabled_channels = g_slist_append(
|
devc->enabled_channels = g_slist_append(
|
||||||
devc->enabled_channels, ch);
|
devc->enabled_channels, ch);
|
||||||
|
@ -910,8 +912,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||||
some_digital = TRUE;
|
some_digital = TRUE;
|
||||||
/* Turn on LA module if currently off. */
|
/* Turn on LA module if currently off. */
|
||||||
if (!devc->la_enabled) {
|
if (!devc->la_enabled) {
|
||||||
if (rigol_ds_config_set(sdi,
|
if (rigol_ds_config_set(sdi, protocol >= PROTOCOL_V3 ?
|
||||||
devc->model->series->protocol >= PROTOCOL_V3 ?
|
|
||||||
":LA:STAT ON" : ":LA:DISP ON") != SR_OK)
|
":LA:STAT ON" : ":LA:DISP ON") != SR_OK)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
devc->la_enabled = TRUE;
|
devc->la_enabled = TRUE;
|
||||||
|
@ -919,9 +920,9 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||||
}
|
}
|
||||||
if (ch->enabled != devc->digital_channels[ch->index]) {
|
if (ch->enabled != devc->digital_channels[ch->index]) {
|
||||||
/* Enabled channel is currently disabled, or vice versa. */
|
/* Enabled channel is currently disabled, or vice versa. */
|
||||||
if (devc->model->series->protocol >= PROTOCOL_V5)
|
if (protocol >= PROTOCOL_V5)
|
||||||
cmd = ":LA:DISP D%d,%s";
|
cmd = ":LA:DISP D%d,%s";
|
||||||
else if (devc->model->series->protocol >= PROTOCOL_V3)
|
else if (protocol >= PROTOCOL_V3)
|
||||||
cmd = ":LA:DIG%d:DISP %s";
|
cmd = ":LA:DIG%d:DISP %s";
|
||||||
else
|
else
|
||||||
cmd = ":DIG%d:TURN %s";
|
cmd = ":DIG%d:TURN %s";
|
||||||
|
@ -946,11 +947,20 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||||
|
|
||||||
/* Set memory mode. */
|
/* Set memory mode. */
|
||||||
if (devc->data_source == DATA_SOURCE_SEGMENTED) {
|
if (devc->data_source == DATA_SOURCE_SEGMENTED) {
|
||||||
switch (devc->model->series->protocol) {
|
switch (protocol) {
|
||||||
|
case PROTOCOL_V1:
|
||||||
|
case PROTOCOL_V2:
|
||||||
|
/* V1 and V2 do not have segmented data */
|
||||||
|
sr_err("Data source 'Segmented' not supported on this model");
|
||||||
|
break;
|
||||||
|
case PROTOCOL_V3:
|
||||||
case PROTOCOL_V4:
|
case PROTOCOL_V4:
|
||||||
{
|
{
|
||||||
int frames = 0;
|
int frames = 0;
|
||||||
sr_scpi_get_int(sdi->conn, "FUNC:WREP:FEND?", &frames);
|
if (sr_scpi_get_int(sdi->conn,
|
||||||
|
protocol == PROTOCOL_V4 ? "FUNC:WREP:FEND?" :
|
||||||
|
"FUNC:WREP:FMAX?", &frames) != SR_OK)
|
||||||
|
return SR_ERR;
|
||||||
if (frames <= 0) {
|
if (frames <= 0) {
|
||||||
sr_err("No segmented data available");
|
sr_err("No segmented data available");
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
|
@ -432,7 +432,7 @@ SR_PRIV int rigol_ds_capture_start(const struct sr_dev_inst *sdi)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
rigol_ds_set_wait_event(devc, WAIT_STOP);
|
rigol_ds_set_wait_event(devc, WAIT_STOP);
|
||||||
if (devc->data_source == DATA_SOURCE_SEGMENTED &&
|
if (devc->data_source == DATA_SOURCE_SEGMENTED &&
|
||||||
devc->model->series->protocol == PROTOCOL_V4)
|
devc->model->series->protocol <= PROTOCOL_V4)
|
||||||
if (rigol_ds_config_set(sdi, "FUNC:WREP:FCUR %d", devc->num_frames + 1) != SR_OK)
|
if (rigol_ds_config_set(sdi, "FUNC:WREP:FCUR %d", devc->num_frames + 1) != SR_OK)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue