static int hp_6630a_init_acquisition(const struct sr_dev_inst *sdi)
{
struct sr_scpi_dev_inst *scpi;
- int ret;
scpi = sdi->conn;
* Monitor CV (1), CC+ (2), UR (4), OVP (8), OTP (16), OCP (64) and
* CC- (256) bits of the Status Register for the FAULT? query.
*/
- ret = sr_scpi_send(scpi, "UNMASK 607");
- if (ret != SR_OK)
- return ret;
-
- return SR_OK;
+ return sr_scpi_send(scpi, "UNMASK 607");
}
static int hp_6630a_update_status(const struct sr_dev_inst *sdi)
regulation_changed = (fault & (1 << 9)) | regulation_changed;
if (regulation_changed) {
- if (cv && !cc_pos && !cc_neg &&!unreg)
+ if (cv && !cc_pos && !cc_neg && !unreg)
regulation = "CV";
else if (cc_pos && !cv && !cc_neg && !unreg)
regulation = "CC";
regulation = "CC-";
else if (unreg && !cv && !cc_pos && !cc_neg)
regulation = "UR";
- else if (!cv && !cc_pos && !cc_neg &&!unreg)
+ else if (!cv && !cc_pos && !cc_neg && !unreg)
regulation = "";
else {
sr_dbg("Undefined regulation for HP 66xxA "
{ "1", { 0, 20.475, 0.005, 3, 4 }, { 0, 5.1188, 0.00132, 4, 5 }, { 0, 104.80743 }, FREQ_DC_ONLY, { 0, 22, 0.1 }, NO_OCP_LIMITS },
};
+static const struct channel_spec hp_66312a_ch[] = {
+ { "1", { 0, 20.475, 0.0001, 4, 5 }, { 0, 2.0475, 0.0001, 4, 5 }, { 0, 41.92256 }, FREQ_DC_ONLY, { 0, 22, 0.01 }, NO_OCP_LIMITS },
+};
+
static const struct channel_spec hp_66332a_ch[] = {
{ "1", { 0, 20.475, 0.005, 3, 4 }, { 0, 5.1188, 0.00132, 4, 5 }, { 0, 104.80743 }, FREQ_DC_ONLY, { 0, 22, 0.1 }, NO_OCP_LIMITS },
};
/*
* Check if output state has changed, due to one of the
* questionable states changed.
- * NOTE: The output state is send even if it hasn't changed, but that
- * only happends rarely.
+ * NOTE: The output state is sent even if it hasn't changed,
+ * but that only happens rarely.
*/
ret = sr_scpi_get_bool(scpi, "OUTP:STAT?", &output_enabled);
if (ret != SR_OK)
}
if (regulation_changed) {
- if (cv && !cc_pos && !cc_neg &&!unreg)
+ if (cv && !cc_pos && !cc_neg && !unreg)
regulation = "CV";
else if (cc_pos && !cv && !cc_neg && !unreg)
regulation = "CC";
regulation = "CC-";
else if (unreg && !cv && !cc_pos && !cc_neg)
regulation = "UR";
- else if (!cv && !cc_pos && !cc_neg &&!unreg)
- /* This happends in case of OCP active */
+ else if (!cv && !cc_pos && !cc_neg && !unreg)
+ /* This happens in case of OCP active. */
regulation = "";
else {
- /* This happends from time to time (CV and CC+ active). */
+ /* This happens from time to time (CV and CC+ active). */
sr_dbg("Undefined regulation for HP 66xxB "
"(CV=%i, CC+=%i, CC-=%i, UR=%i).",
cv, cc_pos, cc_neg, unreg);
hp_6630b_update_status,
},
+ /* HP 66312A */
+ { "HP", "66312A", SCPI_DIALECT_HP_66XXB, PPS_OTP,
+ ARRAY_AND_SIZE(hp_6630b_devopts),
+ ARRAY_AND_SIZE(hp_6630b_devopts_cg),
+ ARRAY_AND_SIZE(hp_66312a_ch),
+ ARRAY_AND_SIZE(hp_6630b_cg),
+ hp_6630b_cmd,
+ .probe_channels = NULL,
+ hp_6630b_init_acquisition,
+ hp_6630b_update_status,
+ },
+
/* HP 66332A */
{ "HP", "66332A", SCPI_DIALECT_HP_66XXB, PPS_OTP,
ARRAY_AND_SIZE(hp_6630b_devopts),