20 #ifndef LIBSIGROK_SIGROK_H
21 #define LIBSIGROK_SIGROK_H
83 #define SR_MAX_PROBENAME_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")))
475 uint64_t length_in, uint8_t **data_out,
476 uint64_t *length_out);
506 uint64_t *length_out);
811 int (*
init) (
struct sr_context *sr_ctx);
813 GSList *(*scan) (GSList *options);
814 GSList *(*dev_list) (void);
The device instance is actively in use in a session.
Sound pressure level is C-weighted in the frequency domain, according to IEC 61672:2003.
Sound pressure level relative so 20 micropascals.
Device options for a particular device.
int(* init)(struct sr_context *sr_ctx)
int(* config_list)(int info_id, GVariant **data, const struct sr_dev_inst *sdi)
uint64_t mqflags
Bitmap with extra information about the MQ.
The device supports setting a sample time limit (how long the sample acquisition should run...
Sound pressure level is A-weighted in the frequency domain, according to IEC 61672:2003.
The device supports Run Length Encoding.
Output very noisy debug messages.
The device supports continuous sampling.
int(* dev_open)(struct sr_dev_inst *sdi)
struct sr_dev_inst * sdi
The device for which this output module is creating output.
int(* format_match)(const char *filename)
Check if this input module can load and parse the specified file.
Serial communication specification, in the form:
Specification on how to connect to a device.
char * id
The unique ID for this input format.
int(* config_get)(int id, GVariant **data, const struct sr_dev_inst *sdi)
int(* init)(struct sr_output *o)
This function is called once, at the beginning of an output stream.
char * param
An optional parameter which the frontend can pass in to the output module.
The device supports setting its samplerate, in Hz.
Sound pressure level is Z-weighted (i.e.
int(* loadfile)(struct sr_input *in, const char *filename)
Load a file, parsing the input according to the file's format.
Malloc/calloc/realloc error.
Normalized (0 to 1) concentration of a substance or compound with 0 representing a concentration of 0...
Measurements that intrinsically do not have units attached, such as ratios, gains, etc.
Data source for acquisition.
Sound pressure level represented as a percentage of measurements that were over a preset alarm level...
The device instance is live, but not in use.
int(* config_set)(int id, GVariant *data, const struct sr_dev_inst *sdi)
Device is in "max" mode, only updating upon a new max value.
The device can act as a sound level meter.
Gain (a transistor's gain, or hFE, for example).
int mq
Measured quantity (voltage, current, temperature, and so on).
Sound pressure level is not weighted in the frequency domain, albeit without standards-defined low an...
The device supports specifying a capturefile to inject.
Generic/unspecified error.
Electrical power, usually in W, or dBm.
Device is closed, but needs to be open.
The device supports setting a sample number limit (how many samples should be acquired).
Device is in "min" mode, only updating upon a new min value.
Sound pressure level time weighting.
struct sr_dev_driver * driver
Voltage measurement is direct current (DC).
The device is winding down its session.
char * id
A unique ID for this output format.
The device supports setting trigger slope.
The device can measure humidity.
The device can act as a multimeter.
Header file containing API function prototypes.
struct sr_output_format * format
A pointer to this output format's 'struct sr_output_format'.
Logic low-high threshold range.
Voltage measurement is alternating current (AC).
The device supports swapping channels.
Logarithmic representation of sound pressure relative to a reference value.
Device is in relative mode.
Scan options supported by the driver.
char * description
A short description of the output format.
The device instance was not found.
int(* dev_acquisition_stop)(struct sr_dev_inst *sdi, void *cb_data)
The device instance was found, but is still booting.
This is a true RMS measurement.
The device supports setting its sample interval, in ms.
The device supports setting a pre/post-trigger capture ratio.
int(* init)(struct sr_input *in, const char *filename)
Initialize the input module.
int(* data)(struct sr_output *o, const uint8_t *data_in, uint64_t length_in, uint8_t **data_out, uint64_t *length_out)
Whenever a chunk of data comes in, it will be passed to the output module via this function...
Number of timebases, as related to SR_CONF_TIMEBASE.
Sound pressure level measurement is F-weighted (125ms) in the time domain.
int(* sr_receive_data_callback_t)(int fd, int revents, void *cb_data)
Device is in "hold" mode (repeating the last measurement).
int(* dev_close)(struct sr_dev_inst *sdi)
Output no messages at all.
Device instance type for serial port devices.
char * description
A short description of the input format, which can (for example) be displayed to the user by frontend...
Device is in autoranging mode.
The device has internal storage, into which data is logged.
int(* event)(struct sr_output *o, int event_type, uint8_t **data_out, uint64_t *length_out)
This function is called when an event occurs in the datafeed which the output module may need to be a...
The device can measure temperature.
Output (file) format struct.
struct sr_input_format * format
A pointer to this input format's 'struct sr_input_format'.
Input (file) format struct.
Unit of conductance, the inverse of resistance.
The device can measure energy consumption.
The device supports setting a pattern (pattern generator mode).
The device is a demo device.
Sound pressure level measurement range.
Voltage in decibel, referenced to 1 volt (dBV).
Number of vertical divisions, as related to SR_CONF_VDIV.
Sound pressure level frequency weighting.
int(* receive)(struct sr_output *o, const struct sr_dev_inst *sdi, const struct sr_datafeed_packet *packet, GString **out)
This function is passed a copy of every packed in the data feed.
Value is voltage drop across a diode, or NAN.
GSList * devs
List of struct sr_dev pointers.
The device supports setting the number of probes.
An absolute measurement of power, in decibels, referenced to 1 milliwatt (dBu).
GSList * datafeed_callbacks
List of struct datafeed_callback pointers.
The device can act as an oscilloscope.
The device supports specifying the capturefile unit size.
Version number definitions and macros.
Sound pressure level is time-averaged (LAT), also known as Equivalent Continuous A-weighted Sound Lev...
The device supports setting a frame limit (how many frames should be acquired).
Sound pressure level measurement is S-weighted (1s) in the time domain.
Horizontal trigger position.
GSList * probes
The probes for which data is included in this packet.
int(* dev_acquisition_start)(const struct sr_dev_inst *sdi, void *cb_data)
The device supports using a external clock.
The device can act as logic analyzer.
Errors hinting at internal bugs.
Device instance type for USB devices.
Output informational messages.
int(* cleanup)(struct sr_output *o)
This function is called after the caller is finished using the output module, and can be used to free...
float * data
The analog value(s).
int unit
Unit in which the MQ is measured.