+/* Chroma 62000 series DC source */
+
+static const uint32_t chroma_62000_devopts[] = {
+ SR_CONF_CONTINUOUS,
+};
+
+static const uint32_t chroma_62000_devopts_cg[] = {
+ SR_CONF_OVER_VOLTAGE_PROTECTION_THRESHOLD | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_OVER_CURRENT_PROTECTION_THRESHOLD | 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_group_spec chroma_62000_cg[] = {
+ { "1", CH_IDX(0), PPS_OVP | PPS_OCP },
+};
+
+static const struct scpi_command chroma_62000_cmd[] = {
+ { SCPI_CMD_REMOTE, ":CONF:REM ON" },
+ { SCPI_CMD_LOCAL, ":CONF:REM OFF" },
+ { SCPI_CMD_BEEPER, ":CONF:BEEP?" },
+ { SCPI_CMD_BEEPER_ENABLE, ":CONF:BEEP ON" },
+ { SCPI_CMD_BEEPER_DISABLE, ":CONF:BEEP OFF" },
+ { SCPI_CMD_GET_MEAS_VOLTAGE, ":MEAS:VOLT?" },
+ { SCPI_CMD_GET_MEAS_CURRENT, ":MEAS:CURR?" },
+ { SCPI_CMD_GET_MEAS_POWER, ":MEAS:POW?" },
+ { SCPI_CMD_GET_VOLTAGE_TARGET, ":SOUR:VOLT?" },
+ { SCPI_CMD_SET_VOLTAGE_TARGET, ":SOUR:VOLT %.2f" },
+ { SCPI_CMD_GET_CURRENT_LIMIT, ":SOUR:CURR?" },
+ { SCPI_CMD_SET_CURRENT_LIMIT, ":SOUR:CURR %.6f" },
+ { SCPI_CMD_GET_OUTPUT_ENABLED, ":CONF:OUTP?" },
+ { SCPI_CMD_SET_OUTPUT_ENABLE, ":CONF:OUTP ON" },
+ { SCPI_CMD_SET_OUTPUT_DISABLE, ":CONF:OUTP OFF" },
+ { SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_THRESHOLD, ":SOUR:VOLT:PROT:HIGH?" },
+ { SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_THRESHOLD, ":SOUR:VOLT:PROT:HIGH %.6f" },
+ { SCPI_CMD_GET_OVER_CURRENT_PROTECTION_THRESHOLD, ":SOUR:CURR:PROT:HIGH?" },
+ { SCPI_CMD_SET_OVER_CURRENT_PROTECTION_THRESHOLD, ":SOUR:CURR:PROT:HIGH %.6f" },
+ ALL_ZERO
+};
+
+static int chroma_62000p_probe_channels(struct sr_dev_inst *sdi,
+ struct sr_scpi_hw_info *hw_info,
+ struct channel_spec **channels, unsigned int *num_channels,
+ struct channel_group_spec **channel_groups,
+ unsigned int *num_channel_groups)
+{
+ unsigned int volts, amps, watts;
+ struct channel_spec *channel;
+
+ (void)sdi;
+
+ sscanf(hw_info->model, "620%uP-%u-%u", &watts, &volts, &s);
+ watts *= 100;
+ sr_dbg("Found device rated for %d V, %d A and %d W", volts, amps, watts);
+
+ if (volts > 600) {
+ sr_err("Probed max voltage of %u V is out of spec.", volts);
+ return SR_ERR_BUG;
+ }
+
+ if (amps > 120) {
+ sr_err("Probed max current of %u A is out of spec.", amps);
+ return SR_ERR_BUG;
+ }
+
+ if (watts > 5000) {
+ sr_err("Probed max power of %u W is out of spec.", watts);
+ return SR_ERR_BUG;
+ }
+
+ channel = g_malloc0(sizeof(struct channel_spec));
+ channel->name = "1";
+ channel->voltage[0] = channel->current[0] = channel->power[0] = 0.0;
+ channel->voltage[1] = (float)volts;
+ channel->current[1] = (float)amps;
+ channel->power[1] = (float)watts;
+ channel->voltage[2] = channel->current[2] = 0.01;
+ channel->voltage[3] = channel->voltage[4] = 3;
+ channel->current[3] = channel->current[4] = 4;
+ *channels = channel;
+ *num_channels = 1;
+
+ *channel_groups = g_malloc(sizeof(struct channel_group_spec));
+ **channel_groups = chroma_62000_cg[0];
+ *num_channel_groups = 1;
+
+ return SR_OK;
+}
+