X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhantek-dso%2Fprotocol.h;h=21131613144c3d4dd82480c2ff26746720f9154e;hb=a4be2b327be8b6a38fe024e2a3ee614243067762;hp=71f62e7dc5f8f63e0ab69101003c99ac9533243d;hpb=87f56d017858cfa2d8639f4f4683bb6bed24d695;p=libsigrok.git diff --git a/src/hardware/hantek-dso/protocol.h b/src/hardware/hantek-dso/protocol.h index 71f62e7d..21131613 100644 --- a/src/hardware/hantek-dso/protocol.h +++ b/src/hardware/hantek-dso/protocol.h @@ -37,9 +37,10 @@ #define DEFAULT_VOLTAGE VDIV_500MV #define DEFAULT_FRAMESIZE FRAMESIZE_SMALL #define DEFAULT_TIMEBASE TIME_100us +#define DEFAULT_SAMPLERATE SR_KHZ(10) #define DEFAULT_TRIGGER_SOURCE "CH1" #define DEFAULT_COUPLING COUPLING_DC -#define DEFAULT_HORIZ_TRIGGERPOS 0.5 +#define DEFAULT_CAPTURE_RATIO 100 #define DEFAULT_VERT_OFFSET 0.5 #define DEFAULT_VERT_TRIGGERPOS 0.5 @@ -51,7 +52,7 @@ /* All models have this for their "fast" mode. */ #define FRAMESIZE_SMALL (10 * 1024) -#define NUM_CHANNELS 2 +#define NUM_CHANNELS 2 enum control_requests { CTRL_READ_EEPROM = 0xa2, @@ -74,8 +75,10 @@ enum dso_commands { CMD_SET_LOGICALDATA = 0x8, CMD_GET_LOGICALDATA = 0x9, CMD__UNUSED1 = 0xa, - /* For the following and other specials please see - * http://openhantek.sourceforge.net/doc/namespaceHantek.html#ac1cd181814cf3da74771c29800b39028 */ + /* + * For the following and other specials please see + * http://openhantek.sourceforge.net/doc/namespaceHantek.html#ac1cd181814cf3da74771c29800b39028 + */ CMD_2250_SET_CHANNELS = 0xb, CMD_2250_SET_TRIGGERSOURCE = 0xc, CMD_2250_SET_RECORD_LENGTH = 0xd, @@ -138,7 +141,7 @@ enum capturestates { CAPTURE_EMPTY = 0, CAPTURE_FILLING = 1, CAPTURE_READY_8BIT = 2, - CAPTURE_READY2250 = 3, + CAPTURE_READY_2250 = 3, CAPTURE_READY_9BIT = 7, CAPTURE_TIMEOUT = 127, CAPTURE_UNKNOWN = 255, @@ -187,6 +190,7 @@ struct dev_context { int dev_state; /* Oscilloscope settings. */ + uint64_t samplerate; int timebase; gboolean ch_enabled[2]; int voltage[2]; @@ -200,7 +204,7 @@ struct dev_context { gboolean filter[2]; int triggerslope; char *triggersource; - float triggerposition; + uint64_t capture_ratio; int triggermode; /* Frame transfer */ @@ -220,5 +224,7 @@ SR_PRIV int dso_get_capturestate(const struct sr_dev_inst *sdi, SR_PRIV int dso_capture_start(const struct sr_dev_inst *sdi); SR_PRIV int dso_get_channeldata(const struct sr_dev_inst *sdi, libusb_transfer_cb_fn cb); +SR_PRIV int dso_set_trigger_samplerate(const struct sr_dev_inst *sdi); +SR_PRIV int dso_set_voffsets(const struct sr_dev_inst *sdi); #endif