X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fanalog.c;h=10c4c1c7ac25ff145dbab628d14135e2a33753a2;hb=7637cc60ba0201202eec98f66d8494e6ba3d53bd;hp=9e01566f8799b1e572d2e188e324391696b00569;hpb=a9b2283fd038a2a8c3e2dc1ede4fcc51d5e62c7c;p=libsigrok.git diff --git a/src/analog.c b/src/analog.c index 9e01566f..10c4c1c7 100644 --- a/src/analog.c +++ b/src/analog.c @@ -24,7 +24,23 @@ #include "libsigrok.h" #include "libsigrok-internal.h" +/** @cond PRIVATE */ #define LOG_PREFIX "analog" +/** @endcond */ + +/** + * @file + * + * Handling and converting analog data. + */ + +/** + * @defgroup grp_analog Analog data handling + * + * Handling and converting analog data. + * + * @{ + */ struct unit_mq_string { uint64_t value; @@ -229,3 +245,16 @@ SR_API int sr_analog_unit_to_string(const struct sr_datafeed_analog2 *analog, return SR_OK; } +/* + * Set sr_rational r to the given value. + * + * @param p Numerator + * @param q Denominator + */ +SR_API void sr_rational_set(struct sr_rational *r, uint64_t p, uint64_t q) +{ + r->p = p; + r->q = q; +} + +/** @} */