]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/kingst-la2016/protocol.h
kingst-la2016: renames to better reflect sequence of activities
[libsigrok.git] / src / hardware / kingst-la2016 / protocol.h
index 6d3cf2641cae298f8ba67af3c70f6e73effc10b7..c396d036c446d2f547cac6345018f966347f1bd6 100644 (file)
 
 #define LA2016_VID             0x77a1
 #define LA2016_PID             0x01a2
+#define LA2016_IPRODUCT_INDEX  2
 #define USB_INTERFACE          0
 #define USB_CONFIGURATION      1
+#define USB_EP_FPGA_BITSTREAM  2
+#define USB_EP_CAPTURE_DATA    6
 
 /*
  * On Windows sigrok uses WinUSB RAW_IO policy which requires the
 #define LA2016_NUM_SAMPLES_MIN 256
 #define LA2016_NUM_SAMPLES_MAX (10UL * 1000 * 1000 * 1000)
 
+#define LA2016_NUM_PWMCH_MAX   2
+
+#define LA2016_CONVBUFFER_SIZE (4 * 1024 * 1024)
+
 typedef struct pwm_setting_dev {
        uint32_t period;
        uint32_t duty;
@@ -101,7 +108,7 @@ struct dev_context {
        uint64_t fw_uploaded;
 
        /* User specified parameters. */
-       pwm_setting_t pwm_setting[2];
+       pwm_setting_t pwm_setting[LA2016_NUM_PWMCH_MAX];
        unsigned int threshold_voltage_idx;
        float threshold_voltage;
        uint64_t max_samplerate;
@@ -109,20 +116,16 @@ struct dev_context {
        uint64_t limit_samples;
        uint64_t capture_ratio;
        uint16_t cur_channels;
-       int num_channels;
-
-       /* Values derived from user specs. */
-       uint64_t pre_trigger_size;
 
        /* Internal acquisition and download state. */
-       int had_triggers_configured;
-       int have_trigger;
-       int transfer_finished;
+       gboolean trigger_involved;
+       gboolean completion_seen;
+       gboolean download_finished;
        capture_info_t info;
        unsigned int n_transfer_packets_to_read; /* each with 5 acq packets */
        unsigned int n_bytes_to_read;
        unsigned int n_reps_until_trigger;
-       unsigned int reading_behind_trigger;
+       gboolean trigger_marked;
        uint64_t total_samples;
        uint32_t read_pos;