20 #ifndef LIBSIGROK_LIBSIGROK_H 21 #define LIBSIGROK_LIBSIGROK_H 90 #define SR_MAX_CHANNELNAME_LEN 32 94 #define SR_KHZ(n) ((n) * UINT64_C(1000)) 95 #define SR_MHZ(n) ((n) * UINT64_C(1000000)) 96 #define SR_GHZ(n) ((n) * UINT64_C(1000000000)) 98 #define SR_HZ_TO_NS(n) (UINT64_C(1000000000) / (n)) 128 #define SR_API __attribute__((visibility("default"))) 135 #define SR_PRIV __attribute__((visibility("hidden"))) 502 struct timeval starttime;
624 struct sr_input_module;
626 struct sr_output_module;
628 struct sr_transform_module;
1285 const struct sr_dev_inst *sdi,
1289 int (*config_set) (uint32_t key, GVariant *data,
1290 const struct sr_dev_inst *sdi,
1294 int (*config_channel_set) (
const struct sr_dev_inst *sdi,
1295 struct sr_channel *ch,
unsigned int changes);
1298 int (*config_commit) (
const struct sr_dev_inst *sdi);
1302 int (*config_list) (uint32_t key, GVariant **data,
1303 const struct sr_dev_inst *sdi,
1308 int (*dev_open) (
struct sr_dev_inst *sdi);
1310 int (*dev_close) (
struct sr_dev_inst *sdi);
1312 int (*dev_acquisition_start) (
const struct sr_dev_inst *sdi);
1314 int (*dev_acquisition_stop) (
struct sr_dev_inst *sdi);
The device can measure humidity.
Sound pressure level, in decibels, relative to 20 micropascals.
sr_configkey
Configuration keys.
Device is in "min" mode, only updating upon a new min value.
Device is in "max" mode, only updating upon a new max value.
struct sr_analog_encoding * encoding
Specification on how to connect to a device.
The device supports continuous sampling.
Information on single channel.
GSList * stages
List of pointers to struct sr_trigger_stage.
int8_t digits
Number of significant digits after the decimal point, if positive.
The device can act as a signal demodulator.
const char * name
Driver name.
A channel to match and what to match it on.
The device supports setting a pattern for the logic trigger.
uint32_t key
Config key like SR_CONF_CONN, etc.
struct sr_channel * channel
The channel to trigger on.
Header of a sigrok data feed.
The device supports setting a sample time limit (how long the sample acquisition should run...
Sound pressure level is time-averaged (LAT), also known as Equivalent Continuous A-weighted Sound Lev...
Over-voltage protection (OVP) active.
Possible values can be enumerated.
sr_mqflag
Values for sr_analog_meaning.mqflags.
Version number definitions and macros.
Over-voltage protection (OVP) threshold.
GSList * channels
List of sr_channel structs of the channels belonging to this group.
const char * longname
Long name.
const char * description
Verbose description (unused currently).
GSList * matches
List of pointers to struct sr_trigger_match.
Payload is struct sr_datafeed_meta.
char * description
An end user friendly description for the serial port.
Device is in relative mode.
The device can act as a sound level meter.
Output no messages at all.
int type
Channel type (SR_CHANNEL_LOGIC, ...)
Sound pressure level represented as a percentage of measurements that were over a preset alarm level...
The device supports setting a frame limit (how many frames should be acquired).
Parallel resistance (LCR meter model).
Payload is sr_datafeed_header.
The measurement range of a DMM or the output range of a power supply.
Duty cycle of a source signal.
Generic option struct used by various subsystems.
Output very noisy debug messages.
sr_valid_code
Ternary return type for DMM/LCR/etc packet parser validity checks.
The device instance was found, but is still booting.
const char * id
Short, lowercase ID string, e.g.
Over-current protection (OCP) feature.
Channel type is analog channel.
The device supports setting a pattern (pattern generator mode).
Device instance type for serial port devices.
Under-voltage condition threshold.
Voltage in decibel, referenced to 1 volt (dBV).
sr_error_code
Status/error codes returned by libsigrok functions.
sr_channeltype
Constants for channel type.
The device can act as a programmable power supply.
sr_resource_type
Resource type.
Logic low-high threshold range.
Enabling/disabling channel.
int64_t p
Numerator of the rational number.
Packet in a sigrok data feed.
GVariant * data
Key-specific data.
struct sr_dev_inst * sdi
The device this channel is attached to.
Measurements that intrinsically do not have units attached, such as ratios, gains, etc.
uint32_t key
Config key like SR_CONF_CONN, MQ value like SR_MQ_VOLTAGE, etc.
Device is in "avg" mode, averaging upon each new value.
Device is in autoranging mode.
Logic threshold: predefined levels (TTL, ECL, CMOS, etc).
The device is winding down its session.
The device can measure temperature.
The device can act as a function generator.
The device can act as an oscilloscope.
Mass in troy ounce [oz t].
The device instance is actively in use in a session.
sr_output_flag
Output module flags.
Mass in pennyweight [dwt].
Normalized (0 to 1) concentration of a substance or compound with 0 representing a concentration of 0...
Logarithmic representation of sound pressure relative to a reference value.
Measurement is four wire (e.g.
Payload is struct sr_datafeed_logic.
The device supports specifying a capturefile to inject.
sr_dev_inst_type
Types of device instance, struct sr_dev_inst.type.
sr_unit
Unit of measured quantity, sr_analog_meaning.unit.
The device instance is live, but not in use.
Plane angle in 1/360th of a full circle.
Gain (a transistor's gain, or hFE, for example).
Parallel capacitance (LCR meter model).
Sound pressure level frequency weighting.
int index
The index of this channel, starting at 0.
The representation of a trigger, consisting of one or more stages containing one or more matches on a...
Under-voltage condition active.
Override builtin probe names from user specs.
The device instance was not found.
Analog datafeed payload for type SR_DF_ANALOG.
Electric charge in coulomb.
Channel type is logic channel.
Sound pressure level is Z-weighted (i.e.
The device can act as an electronic load.
The device supports setting its samplerate, in Hz.
The device supports setting number of samples to be averaged over.
Over-current protection (OCP) active.
Used for setting or getting value of a config item.
Generic/unspecified error.
sr_mq
Measured quantity, sr_analog_meaning.mq.
gboolean enabled
Is this channel enabled?
void * context
Device driver context, considered private.
Over-current protection (OCP) delay.
struct sr_analog_meaning * meaning
An absolute measurement of power, in decibels, referenced to 1 milliwatt (dBm).
User specified forced driver attachment to unknown devices.
void * priv
Private data for driver use.
Pieces (number of items).
The device supports setting the number of logic channels.
Over-voltage protection (OVP) feature.
Datafeed payload for type SR_DF_META.
Over-temperature protection (OTP)
Difference from reference value.
gboolean is_digits_decimal
Over-temperature protection (OTP) active.
Sound pressure level is not weighted in the frequency domain, albeit without standards-defined low an...
Value is voltage drop across a diode, or NAN.
Serial communication specification, in the form:
int(* dev_clear)(const struct sr_dev_driver *driver)
Clear list of devices the driver knows about.
Device mode for multi-function devices.
Header file containing API function prototypes.
The number of digits (e.g.
Electrical power, usually in W, or dBm.
char * name
A name for this trigger.
Device instance type for SCPI devices.
Unit of conductance, the inverse of resistance.
If set, this output module writes the output itself.
int8_t spec_digits
Number of significant digits after the decimal point, if positive.
Series capacitance (LCR meter model).
The device can act as a multimeter.
sr_packettype
Value for sr_datafeed_packet.type.
struct sr_analog_spec * spec
Errors hinting at internal bugs.
Channel regulation get: "CV", "CC" or "UR", denoting constant voltage, constant current or unregulate...
Number of vertical divisions, as related to SR_CONF_VDIV.
Series inductance (LCR meter model).
The device supports specifying the capturefile unit size.
int api_version
API version (currently 1).
The device supports using an external clock.
The device can act as logic analyzer.
Voltage measurement is alternating current (AC).
Sound pressure level measurement is S-weighted (1s) in the time domain.
Payload is struct sr_datafeed_analog.
Horizontal trigger position.
sr_datatype
Data types used by sr_config_info().
Number of horizontal divisions, as related to SR_CONF_TIMEBASE.
Opaque structure representing a libsigrok session.
Electric charge in ampere hour [Ah].
The device can measure power.
Opaque structure representing a libsigrok context.
uint64_t q
Denominator of the rational number.
const char * name
Full capitalized name, e.g.
float value
If the trigger match is one of SR_TRIGGER_OVER or SR_TRIGGER_UNDER, this contains the value to compar...
Malloc/calloc/realloc error.
char * name
The OS dependent name of the serial port.
Structure for groups of channels that have common properties.
Unstable value (hasn't settled yet).
Data source for acquisition.
Device is in "hold" mode (repeating the last measurement).
A channel group must be specified.
Output frequency target in Hz.
Sound pressure level is C-weighted in the frequency domain, according to IEC 61672:2003.
Device instance type for USB devices.
Modbus slave address specification.
Offset of a source without strictly-defined MQ.
Time is duration (as opposed to epoch, ...).
Voltage measurement is direct current (DC).
int match
The trigger match to use.
char * name
Name of the channel group.
int(* config_get)(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
Query value of a configuration key in driver or given device instance.
The device has internal storage, into which data is logged.
Parallel inductance (LCR meter model).
Sound pressure level is A-weighted in the frequency domain, according to IEC 61672:2003.
Sound pressure level time weighting.
The device is a demo device.
The device supports setting trigger slope.
The device supports setting a sample number limit (how many samples should be acquired).
The device can act as an LCR meter.
The device supports run-length encoding (RLE).
Mass in tael (variants: Hong Kong, Singapore/Malaysia, Taiwan)
sr_loglevel
libsigrok loglevels.
End of stream (no further data).
Energy (consumption) in watt hour [Wh].
Which external clock source to use if the device supports multiple external clock channels...
This is a true RMS measurement.
void * priv
Private data for driver use.
Sound pressure level measurement range.
The device supports setting a pre/post-trigger capture ratio.
sr_configcap
Configuration capabilities.
Hertz (frequency, 1/s, [Hz]).
Equivalent circuit model.
Sound pressure level measurement is F-weighted (125ms) in the time domain.
Wind speed in meters per second.
The trigger matched at this point in the data feed.
Device is closed, but must be open.
Over-current protection (OCP) threshold.
The device supports setting a probe factor.
Amplitude of a source without strictly-defined MQ.
Logic datafeed payload for type SR_DF_LOGIC.
int(* sr_receive_data_callback)(int fd, int revents, void *cb_data)
Type definition for callback function for data reception.
Phase of a source signal.
The device can act as a scale.
The device supports averaging.
Degrees Celsius (temperature).
Output informational messages.
The device can switch between multiple sources, e.g.
Relative humidity assuming air temperature of 293 Kelvin (rF).
void * handle
File handle or equivalent; set by resource open callback.
The device can measure energy consumption.
Choice of clock edge for external clock ("r" or "f").
The device supports setting its sample interval, in ms.
Number of powerline cycles for ADC integration time.
Device-instance type for user-created "devices".
Logic threshold: custom numerical value.
The device supports swapping channels.
sr_dev_inst_status
Device instance status, struct sr_dev_inst.status.
uint64_t size
Size of resource in bytes; set by resource open callback.
int datatype
Data type like SR_T_STRING, etc if applicable.
The device supports setting the number of analog channels.
Degrees Fahrenheit (temperature).
Series resistance (LCR meter model).
int type
Resource type (SR_RESOURCE_FIRMWARE, ...)
Device instance type for Modbus devices.
char * name
Name of channel.