From: Aurelien Jacobs Date: Sun, 15 Mar 2015 17:43:06 +0000 (+0100) Subject: Rename SR_CONF_OUTPUT_* to SR_CONF_*. X-Git-Tag: libsigrok-0.4.0~502 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7a0b98b544ca00f351295f21f895442680b1c014;p=libsigrok.git Rename SR_CONF_OUTPUT_* to SR_CONF_*. All those options are currently applied only to power-supplies but they could apply as well to electronic loads, except for the fact that electronic loads channels are called inputs and not outputs. Also when you think about an SMU (or any kind of 4-quadrants power-supply), their channels can both source and sink current, so they can be considered as input as much as output. Those SR_CONF_* are thus renamed so that they can be used in all those situations. --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 3c204798..bc754f67 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -758,51 +758,51 @@ enum sr_configkey { SR_CONF_NUM_ANALOG_CHANNELS, /** - * Output voltage. + * Current voltage. * @arg type: double - * @arg get: get measured output voltage + * @arg get: get measured voltage */ - SR_CONF_OUTPUT_VOLTAGE, + SR_CONF_VOLTAGE, /** - * Maximum output voltage target. + * Maximum target voltage. * @arg type: double - * @arg get: get output voltage target - * @arg set: change output voltage target + * @arg get: get target voltage + * @arg set: change target voltage */ - SR_CONF_OUTPUT_VOLTAGE_TARGET, + SR_CONF_VOLTAGE_TARGET, /** - * Output current. + * Current current. * @arg type: double - * @arg get: get measured output current + * @arg get: get measured current */ - SR_CONF_OUTPUT_CURRENT, + SR_CONF_CURRENT, /** - * Output current limit. + * Current limit. * @arg type: double - * @arg get: get output current limit - * @arg set: change output current limit + * @arg get: get current limit + * @arg set: change current limit */ - SR_CONF_OUTPUT_CURRENT_LIMIT, + SR_CONF_CURRENT_LIMIT, /** - * Enabling/disabling output. + * Enabling/disabling channel. * @arg type: boolean * @arg get: @b true if currently enabled * @arg set: enable/disable */ - SR_CONF_OUTPUT_ENABLED, + SR_CONF_ENABLED, /** - * Output channel configuration. + * Channel configuration. * @arg type: string * @arg get: get current setting * @arg set: change current setting * @arg list: array of possible values */ - SR_CONF_OUTPUT_CHANNEL_CONFIG, + SR_CONF_CHANNEL_CONFIG, /** * Over-voltage protection (OVP) feature @@ -839,7 +839,7 @@ enum sr_configkey { /** * Over-current protection (OCP) active * @arg type: boolean - * @arg get: @b true if device has activated OCP, i.e. the output current + * @arg get: @b true if device has activated OCP, i.e. the current current * exceeds the over-current protection threshold. */ SR_CONF_OVER_CURRENT_PROTECTION_ACTIVE, @@ -859,11 +859,11 @@ enum sr_configkey { SR_CONF_AMPLITUDE, /** - * Output channel regulation + * Channel regulation * get: "CV", "CC" or "UR", denoting constant voltage, constant current * or unregulated. */ - SR_CONF_OUTPUT_REGULATION, + SR_CONF_REGULATION, /** Over-temperature protection (OTP) */ SR_CONF_OVER_TEMPERATURE_PROTECTION, diff --git a/src/hardware/atten-pps3xxx/api.c b/src/hardware/atten-pps3xxx/api.c index e0168b4e..6b178ae9 100644 --- a/src/hardware/atten-pps3xxx/api.c +++ b/src/hardware/atten-pps3xxx/api.c @@ -42,16 +42,16 @@ static const uint32_t drvopts[] = { static const uint32_t devopts[] = { SR_CONF_CONTINUOUS | SR_CONF_SET, - SR_CONF_OUTPUT_CHANNEL_CONFIG | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_CHANNEL_CONFIG | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_GET | SR_CONF_SET, }; static const uint32_t devopts_cg[] = { - SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET, - SR_CONF_OUTPUT_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, - SR_CONF_OUTPUT_CURRENT | SR_CONF_GET, - SR_CONF_OUTPUT_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, - SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET, + SR_CONF_VOLTAGE | SR_CONF_GET, + SR_CONF_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_CURRENT | SR_CONF_GET, + SR_CONF_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_ENABLED | SR_CONF_GET | SR_CONF_SET, }; static const char *channel_modes[] = { @@ -225,7 +225,7 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s if (!cg) { /* No channel group: global options. */ switch (key) { - case SR_CONF_OUTPUT_CHANNEL_CONFIG: + case SR_CONF_CHANNEL_CONFIG: *data = g_variant_new_string(channel_modes[devc->channel_mode]); break; case SR_CONF_OVER_CURRENT_PROTECTION_ENABLED: @@ -240,19 +240,19 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s channel = ch->index; switch (key) { - case SR_CONF_OUTPUT_VOLTAGE: + case SR_CONF_VOLTAGE: *data = g_variant_new_double(devc->config[channel].output_voltage_last); break; - case SR_CONF_OUTPUT_VOLTAGE_TARGET: + case SR_CONF_VOLTAGE_TARGET: *data = g_variant_new_double(devc->config[channel].output_voltage_max); break; - case SR_CONF_OUTPUT_CURRENT: + case SR_CONF_CURRENT: *data = g_variant_new_double(devc->config[channel].output_current_last); break; - case SR_CONF_OUTPUT_CURRENT_LIMIT: + case SR_CONF_CURRENT_LIMIT: *data = g_variant_new_double(devc->config[channel].output_current_max); break; - case SR_CONF_OUTPUT_ENABLED: + case SR_CONF_ENABLED: *data = g_variant_new_boolean(devc->config[channel].output_enabled); break; default: @@ -296,7 +296,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd if (!cg) { /* No channel group: global options. */ switch (key) { - case SR_CONF_OUTPUT_CHANNEL_CONFIG: + case SR_CONF_CHANNEL_CONFIG: sval = g_variant_get_string(data, NULL); if ((ival = find_str(sval, channel_modes, ARRAY_SIZE(channel_modes))) == -1) { @@ -331,21 +331,21 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd channel = ch->index; switch (key) { - case SR_CONF_OUTPUT_VOLTAGE_TARGET: + case SR_CONF_VOLTAGE_TARGET: dval = g_variant_get_double(data); if (dval < 0 || dval > devc->model->channels[channel].voltage[1]) ret = SR_ERR_ARG; devc->config[channel].output_voltage_max = dval; devc->config_dirty = TRUE; break; - case SR_CONF_OUTPUT_CURRENT_LIMIT: + case SR_CONF_CURRENT_LIMIT: dval = g_variant_get_double(data); if (dval < 0 || dval > devc->model->channels[channel].current[1]) ret = SR_ERR_ARG; devc->config[channel].output_current_max = dval; devc->config_dirty = TRUE; break; - case SR_CONF_OUTPUT_ENABLED: + case SR_CONF_ENABLED: bval = g_variant_get_boolean(data); if (bval == devc->config[channel].output_enabled_set) /* Nothing to do. */ @@ -395,7 +395,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, devopts, ARRAY_SIZE(devopts), sizeof(uint32_t)); break; - case SR_CONF_OUTPUT_CHANNEL_CONFIG: + case SR_CONF_CHANNEL_CONFIG: if (devc->model->channel_modes == CHANMODE_INDEPENDENT) { /* The 1-channel models. */ *data = g_variant_new_strv(channel_modes, 1); @@ -420,7 +420,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t)); break; - case SR_CONF_OUTPUT_VOLTAGE_TARGET: + case SR_CONF_VOLTAGE_TARGET: g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); /* Min, max, step. */ for (i = 0; i < 3; i++) { @@ -429,7 +429,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * } *data = g_variant_builder_end(&gvb); break; - case SR_CONF_OUTPUT_CURRENT_LIMIT: + case SR_CONF_CURRENT_LIMIT: g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); /* Min, max, step. */ for (i = 0; i < 3; i++) { diff --git a/src/hardware/conrad-digi-35-cpu/api.c b/src/hardware/conrad-digi-35-cpu/api.c index a9ea575e..ee42960a 100644 --- a/src/hardware/conrad-digi-35-cpu/api.c +++ b/src/hardware/conrad-digi-35-cpu/api.c @@ -33,8 +33,8 @@ static const uint32_t scanopts[] = { static const uint32_t devopts[] = { SR_CONF_POWER_SUPPLY, - SR_CONF_OUTPUT_VOLTAGE | SR_CONF_SET, - SR_CONF_OUTPUT_CURRENT | SR_CONF_SET, + SR_CONF_VOLTAGE | SR_CONF_SET, + SR_CONF_CURRENT | SR_CONF_SET, SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_SET, }; @@ -128,7 +128,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd ret = SR_OK; switch (key) { - case SR_CONF_OUTPUT_VOLTAGE: + case SR_CONF_VOLTAGE: dblval = g_variant_get_double(data); if ((dblval < 0.0) || (dblval > 35.0)) { sr_err("Voltage out of range (0 - 35.0)!"); @@ -136,7 +136,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd } ret = send_msg1(sdi, 'V', (int) (dblval * 10 + 0.5)); break; - case SR_CONF_OUTPUT_CURRENT: + case SR_CONF_CURRENT: dblval = g_variant_get_double(data); if ((dblval < 0.01) || (dblval > 2.55)) { sr_err("Current out of range (0 - 2.55)!"); diff --git a/src/hardware/manson-hcs-3xxx/api.c b/src/hardware/manson-hcs-3xxx/api.c index 4ee06dc1..ccf1bf96 100644 --- a/src/hardware/manson-hcs-3xxx/api.c +++ b/src/hardware/manson-hcs-3xxx/api.c @@ -44,11 +44,11 @@ static const uint32_t devopts[] = { SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET, SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET, /* Device configuration */ - SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET, - SR_CONF_OUTPUT_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, - SR_CONF_OUTPUT_CURRENT | SR_CONF_GET, - SR_CONF_OUTPUT_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, - SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET, + SR_CONF_VOLTAGE | SR_CONF_GET, + SR_CONF_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_CURRENT | SR_CONF_GET, + SR_CONF_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_ENABLED | SR_CONF_GET | SR_CONF_SET, }; /* Note: All models have one power supply output only. */ @@ -231,19 +231,19 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s case SR_CONF_LIMIT_MSEC: *data = g_variant_new_uint64(devc->limit_msec); break; - case SR_CONF_OUTPUT_VOLTAGE: + case SR_CONF_VOLTAGE: *data = g_variant_new_double(devc->voltage); break; - case SR_CONF_OUTPUT_VOLTAGE_TARGET: + case SR_CONF_VOLTAGE_TARGET: *data = g_variant_new_double(devc->voltage_max); break; - case SR_CONF_OUTPUT_CURRENT: + case SR_CONF_CURRENT: *data = g_variant_new_double(devc->current); break; - case SR_CONF_OUTPUT_CURRENT_LIMIT: + case SR_CONF_CURRENT_LIMIT: *data = g_variant_new_double(devc->current_max); break; - case SR_CONF_OUTPUT_ENABLED: + case SR_CONF_ENABLED: *data = g_variant_new_boolean(devc->output_enabled); break; default: @@ -278,7 +278,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd return SR_ERR_ARG; devc->limit_samples = g_variant_get_uint64(data); break; - case SR_CONF_OUTPUT_VOLTAGE_TARGET: + case SR_CONF_VOLTAGE_TARGET: dval = g_variant_get_double(data); if (dval < devc->model->voltage[0] || dval > devc->voltage_max_device) return SR_ERR_ARG; @@ -289,7 +289,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd return SR_ERR; devc->voltage_max = dval; break; - case SR_CONF_OUTPUT_CURRENT_LIMIT: + case SR_CONF_CURRENT_LIMIT: dval = g_variant_get_double(data); if (dval < devc->model->current[0] || dval > devc->current_max_device) return SR_ERR_ARG; @@ -300,7 +300,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd return SR_ERR; devc->current_max = dval; break; - case SR_CONF_OUTPUT_ENABLED: + case SR_CONF_ENABLED: bval = g_variant_get_boolean(data); if (bval == devc->output_enabled) /* Nothing to do. */ break; @@ -351,7 +351,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, devopts, ARRAY_SIZE(devopts), sizeof(uint32_t)); break; - case SR_CONF_OUTPUT_VOLTAGE_TARGET: + case SR_CONF_VOLTAGE_TARGET: g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); /* Min, max, step. */ for (idx = 0; idx < 3; idx++) { @@ -364,7 +364,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * } *data = g_variant_builder_end(&gvb); break; - case SR_CONF_OUTPUT_CURRENT_LIMIT: + case SR_CONF_CURRENT_LIMIT: g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); /* Min, max, step. */ for (idx = 0; idx < 3; idx++) { diff --git a/src/hardware/motech-lps-30x/api.c b/src/hardware/motech-lps-30x/api.c index 1789e42b..30fc62f2 100644 --- a/src/hardware/motech-lps-30x/api.c +++ b/src/hardware/motech-lps-30x/api.c @@ -63,22 +63,22 @@ static const uint32_t devopts[] = { SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET, SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET, /* Device configuration */ - SR_CONF_OUTPUT_CHANNEL_CONFIG | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_CHANNEL_CONFIG | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; /** Hardware capabilities channel 1, 2. */ static const uint32_t devopts_ch12[] = { - SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET, - SR_CONF_OUTPUT_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, - SR_CONF_OUTPUT_CURRENT | SR_CONF_GET, - SR_CONF_OUTPUT_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, - SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET, + SR_CONF_VOLTAGE | SR_CONF_GET, + SR_CONF_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_CURRENT | SR_CONF_GET, + SR_CONF_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_ENABLED | SR_CONF_GET | SR_CONF_SET, }; /** Hardware capabilities channel 3. (LPS-304/305 only). */ static const uint32_t devopts_ch3[] = { - SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET, - SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET, + SR_CONF_VOLTAGE | SR_CONF_GET, + SR_CONF_ENABLED | SR_CONF_GET | SR_CONF_SET, }; static const char *channel_modes[] = { @@ -561,7 +561,7 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s case SR_CONF_LIMIT_MSEC: *data = g_variant_new_uint64(devc->limit_msec); break; - case SR_CONF_OUTPUT_CHANNEL_CONFIG: + case SR_CONF_CHANNEL_CONFIG: *data = g_variant_new_string(channel_modes[devc->tracking_mode]); break; default: @@ -572,19 +572,19 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s ch = cg->channels->data; ch_idx = ch->index; switch (key) { - case SR_CONF_OUTPUT_VOLTAGE: + case SR_CONF_VOLTAGE: *data = g_variant_new_double(devc->channel_status[ch_idx].output_voltage_last); break; - case SR_CONF_OUTPUT_VOLTAGE_TARGET: + case SR_CONF_VOLTAGE_TARGET: *data = g_variant_new_double(devc->channel_status[ch_idx].output_voltage_max); break; - case SR_CONF_OUTPUT_CURRENT: + case SR_CONF_CURRENT: *data = g_variant_new_double(devc->channel_status[ch_idx].output_current_last); break; - case SR_CONF_OUTPUT_CURRENT_LIMIT: + case SR_CONF_CURRENT_LIMIT: *data = g_variant_new_double(devc->channel_status[ch_idx].output_current_max); break; - case SR_CONF_OUTPUT_ENABLED: + case SR_CONF_ENABLED: *data = g_variant_new_boolean(devc->channel_status[ch_idx].output_enabled); break; default: @@ -626,7 +626,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd case SR_CONF_LIMIT_SAMPLES: devc->limit_samples = g_variant_get_uint64(data); break; - case SR_CONF_OUTPUT_CHANNEL_CONFIG: + case SR_CONF_CHANNEL_CONFIG: sval = g_variant_get_string(data, NULL); found = FALSE; for (idx = 0; idx < (int)ARRAY_SIZE(channel_modes); idx++) { @@ -654,7 +654,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd ch_idx = ch->index; switch (key) { - case SR_CONF_OUTPUT_VOLTAGE_TARGET: + case SR_CONF_VOLTAGE_TARGET: dval = g_variant_get_double(data); if (dval < 0 || dval > devc->model->channels[ch_idx].voltage[1]) return SR_ERR_ARG; @@ -675,7 +675,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd else return lps_cmd_ok(sdi->conn, "VSET%d %05.3f", ch_idx+1, dval); break; - case SR_CONF_OUTPUT_CURRENT_LIMIT: + case SR_CONF_CURRENT_LIMIT: dval = g_variant_get_double(data); if (dval < 0 || dval > devc->model->channels[ch_idx].current[1]) return SR_ERR_ARG; @@ -684,7 +684,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd devc->channel_status[ch_idx].output_current_max = dval; return lps_cmd_ok(sdi->conn, "ISET%d %05.4f", ch_idx+1, dval); break; - case SR_CONF_OUTPUT_ENABLED: + case SR_CONF_ENABLED: bval = g_variant_get_boolean(data); if (bval == devc->channel_status[ch_idx].output_enabled) /* Nothing to do. */ break; @@ -742,7 +742,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, devopts, ARRAY_SIZE(devopts), sizeof(uint32_t)); return SR_OK; - case SR_CONF_OUTPUT_CHANNEL_CONFIG: + case SR_CONF_CHANNEL_CONFIG: if (devc->model->modelid <= LPS_303) { /* The 1-channel models. */ *data = g_variant_new_strv(channel_modes, 1); @@ -768,7 +768,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, devopts_ch3, ARRAY_SIZE(devopts_ch3), sizeof(uint32_t)); break; - case SR_CONF_OUTPUT_VOLTAGE_TARGET: + case SR_CONF_VOLTAGE_TARGET: g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); /* Min, max, step. */ for (i = 0; i < 3; i++) { @@ -777,7 +777,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * } *data = g_variant_builder_end(&gvb); break; - case SR_CONF_OUTPUT_CURRENT_LIMIT: + case SR_CONF_CURRENT_LIMIT: g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); /* Min, max, step. */ for (i = 0; i < 3; i++) { diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index cf6bc65b..c728f2b0 100644 --- a/src/hardware/scpi-pps/api.c +++ b/src/hardware/scpi-pps/api.c @@ -287,15 +287,15 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s gvtype = NULL; cmd = -1; switch (key) { - case SR_CONF_OUTPUT_ENABLED: + case SR_CONF_ENABLED: gvtype = G_VARIANT_TYPE_BOOLEAN; cmd = SCPI_CMD_GET_OUTPUT_ENABLED; break; - case SR_CONF_OUTPUT_VOLTAGE: + case SR_CONF_VOLTAGE: gvtype = G_VARIANT_TYPE_DOUBLE; cmd = SCPI_CMD_GET_MEAS_VOLTAGE; break; - case SR_CONF_OUTPUT_VOLTAGE_TARGET: + case SR_CONF_VOLTAGE_TARGET: gvtype = G_VARIANT_TYPE_DOUBLE; cmd = SCPI_CMD_GET_VOLTAGE_TARGET; break; @@ -307,11 +307,11 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s gvtype = G_VARIANT_TYPE_DOUBLE; cmd = SCPI_CMD_GET_FREQUENCY_TARGET; break; - case SR_CONF_OUTPUT_CURRENT: + case SR_CONF_CURRENT: gvtype = G_VARIANT_TYPE_DOUBLE; cmd = SCPI_CMD_GET_MEAS_CURRENT; break; - case SR_CONF_OUTPUT_CURRENT_LIMIT: + case SR_CONF_CURRENT_LIMIT: gvtype = G_VARIANT_TYPE_DOUBLE; cmd = SCPI_CMD_GET_CURRENT_LIMIT; break; @@ -343,7 +343,7 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s gvtype = G_VARIANT_TYPE_BOOLEAN; cmd = SCPI_CMD_GET_OVER_TEMPERATURE_PROTECTION; break; - case SR_CONF_OUTPUT_REGULATION: + case SR_CONF_REGULATION: gvtype = G_VARIANT_TYPE_STRING; cmd = SCPI_CMD_GET_OUTPUT_REGULATION; } @@ -375,13 +375,13 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd ret = SR_OK; switch (key) { - case SR_CONF_OUTPUT_ENABLED: + case SR_CONF_ENABLED: if (g_variant_get_boolean(data)) ret = scpi_cmd(sdi, SCPI_CMD_SET_OUTPUT_ENABLE); else ret = scpi_cmd(sdi, SCPI_CMD_SET_OUTPUT_DISABLE); break; - case SR_CONF_OUTPUT_VOLTAGE_TARGET: + case SR_CONF_VOLTAGE_TARGET: d = g_variant_get_double(data); ret = scpi_cmd(sdi, SCPI_CMD_SET_VOLTAGE_TARGET, d); break; @@ -389,7 +389,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd d = g_variant_get_double(data); ret = scpi_cmd(sdi, SCPI_CMD_SET_FREQUENCY_TARGET, d); break; - case SR_CONF_OUTPUT_CURRENT_LIMIT: + case SR_CONF_CURRENT_LIMIT: d = g_variant_get_double(data); ret = scpi_cmd(sdi, SCPI_CMD_SET_CURRENT_LIMIT, d); break; @@ -461,7 +461,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * devc->device->devopts, devc->device->num_devopts, sizeof(uint32_t)); break; - case SR_CONF_OUTPUT_CHANNEL_CONFIG: + case SR_CONF_CHANNEL_CONFIG: /* Not used. */ i = 0; if (devc->device->features & PPS_INDEPENDENT) @@ -498,7 +498,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * devc->device->devopts_cg, devc->device->num_devopts_cg, sizeof(uint32_t)); break; - case SR_CONF_OUTPUT_VOLTAGE_TARGET: + case SR_CONF_VOLTAGE_TARGET: ch_spec = &(devc->device->channels[ch->index]); g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); /* Min, max, write resolution. */ @@ -518,7 +518,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * } *data = g_variant_builder_end(&gvb); break; - case SR_CONF_OUTPUT_CURRENT_LIMIT: + case SR_CONF_CURRENT_LIMIT: g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); /* Min, max, step. */ for (i = 0; i < 3; i++) { diff --git a/src/hardware/scpi-pps/profiles.c b/src/hardware/scpi-pps/profiles.c index a064991f..e860e9de 100644 --- a/src/hardware/scpi-pps/profiles.c +++ b/src/hardware/scpi-pps/profiles.c @@ -149,18 +149,18 @@ static const uint32_t rigol_dp800_devopts[] = { }; static const uint32_t rigol_dp800_devopts_cg[] = { - SR_CONF_OUTPUT_REGULATION | SR_CONF_GET, + SR_CONF_REGULATION | SR_CONF_GET, SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED | SR_CONF_GET | SR_CONF_SET, SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE | SR_CONF_GET, SR_CONF_OVER_VOLTAGE_PROTECTION_THRESHOLD | SR_CONF_GET | SR_CONF_SET, SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_GET | SR_CONF_SET, SR_CONF_OVER_CURRENT_PROTECTION_ACTIVE | SR_CONF_GET, SR_CONF_OVER_CURRENT_PROTECTION_THRESHOLD | SR_CONF_GET | SR_CONF_SET, - SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET, - SR_CONF_OUTPUT_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, - SR_CONF_OUTPUT_CURRENT | SR_CONF_GET, - SR_CONF_OUTPUT_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, - SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET, + SR_CONF_VOLTAGE | SR_CONF_GET, + SR_CONF_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_CURRENT | SR_CONF_GET, + SR_CONF_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_ENABLED | SR_CONF_GET | SR_CONF_SET, }; static const struct channel_spec rigol_dp821a_ch[] = { @@ -229,11 +229,11 @@ static const struct scpi_command rigol_dp800_cmd[] = { /* HP 663xx series */ static const uint32_t hp_6632b_devopts[] = { SR_CONF_CONTINUOUS | SR_CONF_SET, - SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET, - SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET, - SR_CONF_OUTPUT_CURRENT | SR_CONF_GET, - SR_CONF_OUTPUT_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, - SR_CONF_OUTPUT_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_ENABLED | SR_CONF_GET | SR_CONF_SET, + SR_CONF_VOLTAGE | SR_CONF_GET, + SR_CONF_CURRENT | SR_CONF_GET, + SR_CONF_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; static const struct channel_spec hp_6632b_ch[] = { @@ -262,16 +262,16 @@ static const uint32_t philips_pm2800_devopts[] = { }; static const uint32_t philips_pm2800_devopts_cg[] = { - SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET, - SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET, - SR_CONF_OUTPUT_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, - SR_CONF_OUTPUT_CURRENT | SR_CONF_GET, - SR_CONF_OUTPUT_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_ENABLED | SR_CONF_GET | SR_CONF_SET, + SR_CONF_VOLTAGE | SR_CONF_GET, + SR_CONF_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_CURRENT | SR_CONF_GET, + SR_CONF_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE | SR_CONF_GET, SR_CONF_OVER_VOLTAGE_PROTECTION_THRESHOLD | SR_CONF_GET | SR_CONF_SET, SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_GET | SR_CONF_SET, SR_CONF_OVER_CURRENT_PROTECTION_ACTIVE | SR_CONF_GET, - SR_CONF_OUTPUT_REGULATION | SR_CONF_GET, + SR_CONF_REGULATION | SR_CONF_GET, }; enum philips_pm2800_modules { diff --git a/src/hwdriver.c b/src/hwdriver.c index dea7c9e4..04bb5de6 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -125,18 +125,18 @@ static struct sr_config_info sr_config_info_data[] = { "Number of logic channels", NULL}, {SR_CONF_NUM_ANALOG_CHANNELS, SR_T_INT32, "analog_channels", "Number of analog channels", NULL}, - {SR_CONF_OUTPUT_VOLTAGE, SR_T_FLOAT, "output_voltage", - "Current output voltage", NULL}, - {SR_CONF_OUTPUT_VOLTAGE_TARGET, SR_T_FLOAT, "output_voltage_target", - "Output voltage target", NULL}, - {SR_CONF_OUTPUT_CURRENT, SR_T_FLOAT, "output_current", - "Current output current", NULL}, - {SR_CONF_OUTPUT_CURRENT_LIMIT, SR_T_FLOAT, "output_current_limit", - "Output current limit", NULL}, - {SR_CONF_OUTPUT_ENABLED, SR_T_BOOL, "output_enabled", - "Output enabled", NULL}, - {SR_CONF_OUTPUT_CHANNEL_CONFIG, SR_T_STRING, "output_channel_config", - "Output channel modes", NULL}, + {SR_CONF_VOLTAGE, SR_T_FLOAT, "voltage", + "Current voltage", NULL}, + {SR_CONF_VOLTAGE_TARGET, SR_T_FLOAT, "voltage_target", + "Voltage target", NULL}, + {SR_CONF_CURRENT, SR_T_FLOAT, "current", + "Current current", NULL}, + {SR_CONF_CURRENT_LIMIT, SR_T_FLOAT, "current_limit", + "Current limit", NULL}, + {SR_CONF_ENABLED, SR_T_BOOL, "enabled", + "Channel enabled", NULL}, + {SR_CONF_CHANNEL_CONFIG, SR_T_STRING, "channel_config", + "Channel modes", NULL}, {SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED, SR_T_BOOL, "ovp_enabled", "Over-voltage protection enabled", NULL}, {SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE, SR_T_BOOL, "ovp_active", @@ -153,8 +153,8 @@ static struct sr_config_info sr_config_info_data[] = { "Clock edge", NULL}, {SR_CONF_AMPLITUDE, SR_T_FLOAT, "amplitude", "Amplitude", NULL}, - {SR_CONF_OUTPUT_REGULATION, SR_T_STRING, "output_regulation", - "Output channel regulation", NULL}, + {SR_CONF_REGULATION, SR_T_STRING, "regulation", + "Channel regulation", NULL}, {SR_CONF_OVER_TEMPERATURE_PROTECTION, SR_T_BOOL, "otp", "Over-temperature protection", NULL}, {SR_CONF_OUTPUT_FREQUENCY, SR_T_FLOAT, "output_frequency",