From: Timo Kokkonen Date: Mon, 5 Oct 2020 04:03:19 +0000 (-0700) Subject: hwdriver: New entries for DC Load "CW" (Power) and "CR" (Resitance) modes. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=34ce5b0439f0c162da795ba761b48c61517d8e93;p=libsigrok.git hwdriver: New entries for DC Load "CW" (Power) and "CR" (Resitance) modes. Added following new entries: - SR_CONF_POWER - SR_CONF_POWER_TARGET - SR_CONF_RESISTANCE_TARGET --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index cfff8bdf..02d1841a 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -1047,6 +1047,29 @@ enum sr_configkey { /** Duty cycle of a source signal. */ SR_CONF_DUTY_CYCLE, + /** + * Current power. + * @arg type: double + * @arg get: get measured power + */ + SR_CONF_POWER, + + /** + * Power target. + * @arg type: double + * @arg get: get power target + * @arg set: change power target + */ + SR_CONF_POWER_TARGET, + + /** + * Resistance target. + * @arg type: double + * @arg get: get resistance target + * @arg set: change resistance target + */ + SR_CONF_RESISTANCE_TARGET, + /* Update sr_key_info_config[] (hwdriver.c) upon changes! */ /*--- Special stuff -------------------------------------------------*/ diff --git a/src/hwdriver.c b/src/hwdriver.c index f8d54ac8..349e65e9 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -205,6 +205,12 @@ static struct sr_key_info sr_key_info_config[] = { "Phase", NULL}, {SR_CONF_DUTY_CYCLE, SR_T_FLOAT, "output_duty_cycle", "Duty Cycle", NULL}, + {SR_CONF_POWER, SR_T_FLOAT, "power", + "Power", NULL}, + {SR_CONF_POWER_TARGET, SR_T_FLOAT, "power_target", + "Power Target", NULL}, + {SR_CONF_RESISTANCE_TARGET, SR_T_FLOAT, "resistance_target", + "Resistance Target", NULL}, /* Special stuff */ {SR_CONF_SESSIONFILE, SR_T_STRING, "sessionfile",