From: Marc Schink Date: Thu, 20 Apr 2023 17:21:13 +0000 (+0200) Subject: hwdriver: Add SR_CONF_OVER_CURRENT_PROTECTION_DELAY X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1ebdf6406682edb25cd4929638c24391bec8e5f6;p=libsigrok.git hwdriver: Add SR_CONF_OVER_CURRENT_PROTECTION_DELAY This config key allows to specify the delay before the over-current protection triggers. Signed-off-by: Marc Schink --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 58216c2c..6c5dea08 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -1129,6 +1129,14 @@ enum sr_configkey { */ SR_CONF_RESISTANCE_TARGET, + /** + * Over-current protection (OCP) delay + * @arg type: double (time) + * @arg get: get current delay + * @arg set: set new delay + */ + SR_CONF_OVER_CURRENT_PROTECTION_DELAY, + /* Update sr_key_info_config[] (hwdriver.c) upon changes! */ /*--- Special stuff -------------------------------------------------*/ diff --git a/src/hwdriver.c b/src/hwdriver.c index 7b497e07..068a215a 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -214,6 +214,8 @@ static struct sr_key_info sr_key_info_config[] = { "Power Target", NULL}, {SR_CONF_RESISTANCE_TARGET, SR_T_FLOAT, "resistance_target", "Resistance Target", NULL}, + {SR_CONF_OVER_CURRENT_PROTECTION_DELAY, SR_T_FLOAT, "ocp_delay", + "Over-current protection delay", NULL}, /* Special stuff */ {SR_CONF_SESSIONFILE, SR_T_STRING, "sessionfile",