X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=sigrok.h;h=4decd625afe6cd396da818488d8a94bfa9d2253e;hb=eeebceea31bacfbe05ba6d7cbcf21de03910329a;hp=9a22cb0ef15799b82eb6a149e467506de0e5c9d1;hpb=13a12913507682c319aaa890d897670bc8457adb;p=libsigrok.git diff --git a/sigrok.h b/sigrok.h index 9a22cb0e..4decd625 100644 --- a/sigrok.h +++ b/sigrok.h @@ -27,6 +27,9 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif /* * Status/error codes returned by libsigrok functions. @@ -54,7 +57,6 @@ #define MAX_NUM_PROBES 64 #define MAX_PROBENAME_LEN 32 - /* Handy little macros */ #define KHZ(n) ((n) * 1000) #define MHZ(n) ((n) * 1000000) @@ -70,14 +72,13 @@ #define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a) #endif - typedef int (*receive_data_callback) (int fd, int revents, void *user_data); - /* Data types used by hardware plugins for set_configuration() */ enum { T_UINT64, T_CHAR, + T_NULL, }; enum { @@ -91,8 +92,6 @@ struct protocol { int stackindex; }; - - /* datafeed_packet.type values */ enum { DF_HEADER, @@ -119,7 +118,16 @@ struct datafeed_header { int num_logic_probes; }; +struct analog_probe { + uint8_t att; + uint8_t res; /* Needs to be a power of 2, FIXME */ + uint16_t val; /* Max hardware ADC width is 16bits */ +}; +struct analog_sample { + uint8_t num_probes; /* Max hardware probes is 256 */ + struct analog_probe probes[]; +}; struct input { struct input_format *format; @@ -135,8 +143,6 @@ struct input_format { int (*loadfile) (struct input *in, const char *filename); }; - - struct output { struct output_format *format; struct device *device; @@ -155,7 +161,6 @@ struct output_format { uint64_t *length_out); }; - struct analyzer { char *name; char *filename; @@ -165,7 +170,6 @@ struct analyzer { */ }; - /* Size of a chunk in units */ #define DATASTORE_CHUNKSIZE 512000 @@ -176,7 +180,6 @@ struct datastore { GSList *chunklist; }; - /* * This represents a generic device connected to the system. * For device-specific information, ask the plugin. The plugin_index refers @@ -209,14 +212,19 @@ struct probe { extern GSList *devices; - /* Hardware plugin capabilities */ enum { HWCAP_DUMMY, /* Used to terminate lists */ + /* device classes */ HWCAP_LOGIC_ANALYZER, + + /* device options */ HWCAP_SAMPLERATE, /* Change samplerate */ HWCAP_PROBECONFIG, /* Configure probe mask */ HWCAP_CAPTURE_RATIO, /* Set pre/post-trigger capture ratio */ + HWCAP_PATTERN_MODE, /* Pattern generator mode */ + + /* acquisition modes */ HWCAP_LIMIT_MSEC, /* Set a time limit for sample acquisition */ HWCAP_LIMIT_SAMPLES, /* Set a limit on number of samples */ HWCAP_CONTINUOUS, @@ -229,7 +237,6 @@ struct hwcap_option { char *shortname; }; - struct sigrok_device_instance { int index; int status; @@ -289,6 +296,8 @@ enum { DI_TRIGGER_TYPES, /* The currently set samplerate in Hz (uint64_t) */ DI_CUR_SAMPLERATE, + /* Supported pattern generator modes */ + DI_PATTERNMODES, }; /* @@ -339,4 +348,9 @@ struct session { }; #include "sigrok-proto.h" + +#ifdef __cplusplus +} +#endif + #endif