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