#include <glib.h>
#include <libusb.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
/*
* Status/error codes returned by libsigrok functions.
#define MAX_NUM_PROBES 64
#define MAX_PROBENAME_LEN 32
-
/* Handy little macros */
#define KHZ(n) ((n) * 1000)
#define MHZ(n) ((n) * 1000000)
#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,
int stackindex;
};
-
-
/* datafeed_packet.type values */
enum {
DF_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;
int (*loadfile) (struct input *in, const char *filename);
};
-
-
struct output {
struct output_format *format;
struct device *device;
uint64_t *length_out);
};
-
struct analyzer {
char *name;
char *filename;
*/
};
-
/* Size of a chunk in units */
#define DATASTORE_CHUNKSIZE 512000
GSList *chunklist;
};
-
/*
* This represents a generic device connected to the system.
* For device-specific information, ask the plugin. The plugin_index refers
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 */
struct probe {
int index;
- int type;
gboolean enabled;
char *name;
char *trigger;
extern GSList *devices;
-
/* Hardware plugin capabilities */
enum {
HWCAP_DUMMY, /* Used to terminate lists */
char *shortname;
};
-
struct sigrok_device_instance {
int index;
int status;
DI_CUR_SAMPLERATE,
/* Supported pattern generator modes */
DI_PATTERNMODES,
+ /* Probes type, DF_ANALOG needs this to be PROBE_TYPE_ANALOG */
+ DI_PROBE_TYPE,
};
/*
};
#include "sigrok-proto.h"
+
+#ifdef __cplusplus
+}
+#endif
+
#endif