]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/yokogawa-dlm/protocol.h
Consistently use 'devopts' variable across all drivers.
[libsigrok.git] / src / hardware / yokogawa-dlm / protocol.h
index 54b087cdccc8d7104a129cb25496084cd37d7ceb..d38620f8665dfe17664855d1cb31bf01191fbf9d 100644 (file)
@@ -33,6 +33,8 @@
 #define LOG_PREFIX "yokogawa-dlm"
 #define MAX_INSTRUMENT_VERSIONS 4
 
+#define RECEIVE_BUFFER_SIZE (4096)
+
 /* See Communication Interface User's Manual on p. 268 (:WAVeform:ALL:SEND?). */
 #define DLM_MAX_FRAME_LENGTH (12500)
 /* See Communication Interface User's Manual on p. 269 (:WAVeform:SEND?). */
@@ -55,11 +57,11 @@ struct scope_config {
        const char *(*analog_names)[];
        const char *(*digital_names)[];
 
-       const int32_t (*hw_caps)[];
-       const uint8_t num_hwcaps;
+       const uint32_t (*devopts)[];
+       const uint8_t num_devopts;
 
-       const int32_t (*analog_hwcaps)[];
-       const uint8_t num_analog_hwcaps;
+       const uint32_t (*analog_devopts)[];
+       const uint8_t num_analog_devopts;
 
        const char *(*coupling_options)[];
        const uint8_t num_coupling_options;
@@ -77,8 +79,6 @@ struct scope_config {
 
        const uint8_t num_xdivs;
        const uint8_t num_ydivs;
-
-       const char *(*scpi_dialect)[];
 };
 
 struct analog_channel_state {
@@ -101,6 +101,7 @@ struct scope_state {
        int trigger_source;
        int trigger_slope;
        uint64_t sample_rate;
+       uint32_t samples_per_frame;
 };
 
 /** Private, per-device-instance driver context. */
@@ -116,6 +117,9 @@ struct dev_context {
        uint64_t num_frames;
 
        uint64_t frame_limit;
+
+       char receive_buffer[RECEIVE_BUFFER_SIZE];
+       gboolean data_pending;
 };
 
 /*--- api.c -----------------------------------------------------------------*/
@@ -130,4 +134,6 @@ SR_PRIV void dlm_scope_state_destroy(struct scope_state *state);
 SR_PRIV int dlm_scope_state_query(struct sr_dev_inst *sdi);
 SR_PRIV int dlm_sample_rate_query(const struct sr_dev_inst *sdi);
 
+SR_PRIV int dlm_channel_data_request(const struct sr_dev_inst *sdi);
+
 #endif