]> sigrok.org Git - libsigrok.git/blobdiff - src/analog.c
Add filename field to sr_output and make it accessible
[libsigrok.git] / src / analog.c
index 9e01566f8799b1e572d2e188e324391696b00569..10c4c1c7ac25ff145dbab628d14135e2a33753a2 100644 (file)
 #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;
+}
+
+/** @} */