X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fkingst-la2016%2Fprotocol.h;h=6d3cf2641cae298f8ba67af3c70f6e73effc10b7;hb=b0d0131eff8bacbf69aa0da818efaa4439f19a64;hp=cc5776f7dfd311b617018d38a78ffc9a28e4bbbb;hpb=96dc954e1c17a34daafcccb0a6013873d7ec9ee4;p=libsigrok.git diff --git a/src/hardware/kingst-la2016/protocol.h b/src/hardware/kingst-la2016/protocol.h index cc5776f7..6d3cf264 100644 --- a/src/hardware/kingst-la2016/protocol.h +++ b/src/hardware/kingst-la2016/protocol.h @@ -43,9 +43,26 @@ #define LA2016_EP6_PKTSZ 512 /* Max packet size of USB endpoint 6. */ #define LA2016_USB_BUFSZ (256 * 2 * LA2016_EP6_PKTSZ) /* 256KiB buffer. */ -#define MAX_RENUM_DELAY_MS 3000 +/* USB communication timeout during regular operation. */ #define DEFAULT_TIMEOUT_MS 200 +/* + * Check for MCU firmware to take effect after upload. Check the device + * presence for a maximum period of time, delay between checks in that + * phase. Allow for the device to vanish after upload and before checks, + * to not mistake its earlier incarnation for the successful operation + * of the most recently loaded firmware. + */ +#define RENUM_CHECK_PERIOD_MS 3000 +#define RENUM_GONE_DELAY_MS 1800 +#define RENUM_POLL_INTERVAL_MS 200 + +/* + * The device expects some zero padding to follow the content of the + * file which contains the FPGA bitstream. Specify the chunk size here. + */ +#define LA2016_EP2_PADDING 2048 + #define LA2016_THR_VOLTAGE_MIN 0.40 #define LA2016_THR_VOLTAGE_MAX 4.00 @@ -81,8 +98,7 @@ typedef struct pwm_setting { struct dev_context { struct sr_context *ctx; - - int64_t fw_updated; + uint64_t fw_uploaded; /* User specified parameters. */ pwm_setting_t pwm_setting[2]; @@ -95,8 +111,6 @@ struct dev_context { uint16_t cur_channels; int num_channels; - uint32_t bitstream_size; - /* Values derived from user specs. */ uint64_t pre_trigger_size; @@ -117,7 +131,8 @@ struct dev_context { struct libusb_transfer *transfer; }; -SR_PRIV int la2016_upload_firmware(struct sr_context *sr_ctx, libusb_device *dev, uint16_t product_id); +SR_PRIV int la2016_upload_firmware(struct sr_context *sr_ctx, + libusb_device *dev, uint16_t product_id); SR_PRIV int la2016_setup_acquisition(const struct sr_dev_inst *sdi); SR_PRIV int la2016_start_acquisition(const struct sr_dev_inst *sdi); SR_PRIV int la2016_abort_acquisition(const struct sr_dev_inst *sdi);