X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fyokogawa-dlm%2Fprotocol.h;h=0bdb7f2f58f1add1595ce8f6d8fe2fb8c2210d61;hb=329733d92c5004f0fe308eff26b9537fded2cdf3;hp=54b087cdccc8d7104a129cb25496084cd37d7ceb;hpb=8ab929d614262dc446ee2e948ca583d31110b14b;p=libsigrok.git diff --git a/src/hardware/yokogawa-dlm/protocol.h b/src/hardware/yokogawa-dlm/protocol.h index 54b087cd..0bdb7f2f 100644 --- a/src/hardware/yokogawa-dlm/protocol.h +++ b/src/hardware/yokogawa-dlm/protocol.h @@ -33,13 +33,14 @@ #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?). */ #define DLM_DIVISION_FOR_WORD_FORMAT (3200) #define DLM_DIVISION_FOR_BYTE_FORMAT (12.5) - enum trigger_slopes { SLOPE_POSITIVE, SLOPE_NEGATIVE @@ -55,11 +56,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 +78,6 @@ struct scope_config { const uint8_t num_xdivs; const uint8_t num_ydivs; - - const char *(*scpi_dialect)[]; }; struct analog_channel_state { @@ -101,11 +100,12 @@ struct scope_state { int trigger_source; int trigger_slope; uint64_t sample_rate; + uint32_t samples_per_frame; }; /** Private, per-device-instance driver context. */ struct dev_context { - void *model_config; + const void *model_config; void *model_state; struct sr_channel_group **analog_groups; @@ -116,6 +116,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 +133,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