]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/scpi-pps/profiles.c
scpi-pps: Add SR_CONF_REGULATION for HP 66xxA power supplies.
[libsigrok.git] / src / hardware / scpi-pps / profiles.c
index ef1a12ad13abe59a046eafc45e3521c3c9f1cbf1..efec3ce9b49bcfd8e5443296c99f0ac6d4237e67 100644 (file)
@@ -48,7 +48,7 @@ static const uint32_t agilent_n5700a_devopts_cg[] = {
 };
 
 static const struct channel_group_spec agilent_n5700a_cg[] = {
-       { "1", CH_IDX(0), PPS_OVP | PPS_OCP },
+       { "1", CH_IDX(0), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
 };
 
 static const struct channel_spec agilent_n5767a_ch[] = {
@@ -109,9 +109,9 @@ static const struct channel_spec bk_9130_ch[] = {
 };
 
 static const struct channel_group_spec bk_9130_cg[] = {
-       { "1", CH_IDX(0), PPS_OVP },
-       { "2", CH_IDX(1), PPS_OVP },
-       { "3", CH_IDX(2), PPS_OVP },
+       { "1", CH_IDX(0), PPS_OVP, SR_MQFLAG_DC },
+       { "2", CH_IDX(1), PPS_OVP, SR_MQFLAG_DC },
+       { "3", CH_IDX(2), PPS_OVP, SR_MQFLAG_DC },
 };
 
 static const struct scpi_command bk_9130_cmd[] = {
@@ -156,7 +156,7 @@ static const struct channel_spec chroma_61604_ch[] = {
 };
 
 static const struct channel_group_spec chroma_61604_cg[] = {
-       { "1", CH_IDX(0), PPS_OVP | PPS_OCP },
+       { "1", CH_IDX(0), PPS_OVP | PPS_OCP, SR_MQFLAG_AC },
 };
 
 static const struct scpi_command chroma_61604_cmd[] = {
@@ -199,7 +199,7 @@ static const uint32_t chroma_62000_devopts_cg[] = {
 };
 
 static const struct channel_group_spec chroma_62000_cg[] = {
-       { "1", CH_IDX(0), PPS_OVP | PPS_OCP },
+       { "1", CH_IDX(0), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
 };
 
 static const struct scpi_command chroma_62000_cmd[] = {
@@ -305,7 +305,7 @@ static const struct channel_spec rigol_dp712_ch[] = {
 };
 
 static const struct channel_group_spec rigol_dp700_cg[] = {
-       { "1", CH_IDX(0), PPS_OVP | PPS_OCP },
+       { "1", CH_IDX(0), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
 };
 
 /* Same as the DP800 series, except for the missing :SYST:OTP* commands. */
@@ -383,14 +383,14 @@ static const struct channel_spec rigol_dp832_ch[] = {
 };
 
 static const struct channel_group_spec rigol_dp820_cg[] = {
-       { "1", CH_IDX(0), PPS_OVP | PPS_OCP },
-       { "2", CH_IDX(1), PPS_OVP | PPS_OCP },
+       { "1", CH_IDX(0), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
+       { "2", CH_IDX(1), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
 };
 
 static const struct channel_group_spec rigol_dp830_cg[] = {
-       { "1", CH_IDX(0), PPS_OVP | PPS_OCP },
-       { "2", CH_IDX(1), PPS_OVP | PPS_OCP },
-       { "3", CH_IDX(2), PPS_OVP | PPS_OCP },
+       { "1", CH_IDX(0), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
+       { "2", CH_IDX(1), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
+       { "3", CH_IDX(2), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
 };
 
 static const struct scpi_command rigol_dp800_cmd[] = {
@@ -429,7 +429,7 @@ static const struct scpi_command rigol_dp800_cmd[] = {
        ALL_ZERO
 };
 
-/* HP 663xx series */
+/* HP 663xA series */
 static const uint32_t hp_6630a_devopts[] = {
        SR_CONF_CONTINUOUS,
        SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
@@ -444,8 +444,32 @@ static const uint32_t hp_6630a_devopts_cg[] = {
        SR_CONF_CURRENT_LIMIT | SR_CONF_SET | SR_CONF_LIST,
        SR_CONF_OVER_VOLTAGE_PROTECTION_THRESHOLD | SR_CONF_SET | SR_CONF_LIST,
        SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_SET,
+       SR_CONF_REGULATION | SR_CONF_GET,
+};
+
+static const struct channel_spec hp_6633a_ch[] = {
+       { "1", { 0, 51.188, 0.0125, 3, 4 }, { 0, 2.0475, 0.0005, 4, 5 }, { 0, 104.80743 }, FREQ_DC_ONLY, { 0, 55, 0.25 }, NO_OCP_LIMITS },
 };
 
+static const struct channel_group_spec hp_6630a_cg[] = {
+       { "1", CH_IDX(0), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
+};
+
+static const struct scpi_command hp_6630a_cmd[] = {
+       { SCPI_CMD_SET_OUTPUT_ENABLE, "OUT 1" },
+       { SCPI_CMD_SET_OUTPUT_DISABLE, "OUT 0" },
+       { SCPI_CMD_GET_MEAS_VOLTAGE, "VOUT?" },
+       { SCPI_CMD_GET_MEAS_CURRENT, "IOUT?" },
+       { SCPI_CMD_SET_VOLTAGE_TARGET, "VSET %.4f" },
+       { SCPI_CMD_SET_CURRENT_LIMIT, "ISET %.4f" },
+       { SCPI_CMD_SET_OVER_CURRENT_PROTECTION_ENABLE, "OCP 1" },
+       { SCPI_CMD_SET_OVER_CURRENT_PROTECTION_DISABLE, "OCP 0" },
+       { SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_THRESHOLD, "OVSET %.4f" },
+       { SCPI_CMD_GET_OUTPUT_REGULATION, "STS?" },
+       ALL_ZERO
+};
+
+/* HP 663xB series */
 static const uint32_t hp_6630b_devopts[] = {
        SR_CONF_CONTINUOUS,
        SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
@@ -466,10 +490,6 @@ static const uint32_t hp_6630b_devopts_cg[] = {
        SR_CONF_REGULATION | SR_CONF_GET,
 };
 
-static const struct channel_spec hp_6633a_ch[] = {
-       { "1", { 0, 51.188, 0.0125, 3, 4 }, { 0, 2.0475, 0.0005, 4, 5 }, { 0, 104.80743 }, FREQ_DC_ONLY, { 0, 55, 0.25 }, NO_OCP_LIMITS },
-};
-
 static const struct channel_spec hp_6631b_ch[] = {
        { "1", { 0, 8.19, 0.002, 3, 4 }, { 0, 10.237, 0.00263, 4, 5 }, { 0, 83.84103 }, FREQ_DC_ONLY, { 0, 12, 0.06 }, NO_OCP_LIMITS },
 };
@@ -490,21 +510,8 @@ static const struct channel_spec hp_6634b_ch[] = {
        { "1", { 0, 102.38, 0.025, 3, 4 }, { 0, 1.0238, 0.000263, 4, 5 }, { 0, 104.81664 }, FREQ_DC_ONLY, { 0, 110, 0.5 }, NO_OCP_LIMITS },
 };
 
-static const struct channel_group_spec hp_663xx_cg[] = {
-       { "1", CH_IDX(0), 0 },
-};
-
-static const struct scpi_command hp_6630a_cmd[] = {
-       { SCPI_CMD_SET_OUTPUT_ENABLE, "OUT 1" },
-       { SCPI_CMD_SET_OUTPUT_DISABLE, "OUT 0" },
-       { SCPI_CMD_GET_MEAS_VOLTAGE, "VOUT?" },
-       { SCPI_CMD_GET_MEAS_CURRENT, "IOUT?" },
-       { SCPI_CMD_SET_VOLTAGE_TARGET, "VSET %.4f" },
-       { SCPI_CMD_SET_CURRENT_LIMIT, "ISET %.4f" },
-       { SCPI_CMD_SET_OVER_CURRENT_PROTECTION_ENABLE, "OCP 1" },
-       { SCPI_CMD_SET_OVER_CURRENT_PROTECTION_DISABLE, "OCP 0" },
-       { SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_THRESHOLD, "OVSET %.4f" },
-       ALL_ZERO
+static const struct channel_group_spec hp_6630b_cg[] = {
+       { "1", CH_IDX(0), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
 };
 
 static const struct scpi_command hp_6630b_cmd[] = {
@@ -826,6 +833,7 @@ static int philips_pm2800_probe_channels(struct sr_dev_inst *sdi,
                (*channel_groups)[i].name = (char *)philips_pm2800_names[i];
                (*channel_groups)[i].channel_index_mask = 1 << i;
                (*channel_groups)[i].features = PPS_OTP | PPS_OVP | PPS_OCP;
+               (*channel_groups)[i].mqflags = SR_MQFLAG_DC;
        }
        *num_channels = *num_channel_groups = num_modules;
 
@@ -878,9 +886,9 @@ static const struct channel_spec rs_hmc8043_ch[] = {
 };
 
 static const struct channel_group_spec rs_hmc8043_cg[] = {
-       { "1", CH_IDX(0), PPS_OVP },
-       { "2", CH_IDX(1), PPS_OVP },
-       { "3", CH_IDX(2), PPS_OVP },
+       { "1", CH_IDX(0), PPS_OVP, SR_MQFLAG_DC },
+       { "2", CH_IDX(1), PPS_OVP, SR_MQFLAG_DC },
+       { "3", CH_IDX(2), PPS_OVP, SR_MQFLAG_DC },
 };
 
 static const struct scpi_command rs_hmc8043_cmd[] = {
@@ -969,7 +977,7 @@ SR_PRIV const struct scpi_pps pps_profiles[] = {
                ARRAY_AND_SIZE(hp_6630a_devopts),
                ARRAY_AND_SIZE(hp_6630a_devopts_cg),
                ARRAY_AND_SIZE(hp_6633a_ch),
-               ARRAY_AND_SIZE(hp_663xx_cg),
+               ARRAY_AND_SIZE(hp_6630a_cg),
                hp_6630a_cmd,
                .probe_channels = NULL,
                .init_aquisition = NULL,
@@ -977,11 +985,11 @@ SR_PRIV const struct scpi_pps pps_profiles[] = {
        },
 
        /* HP 6631B */
-       { "HP", "6631B", SCPI_DIALECT_HP_66XXB, PPS_OVP | PPS_OCP | PPS_OTP,
+       { "HP", "6631B", SCPI_DIALECT_HP_66XXB, PPS_OTP,
                ARRAY_AND_SIZE(hp_6630b_devopts),
                ARRAY_AND_SIZE(hp_6630b_devopts_cg),
                ARRAY_AND_SIZE(hp_6631b_ch),
-               ARRAY_AND_SIZE(hp_663xx_cg),
+               ARRAY_AND_SIZE(hp_6630b_cg),
                hp_6630b_cmd,
                .probe_channels = NULL,
                hp_6630b_init_aquisition,
@@ -989,11 +997,11 @@ SR_PRIV const struct scpi_pps pps_profiles[] = {
        },
 
        /* HP 6632B */
-       { "HP", "6632B", SCPI_DIALECT_HP_66XXB, PPS_OVP | PPS_OCP | PPS_OTP,
+       { "HP", "6632B", SCPI_DIALECT_HP_66XXB, PPS_OTP,
                ARRAY_AND_SIZE(hp_6630b_devopts),
                ARRAY_AND_SIZE(hp_6630b_devopts_cg),
                ARRAY_AND_SIZE(hp_6632b_ch),
-               ARRAY_AND_SIZE(hp_663xx_cg),
+               ARRAY_AND_SIZE(hp_6630b_cg),
                hp_6630b_cmd,
                .probe_channels = NULL,
                hp_6630b_init_aquisition,
@@ -1001,11 +1009,11 @@ SR_PRIV const struct scpi_pps pps_profiles[] = {
        },
 
        /* HP 66332A */
-       { "HP", "66332A", SCPI_DIALECT_HP_66XXB, PPS_OVP | PPS_OCP | PPS_OTP,
+       { "HP", "66332A", SCPI_DIALECT_HP_66XXB, PPS_OTP,
                ARRAY_AND_SIZE(hp_6630b_devopts),
                ARRAY_AND_SIZE(hp_6630b_devopts_cg),
                ARRAY_AND_SIZE(hp_66332a_ch),
-               ARRAY_AND_SIZE(hp_663xx_cg),
+               ARRAY_AND_SIZE(hp_6630b_cg),
                hp_6630b_cmd,
                .probe_channels = NULL,
                hp_6630b_init_aquisition,
@@ -1013,11 +1021,11 @@ SR_PRIV const struct scpi_pps pps_profiles[] = {
        },
 
        /* HP 6633B */
-       { "HP", "6633B", SCPI_DIALECT_HP_66XXB, PPS_OVP | PPS_OCP | PPS_OTP,
+       { "HP", "6633B", SCPI_DIALECT_HP_66XXB, PPS_OTP,
                ARRAY_AND_SIZE(hp_6630b_devopts),
                ARRAY_AND_SIZE(hp_6630b_devopts_cg),
                ARRAY_AND_SIZE(hp_6633b_ch),
-               ARRAY_AND_SIZE(hp_663xx_cg),
+               ARRAY_AND_SIZE(hp_6630b_cg),
                hp_6630b_cmd,
                .probe_channels = NULL,
                hp_6630b_init_aquisition,
@@ -1025,11 +1033,11 @@ SR_PRIV const struct scpi_pps pps_profiles[] = {
        },
 
        /* HP 6634B */
-       { "HP", "6634B", SCPI_DIALECT_HP_66XXB, PPS_OVP | PPS_OCP | PPS_OTP,
+       { "HP", "6634B", SCPI_DIALECT_HP_66XXB, PPS_OTP,
                ARRAY_AND_SIZE(hp_6630b_devopts),
                ARRAY_AND_SIZE(hp_6630b_devopts_cg),
                ARRAY_AND_SIZE(hp_6634b_ch),
-               ARRAY_AND_SIZE(hp_663xx_cg),
+               ARRAY_AND_SIZE(hp_6630b_cg),
                hp_6630b_cmd,
                .probe_channels = NULL,
                hp_6630b_init_aquisition,