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