X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=sigrok.h;h=1ba03b6313b6ff4cb67cd8570fa601eea8e11b01;hb=62eeeb171bd9a05d167990373e33bc1f956cbfee;hp=1b4552ca0740f0dfe37522a52593cc4a292e1926;hpb=925dbf9f97c18628ead7cb5a93f95052b48ca0e4;p=libsigrok.git diff --git a/sigrok.h b/sigrok.h index 1b4552ca..1ba03b63 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,10 +72,8 @@ #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, @@ -91,8 +91,6 @@ struct protocol { int stackindex; }; - - /* datafeed_packet.type values */ enum { DF_HEADER, @@ -119,7 +117,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 +142,6 @@ struct input_format { int (*loadfile) (struct input *in, const char *filename); }; - - struct output { struct output_format *format; struct device *device; @@ -155,7 +160,6 @@ struct output_format { uint64_t *length_out); }; - struct analyzer { char *name; char *filename; @@ -165,7 +169,6 @@ struct analyzer { */ }; - /* Size of a chunk in units */ #define DATASTORE_CHUNKSIZE 512000 @@ -176,7 +179,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 @@ -188,6 +190,7 @@ struct device { struct device_plugin *plugin; /* A plugin may handle multiple devices of the same type */ int plugin_index; + uint8_t probe_type; /* List of struct probe* */ GSList *probes; /* Data acquired by this device, if any */ @@ -201,7 +204,6 @@ enum { struct probe { int index; - int type; gboolean enabled; char *name; char *trigger; @@ -209,7 +211,6 @@ struct probe { extern GSList *devices; - /* Hardware plugin capabilities */ enum { HWCAP_DUMMY, /* Used to terminate lists */ @@ -235,7 +236,6 @@ struct hwcap_option { char *shortname; }; - struct sigrok_device_instance { int index; int status; @@ -297,6 +297,8 @@ enum { DI_CUR_SAMPLERATE, /* Supported pattern generator modes */ DI_PATTERNMODES, + /* Probes type, DF_ANALOG needs this to be PROBE_TYPE_ANALOG */ + DI_PROBE_TYPE, }; /* @@ -347,4 +349,9 @@ struct session { }; #include "sigrok-proto.h" + +#ifdef __cplusplus +} +#endif + #endif