From: Uwe Hermann Date: Sat, 22 Nov 2014 15:53:02 +0000 (+0100) Subject: Add missing entries to sr_config_info_data[]. X-Git-Tag: libsigrok-0.4.0~726 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=54ab1dcdc4d372765401bc2513f2692f488f4e1d;p=libsigrok.git Add missing entries to sr_config_info_data[]. Newly added keys: - SR_CONF_SAMPLE_INTERVAL - SR_CONF_NUM_TIMEBASE - SR_CONF_NUM_VDIV - SR_CONF_CENTER_FREQUENCY - SR_CONF_DEVICE_MODE - SR_CONF_SCAN_OPTIONS - SR_CONF_DEVICE_OPTIONS - SR_CONF_DEVICE_MODE - SR_CONF_TEST_MODE Also, keep the same ordering and grouping as in libsigrok.h. --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 7f10d0e2..f05fb47b 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -576,7 +576,7 @@ struct sr_config_info { #define SR_CONF_LIST (1 << 29) #define SR_CONF_MASK 0x1fffffff -/** Constants for device classes */ +/** Configuration keys */ enum sr_configkey { /*--- Device classes ------------------------------------------------*/ @@ -604,13 +604,13 @@ enum sr_configkey { /** The device can measure energy consumption. */ SR_CONF_ENERGYMETER, - /** The device can demodulate signals. */ + /** The device can act as a signal demodulator. */ SR_CONF_DEMODULATOR, - /** Programmable power supply. */ + /** The device can act as a programmable power supply. */ SR_CONF_POWER_SUPPLY, - /** LCR meter. */ + /** The device can act as an LCR meter. */ SR_CONF_LCRMETER, /*--- Driver scan options -------------------------------------------*/ @@ -648,7 +648,7 @@ enum sr_configkey { */ SR_CONF_SERIALCOMM, - /*--- Device configuration ------------------------------------------*/ + /*--- Device (or channel group) configuration -----------------------*/ /** The device supports setting its samplerate, in Hz. */ SR_CONF_SAMPLERATE = 30000, @@ -659,7 +659,7 @@ enum sr_configkey { /** The device supports setting a pattern (pattern generator mode). */ SR_CONF_PATTERN_MODE, - /** The device supports Run Length Encoding. */ + /** The device supports run-length encoding (RLE). */ SR_CONF_RLE, /** The device supports setting trigger slope. */ @@ -894,7 +894,7 @@ enum sr_configkey { */ SR_CONF_DATA_SOURCE, - /*--- Acquisition modes ---------------------------------------------*/ + /*--- Acquisition modes, sample limiting ----------------------------*/ /** * The device supports setting a sample time limit (how long diff --git a/src/hwdriver.c b/src/hwdriver.c index ca579f67..95d8163f 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -47,9 +47,10 @@ extern SR_PRIV struct sr_dev_driver *drivers_list[]; * @{ */ +/* Same key order/grouping as in enum sr_configkey (libsigrok.h). */ static struct sr_config_info sr_config_info_data[] = { - /* Device types */ - {SR_CONF_LOGIC_ANALYZER, SR_T_STRING, NULL, "Logic Analyzer", NULL}, + /* Device classes */ + {SR_CONF_LOGIC_ANALYZER, SR_T_STRING, NULL, "Logic analyzer", NULL}, {SR_CONF_OSCILLOSCOPE, SR_T_STRING, NULL, "Oscilloscope", NULL}, {SR_CONF_MULTIMETER, SR_T_STRING, NULL, "Multimeter", NULL}, {SR_CONF_DEMO_DEV, SR_T_STRING, NULL, "Demo device", NULL}, @@ -61,37 +62,21 @@ static struct sr_config_info sr_config_info_data[] = { {SR_CONF_POWER_SUPPLY, SR_T_STRING, NULL, "Power supply", NULL}, {SR_CONF_LCRMETER, SR_T_STRING, NULL, "LCR meter", NULL}, - /* Sample limiting */ - {SR_CONF_LIMIT_SAMPLES, SR_T_UINT64, "limit_samples", - "Sample limit", NULL}, - {SR_CONF_LIMIT_MSEC, SR_T_UINT64, "limit_time", - "Time limit", NULL}, - {SR_CONF_LIMIT_FRAMES, SR_T_UINT64, "limit_frames", - "Frame limit", NULL}, - {SR_CONF_CONTINUOUS, SR_T_UINT64, "continuous", - "Continuous sampling", NULL}, - - /* Scan options */ + /* Driver scan options */ {SR_CONF_CONN, SR_T_STRING, "conn", "Connection", NULL}, {SR_CONF_SERIALCOMM, SR_T_STRING, "serialcomm", "Serial communication", NULL}, - /* Device/channel group options */ + /* Device (or channel group) configuration */ {SR_CONF_SAMPLERATE, SR_T_UINT64, "samplerate", "Sample rate", NULL}, {SR_CONF_CAPTURE_RATIO, SR_T_UINT64, "captureratio", "Pre-trigger capture ratio", NULL}, {SR_CONF_PATTERN_MODE, SR_T_STRING, "pattern", "Pattern", NULL}, - {SR_CONF_TRIGGER_MATCH, SR_T_INT32, "triggermatch", - "Trigger matches", NULL}, - {SR_CONF_EXTERNAL_CLOCK, SR_T_BOOL, "external_clock", - "External clock mode", NULL}, - {SR_CONF_SWAP, SR_T_BOOL, "swap", - "Swap channel order", NULL}, {SR_CONF_RLE, SR_T_BOOL, "rle", - "Run Length Encoding", NULL}, + "Run length encoding", NULL}, {SR_CONF_TRIGGER_SLOPE, SR_T_STRING, "triggerslope", "Trigger slope", NULL}, {SR_CONF_TRIGGER_SOURCE, SR_T_STRING, "triggersource", @@ -108,24 +93,32 @@ static struct sr_config_info sr_config_info_data[] = { "Volts/div", NULL}, {SR_CONF_COUPLING, SR_T_STRING, "coupling", "Coupling", NULL}, - {SR_CONF_DATALOG, SR_T_BOOL, "datalog", - "Datalog", NULL}, + {SR_CONF_TRIGGER_MATCH, SR_T_INT32, "triggermatch", + "Trigger matches", NULL}, + {SR_CONF_SAMPLE_INTERVAL, SR_T_UINT64, "sample_interval", + "Sample interval", NULL}, + {SR_CONF_NUM_TIMEBASE, SR_T_INT32, "num_timebase", + "Number of time bases", NULL}, + {SR_CONF_NUM_VDIV, SR_T_INT32, "num_vdiv", + "Number of vertical divisions", NULL}, {SR_CONF_SPL_WEIGHT_FREQ, SR_T_STRING, "spl_weight_freq", "Sound pressure level frequency weighting", NULL}, {SR_CONF_SPL_WEIGHT_TIME, SR_T_STRING, "spl_weight_time", "Sound pressure level time weighting", NULL}, + {SR_CONF_SPL_MEASUREMENT_RANGE, SR_T_UINT64_RANGE, "spl_meas_range", + "Sound pressure level measurement range", NULL}, {SR_CONF_HOLD_MAX, SR_T_BOOL, "hold_max", "Hold max", NULL}, {SR_CONF_HOLD_MIN, SR_T_BOOL, "hold_min", "Hold min", NULL}, - {SR_CONF_SPL_MEASUREMENT_RANGE, SR_T_UINT64_RANGE, "spl_meas_range", - "Sound pressure level measurement range", NULL}, {SR_CONF_VOLTAGE_THRESHOLD, SR_T_DOUBLE_RANGE, "voltage_threshold", "Voltage threshold", NULL }, - {SR_CONF_POWER_OFF, SR_T_BOOL, "power_off", - "Power off", NULL}, - {SR_CONF_DATA_SOURCE, SR_T_STRING, "data_source", - "Data source", NULL}, + {SR_CONF_EXTERNAL_CLOCK, SR_T_BOOL, "external_clock", + "External clock mode", NULL}, + {SR_CONF_SWAP, SR_T_BOOL, "swap", + "Swap channel order", NULL}, + {SR_CONF_CENTER_FREQUENCY, SR_T_UINT64, "center_frequency", + "Center frequency", NULL}, {SR_CONF_NUM_LOGIC_CHANNELS, SR_T_INT32, "logic_channels", "Number of logic channels", NULL}, {SR_CONF_NUM_ANALOG_CHANNELS, SR_T_INT32, "analog_channels", @@ -158,10 +151,10 @@ static struct sr_config_info sr_config_info_data[] = { "Clock edge", NULL}, {SR_CONF_AMPLITUDE, SR_T_FLOAT, "amplitude", "Amplitude", NULL}, - {SR_CONF_OVER_TEMPERATURE_PROTECTION, SR_T_BOOL, "otp", - "Over-temperature protection", NULL}, {SR_CONF_OUTPUT_REGULATION, SR_T_STRING, "output_regulation", "Output channel regulation", NULL}, + {SR_CONF_OVER_TEMPERATURE_PROTECTION, SR_T_BOOL, "otp", + "Over-temperature protection", NULL}, {SR_CONF_OUTPUT_FREQUENCY, SR_T_UINT64, "output_frequency", "Output frequency", NULL}, {SR_CONF_MEASURED_QUANTITY, SR_T_STRING, "measured_quantity", @@ -170,6 +163,39 @@ static struct sr_config_info sr_config_info_data[] = { "Measured secondary quantity", NULL}, {SR_CONF_EQUIV_CIRCUIT_MODEL, SR_T_STRING, "equiv_circuit_model", "Equivalent circuit model", NULL}, + + /* Special stuff */ + {SR_CONF_SCAN_OPTIONS, SR_T_STRING, "scan_options", + "Scan options", NULL}, + {SR_CONF_DEVICE_OPTIONS, SR_T_STRING, "device_options", + "Device options", NULL}, + {SR_CONF_SESSIONFILE, SR_T_STRING, "sessionfile", + "Session file", NULL}, + {SR_CONF_CAPTUREFILE, SR_T_STRING, "capturefile", + "Capture file", NULL}, + {SR_CONF_CAPTURE_UNITSIZE, SR_T_UINT64, "capture_unitsize", + "Capture unitsize", NULL}, + {SR_CONF_POWER_OFF, SR_T_BOOL, "power_off", + "Power off", NULL}, + {SR_CONF_DATA_SOURCE, SR_T_STRING, "data_source", + "Data source", NULL}, + + /* Acquisition modes, sample limiting */ + {SR_CONF_LIMIT_MSEC, SR_T_UINT64, "limit_time", + "Time limit", NULL}, + {SR_CONF_LIMIT_SAMPLES, SR_T_UINT64, "limit_samples", + "Sample limit", NULL}, + {SR_CONF_LIMIT_FRAMES, SR_T_UINT64, "limit_frames", + "Frame limit", NULL}, + {SR_CONF_CONTINUOUS, SR_T_UINT64, "continuous", + "Continuous sampling", NULL}, + {SR_CONF_DATALOG, SR_T_BOOL, "datalog", + "Datalog", NULL}, + {SR_CONF_DEVICE_MODE, SR_T_STRING, "device_mode", + "Device mode", NULL}, + {SR_CONF_TEST_MODE, SR_T_STRING, "test_mode", + "Test mode", NULL}, + {0, 0, NULL, NULL, NULL}, };