X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fhantek-4032l%2Fprotocol.h;h=f0e46d376ea1f66cdef1db9fb4cf5e0e5733e5d5;hb=ed787682255cdecbb3ba8cefc87c20182b97ce7b;hp=6725983aa4cee102dea973a01984c813f76e227f;hpb=f49065c6682b720800e05e8e2821a193b251d65a;p=libsigrok.git diff --git a/src/hardware/hantek-4032l/protocol.h b/src/hardware/hantek-4032l/protocol.h index 6725983a..f0e46d37 100644 --- a/src/hardware/hantek-4032l/protocol.h +++ b/src/hardware/hantek-4032l/protocol.h @@ -39,6 +39,15 @@ #define H4043L_NUM_SAMPLES_MIN (2 * 1024) #define H4032L_NUM_SAMPLES_MAX (64 * 1024 * 1024) +#define H4032L_THR_VOLTAGE_MIN -6.0 +#define H4032L_THR_VOLTAGE_MAX 6.0 +#define H4032L_THR_VOLTAGE_STEP 0.1 +/* + * Array index of the default voltage threshold value (2.5V): + * (|min| / step) + (default / step) = (|-6.0| / 0.1) + (2.5 / 0.1) = 85 + */ +#define H4032L_THR_VOLTAGE_DEFAULT 85 + #define H4032L_CMD_PKT_MAGIC 0x017f #define H4032L_STATUS_PACKET_MAGIC 0x2B1A037F #define H4032L_START_PACKET_MAGIC 0x2B1A027F @@ -154,7 +163,7 @@ struct dev_context { struct h4032l_cmd_pkt cmd_pkt; unsigned int num_transfers; struct libusb_transfer **transfers; - uint8_t buffer[512]; + uint8_t buf[512]; uint64_t capture_ratio; uint32_t trigger_pos; gboolean external_clock;