]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/serial-dmm/protocol.h
serial-dmm: Added support for Metex ME-21 multimeters
[libsigrok.git] / src / hardware / serial-dmm / protocol.h
index 8c21f9d975847dcce16cde3eb5866cef45b70edb..0713f5cfcacfcce887a218c6917e8523c6afe0ee 100644 (file)
@@ -29,34 +29,41 @@ struct dmm_info {
        const char *vendor;
        /** Model. */
        const char *device;
-       /** serialconn string. */
+       /** conn string. */
        const char *conn;
-       /** Baud rate. */
-       uint32_t baudrate;
+       /** serialcomm string. */
+       const char *serialcomm;
        /** Packet size in bytes. */
        int packet_size;
-       /** Request timeout [ms] before request is considered lost and a new
-        *  one is sent. Used only if device needs polling. */
+       /**
+        * Request timeout [ms] before request is considered lost and a new
+        * one is sent. Used only if device needs polling.
+        */
        int64_t req_timeout_ms;
-       /** Delay between reception of packet and next request. Some DMMs
-        *  need this. Used only if device needs polling. */
+       /**
+        * Delay between reception of packet and next request. Some DMMs
+        * need this. Used only if device needs polling.
+        */
        int64_t req_delay_ms;
        /** Packet request function. */
        int (*packet_request)(struct sr_serial_dev_inst *);
+       /** Number of channels / displays. */
+       size_t channel_count;
+       /** (Optional) printf formats for channel names. */
+       const char **channel_formats;
        /** Packet validation function. */
        gboolean (*packet_valid)(const uint8_t *);
        /** Packet parsing function. */
        int (*packet_parse)(const uint8_t *, float *,
-                           struct sr_datafeed_analog_old *, void *);
+                           struct sr_datafeed_analog *, void *);
        /** */
-       void (*dmm_details)(struct sr_datafeed_analog_old *, void *);
+       void (*dmm_details)(struct sr_datafeed_analog *, void *);
        /** Size of chipset info struct. */
        gsize info_size;
 };
 
 #define DMM_BUFSIZE 256
 
-/** Private, per-device-instance driver context. */
 struct dev_context {
        struct sr_sw_limits limits;
 
@@ -64,8 +71,10 @@ struct dev_context {
        int bufoffset;
        int buflen;
 
-       /** The timestamp [µs] to send the next request.
-        *  Used only if device needs polling. */
+       /**
+        * The timestamp [µs] to send the next request.
+        * Used only if device needs polling.
+        */
        int64_t req_next_at;
 };