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