devc = g_malloc0(sizeof(struct dev_context));
devc->device = device;
+ sr_sw_limits_init(&devc->limits);
sdi->priv = devc;
if (device->num_channels) {
case SR_CONF_REGULATION:
gvtype = G_VARIANT_TYPE_STRING;
cmd = SCPI_CMD_GET_OUTPUT_REGULATION;
+ default:
+ return sr_sw_limits_config_get(&devc->limits, key, data);
}
if (!gvtype)
return SR_ERR_NA;
SCPI_CMD_SET_OVER_TEMPERATURE_PROTECTION_DISABLE);
break;
default:
- ret = SR_ERR_NA;
+ ret = sr_sw_limits_config_set(&devc->limits, key, data);
}
g_free(channel_group_name);
scpi_pps_receive_data, (void *)sdi)) != SR_OK)
return ret;
std_session_send_df_header(sdi);
+ sr_sw_limits_acquisition_start(&devc->limits);
return SR_OK;
}
/* Agilent/Keysight N5700A series */
static const uint32_t agilent_n5700a_devopts[] = {
SR_CONF_CONTINUOUS,
+ SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t agilent_n5700a_devopts_cg[] = {
/* Chroma 61600 series AC source */
static const uint32_t chroma_61604_devopts[] = {
SR_CONF_CONTINUOUS,
+ SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t chroma_61604_devopts_cg[] = {
/* Chroma 62000 series DC source */
static const uint32_t chroma_62000_devopts[] = {
SR_CONF_CONTINUOUS,
+ SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t chroma_62000_devopts_cg[] = {
/* Rigol DP700 series */
static const uint32_t rigol_dp700_devopts[] = {
SR_CONF_CONTINUOUS,
+ SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t rigol_dp700_devopts_cg[] = {
static const uint32_t rigol_dp800_devopts[] = {
SR_CONF_CONTINUOUS,
SR_CONF_OVER_TEMPERATURE_PROTECTION | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t rigol_dp800_devopts_cg[] = {
/* HP 663xx series */
static const uint32_t hp_6630a_devopts[] = {
SR_CONF_CONTINUOUS,
+ SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t hp_6630a_devopts_cg[] = {
static const uint32_t hp_6630b_devopts[] = {
SR_CONF_CONTINUOUS,
+ SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t hp_6630b_devopts_cg[] = {
/* Philips/Fluke PM2800 series */
static const uint32_t philips_pm2800_devopts[] = {
SR_CONF_CONTINUOUS,
+ SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t philips_pm2800_devopts_cg[] = {
static const uint32_t rs_hmc8043_devopts[] = {
SR_CONF_CONTINUOUS,
+ SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t rs_hmc8043_devopts_cg[] = {
struct sr_analog_encoding encoding;
struct sr_analog_meaning meaning;
struct sr_analog_spec spec;
- const struct sr_dev_inst *sdi;
+ struct sr_dev_inst *sdi;
int channel_group_cmd;
char *channel_group_name;
struct pps_channel *pch;
sr_next_enabled_channel(sdi, devc->cur_acquisition_channel);
}
+ if (devc->cur_acquisition_channel == sr_next_enabled_channel(sdi, NULL))
+ /* First enabled channel, so each channel has been sampled */
+ sr_sw_limits_update_samples_read(&devc->limits, 1);
+
+ /* Stop if limits have been hit. */
+ if (sr_sw_limits_check(&devc->limits))
+ sr_dev_acquisition_stop(sdi);
+
return TRUE;
}