]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/fx2lafw/protocol.h
fx2lafw: Add analog sampling handler
[libsigrok.git] / src / hardware / fx2lafw / protocol.h
index f1a93f99ecd560488336bc2887c8109065240e69..f6f87b0c965ea1da487626c08d34b20452cc8dbd 100644 (file)
 #define CMD_START                      0xb1
 #define CMD_GET_REVID_VERSION          0xb2
 
+#define CMD_START_FLAGS_CLK_CTL2_POS   4
 #define CMD_START_FLAGS_WIDE_POS       5
 #define CMD_START_FLAGS_CLK_SRC_POS    6
 
+#define CMD_START_FLAGS_CLK_CTL2       (1 << CMD_START_FLAGS_CLK_CTL2)
 #define CMD_START_FLAGS_SAMPLE_8BIT    (0 << CMD_START_FLAGS_WIDE_POS)
 #define CMD_START_FLAGS_SAMPLE_16BIT   (1 << CMD_START_FLAGS_WIDE_POS)
 
@@ -120,6 +122,10 @@ struct dev_context {
        unsigned int num_transfers;
        struct libusb_transfer **transfers;
        struct sr_context *ctx;
+       void (*send_data_proc)(struct dev_context *devc,
+               uint8_t *data, size_t length, size_t sample_width);
+       uint8_t *logic_buffer;
+       float *analog_buffer;
 
        /* Is this a DSLogic? */
        gboolean dslogic;
@@ -138,5 +144,9 @@ SR_PRIV void LIBUSB_CALL fx2lafw_receive_transfer(struct libusb_transfer *transf
 SR_PRIV size_t fx2lafw_get_buffer_size(struct dev_context *devc);
 SR_PRIV unsigned int fx2lafw_get_number_of_transfers(struct dev_context *devc);
 SR_PRIV unsigned int fx2lafw_get_timeout(struct dev_context *devc);
+SR_PRIV void la_send_data_proc(struct dev_context *devc, uint8_t *data, size_t length,
+               size_t sample_width);
+SR_PRIV void mso_send_data_proc(struct dev_context *devc, uint8_t *data, size_t length,
+               size_t sample_width);
 
 #endif