OpenHantek
Hantek Namespace Reference

Data Structures

struct  CalibrationValues
 
struct  ControlAcquireHardData
 
class  ControlBeginCommand
 
struct  ControlGetLimits
 
class  ControlGetSpeed
 The CONTROL_GETSPEED parser. More...
 
struct  ControlSetCalFreq
 
struct  ControlSetCoupling
 
struct  ControlSetNumChannels
 
struct  ControlSetTimeDIV
 
struct  ControlSetVoltDIV_CH1
 
struct  ControlSetVoltDIV_CH2
 
struct  Offsets
 
struct  Steps
 

Enumerations

enum  RollState : int {
  RollState::STARTSAMPLING = 0, RollState::ENABLETRIGGER = 1, RollState::FORCETRIGGER = 2, RollState::GETDATA = 3,
  RollState::_COUNT
}
 The states of the roll cycle (Since capture state isn't valid). More...
 
enum  CaptureState {
  CAPTURE_WAITING = 0, CAPTURE_SAMPLING = 1, CAPTURE_READY = 2, CAPTURE_READY2250 = 3,
  CAPTURE_READY5200 = 7, CAPTURE_ERROR = 1000
}
 The different capture states which the oscilloscope returns. More...
 
enum  ControlCode : uint8_t {
  ControlCode::CONTROL_VALUE = 0xa2, ControlCode::CONTROL_GETSPEED = 0xb2, ControlCode::CONTROL_BEGINCOMMAND = 0xb3, ControlCode::CONTROL_SETOFFSET = 0xb4,
  ControlCode::CONTROL_SETRELAYS = 0xb5, ControlCode::CONTROL_SETVOLTDIV_CH1 = 0xe0, ControlCode::CONTROL_SETVOLTDIV_CH2 = 0xe1, ControlCode::CONTROL_SETTIMEDIV = 0xe2,
  ControlCode::CONTROL_ACQUIIRE_HARD_DATA = 0xe3, ControlCode::CONTROL_SETNUMCHANNELS = 0xe4, ControlCode::CONTROL_SETCOUPLING = 0xe5, ControlCode::CONTROL_SETCALFREQ = 0xe6
}
 All supported control commands. More...
 
enum  CommandIndex {
  COMMANDINDEX_0 = 0x03, COMMANDINDEX_1 = 0x0a, COMMANDINDEX_2 = 0x09, COMMANDINDEX_3 = 0x01,
  COMMANDINDEX_4 = 0x02, COMMANDINDEX_5 = 0x08
}
 Can be set by CONTROL_BEGINCOMMAND, maybe it allows multiple commands at the same time? More...
 
enum  ControlValue : uint8_t { ControlValue::VALUE_OFFSETLIMITS = 0x08, ControlValue::VALUE_DEVICEADDRESS = 0x0a, ControlValue::VALUE_FASTRATECALIBRATION = 0x60, ControlValue::VALUE_ETSCORRECTION = 0x70 }
 All supported values for control commands. VALUE_OFFSETLIMITS [MODEL_DSO2090, MODEL_DSO2150, MODEL_DSO2250, MODEL_DSO5200, MODEL_DSO5200A] More...
 
enum  UsedChannels : uint8_t { UsedChannels::USED_NONE, UsedChannels::USED_CH1, UsedChannels::USED_CH2, UsedChannels::USED_CH1CH2 }
 The enabled channels. More...
 

Enumeration Type Documentation

◆ CaptureState

The different capture states which the oscilloscope returns.

hantek/types.h

Enumerator
CAPTURE_WAITING 

The scope is waiting for a trigger event.

CAPTURE_SAMPLING 

The scope is sampling data after triggering.

CAPTURE_READY 

Sampling data is available (DSO-2090/DSO-2150)

CAPTURE_READY2250 

Sampling data is available (DSO-2250)

CAPTURE_READY5200 

Sampling data is available (DSO-5200/DSO-5200A)

CAPTURE_ERROR 

◆ CommandIndex

Can be set by CONTROL_BEGINCOMMAND, maybe it allows multiple commands at the same time?

Enumerator
COMMANDINDEX_0 

Used most of the time.

COMMANDINDEX_1 
COMMANDINDEX_2 
COMMANDINDEX_3 

Used for ::BulkCode::SETTRIGGERANDSAMPLERATE sometimes.

COMMANDINDEX_4 
COMMANDINDEX_5 

◆ ControlCode

enum Hantek::ControlCode : uint8_t
strong

All supported control commands.

All supported control commands. 0xE0 CONTROL_SETVOLTDIV_CH1 CH1 voltage div setting (6022BE/BL)

0xE1 CONTROL_SETVOLTDIV_CH2 CH2 voltage div setting (6022BE/BL)

CONTROL_SETTIMEDIV Time divisor setting (6022BE/BL)

CONTROL_ACQUIIRE_HARD_DATA Request sample data (6022BE/BL)

Oscilloscope Command bRequest Value Other Notes
Set CH0 voltage range 0xE0 Possible values: 1,2,5,10 (5V, 2.5V, 1V, 500mV).
Set CH1 voltage range 0xE1 Possible values: 1,2,5,10 (5V, 2.5V, 1V, 500mV).
Set Sampling Rate 0xE2 Possible values: 48, 30, 24, 16, 8, 4, 1 (MHz) and 50,20,10 (*10kHz).
Trigger Oscilloscope 0xE3 Possible values: 0: start sampling, 1: stop sampling
Set channel count 0xE4 Possible values are 1 (CH1 only) and 2 (CH1 and CH2)
Set Calibration Freq 0xE6 Possible values: 1, 2, 5, 10, 20, 50, 100 (kHz)
Possible values: 105 (50 Hz), 110 (100 Hz), 120 (200 Hz), 150 (500 Hz)
Read/Write Firmware 0xA0 Read or write the scope firmware. Must be done on scope initialization

The 0xEx requests are sent with value 0x00. The calibration commands are sent with value 0x08 (offset into eeprom). The value for R/W command is dependent on the Cypress protocol for interacting with the firmware.

A bulk read from end point 0x86 reads the current contents of the FIFO, which the ADC is filling.

CONTROL_SETVOLTDIV_CH1 CH1 voltage div setting (6022BE/BL)

CONTROL_SETVOLTDIV_CH2 CH2 voltage div setting (6022BE/BL)

CONTROL_SETTIMEDIV Time divisor setting (6022BE/BL)

CONTROL_ACQUIIRE_HARD_DATA Request sample data (6022BE/BL)

Enumerator
CONTROL_VALUE 
CONTROL_GETSPEED 
CONTROL_BEGINCOMMAND 
CONTROL_SETOFFSET 
CONTROL_SETRELAYS 
CONTROL_SETVOLTDIV_CH1 
CONTROL_SETVOLTDIV_CH2 
CONTROL_SETTIMEDIV 
CONTROL_ACQUIIRE_HARD_DATA 
CONTROL_SETNUMCHANNELS 
CONTROL_SETCOUPLING 
CONTROL_SETCALFREQ 

◆ ControlValue

enum Hantek::ControlValue : uint8_t
strong

All supported values for control commands. VALUE_OFFSETLIMITS [MODEL_DSO2090, MODEL_DSO2150, MODEL_DSO2250, MODEL_DSO5200, MODEL_DSO5200A]

Value 0x08 is the calibration data for the channels offsets. It holds the offset value for the top and bottom of the scope screen for every gain step on every channel. The data is stored as a three-dimensional array:
channelLevels[channel][GainId][LevelOffset]


VALUE_DEVICEADDRESS [MODEL_DSO2090, MODEL_DSO2150, MODEL_DSO2250, MODEL_DSO5200, MODEL_DSO5200A]

Value 0x0a is the address of the device. It has a length of one byte.


VALUE_FASTRATECALIBRATION [MODEL_DSO2250, MODEL_DSO5200, MODEL_DSO5200A]

Value 0x60 is the calibration data for the fast rate mode on the DSO-2250, DSO-5200 and DSO-5200A. It's used to correct the level differences between the two merged channels to avoid deterministic noise.


VALUE_ETSCORRECTION [MODEL_DSO5200, MODEL_DSO5200A]

Value 0x70 contains correction values for the ETS functionality of the DSO-5200 and DSO-5200A.


Enumerator
VALUE_OFFSETLIMITS 
VALUE_DEVICEADDRESS 
VALUE_FASTRATECALIBRATION 
VALUE_ETSCORRECTION 

◆ RollState

enum Hantek::RollState : int
strong

The states of the roll cycle (Since capture state isn't valid).

Enumerator
STARTSAMPLING 

Start sampling.

ENABLETRIGGER 

Enable triggering.

FORCETRIGGER 

Force triggering.

GETDATA 

Request sample data.

_COUNT 

◆ UsedChannels

enum Hantek::UsedChannels : uint8_t
strong

The enabled channels.

Enumerator
USED_NONE 

No channels are activated.

USED_CH1 

Only channel 1 is activated.

USED_CH2 

Only channel 2 is activated.

USED_CH1CH2 

Channel 1 and 2 are both activated.