]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/kingst-la2016/protocol.h
kingst-la2016: add PWM channel groups, announce as signal generator
[libsigrok.git] / src / hardware / kingst-la2016 / protocol.h
index 2569da50d5e72b9b6a026cf019b73c5d074305cc..dae057ef3e970e91266e3cbb6fe34a437e11fc9b 100644 (file)
@@ -88,22 +88,6 @@ struct kingst_model {
        uint64_t memory_bits;   /* RAM capacity in Gbit (1, 2, 4). */
 };
 
-struct trigger_cfg {
-       uint32_t channels;
-       uint32_t enabled;
-       uint32_t level;
-       uint32_t high_or_falling;
-};
-
-struct capture_info {
-       uint32_t n_rep_packets;
-       uint32_t n_rep_packets_before_trigger;
-       uint32_t write_pos;
-};
-
-#define NUM_PACKETS_IN_CHUNK   5
-#define TRANSFER_PACKET_LENGTH 16
-
 struct dev_context {
        uint16_t usb_pid;
        char *mcu_firmware;
@@ -111,6 +95,7 @@ struct dev_context {
        uint64_t fw_uploaded; /* Timestamp of most recent FW upload. */
        uint8_t identify_magic;
        const struct kingst_model *model;
+       struct sr_channel_group *cg_logic, *cg_pwm;
 
        /* User specified parameters. */
        struct pwm_setting {
@@ -128,7 +113,11 @@ struct dev_context {
        gboolean trigger_involved;
        gboolean completion_seen;
        gboolean download_finished;
-       struct capture_info info;
+       struct capture_info {
+               uint32_t n_rep_packets;
+               uint32_t n_rep_packets_before_trigger;
+               uint32_t write_pos;
+       } info;
        uint32_t n_transfer_packets_to_read; /* each with 5 acq packets */
        uint32_t n_bytes_to_read;
        uint32_t n_reps_until_trigger;