From: Frank Stettner Date: Mon, 27 Jul 2020 17:54:06 +0000 (+0200) Subject: libsigrok.h: Add Joule, Coulomb, and Ah units. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fe8c5aef1ffdadd45b31eecc84201ed3ed5402b7;p=libsigrok.git libsigrok.h: Add Joule, Coulomb, and Ah units. Also extend a comment on energy in comparison to power. --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 0b06cb7c..c16278c4 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -294,7 +294,7 @@ enum sr_unit { SR_UNIT_VOLT_AMPERE, /** Real power [W]. */ SR_UNIT_WATT, - /** Consumption [Wh]. */ + /** Energy (consumption) in watt hour [Wh]. */ SR_UNIT_WATT_HOUR, /** Wind speed in meters per second. */ SR_UNIT_METER_SECOND, @@ -328,6 +328,12 @@ enum sr_unit { SR_UNIT_TOLA, /** Pieces (number of items). */ SR_UNIT_PIECE, + /** A relative unit of (power) measurement [dB]. */ + SR_UNIT_JOULE, + /** Electric charge in coulomb. */ + SR_UNIT_COULOMB, + /** Electric charge in ampere hour [Ah]. */ + SR_UNIT_AMPERE_HOUR, /* * Update unit_strings[] (analog.c) and fancyprint() (output/analog.c) diff --git a/src/analog.c b/src/analog.c index a471f642..2a8e8d90 100644 --- a/src/analog.c +++ b/src/analog.c @@ -88,6 +88,9 @@ static struct unit_mq_string unit_strings[] = { { SR_UNIT_MOMME, "momme" }, { SR_UNIT_TOLA, "tola" }, { SR_UNIT_PIECE, "pcs" }, + { SR_UNIT_JOULE, "J" }, + { SR_UNIT_COULOMB, "C" }, + { SR_UNIT_AMPERE_HOUR, "Ah" }, ALL_ZERO };