]> sigrok.org Git - libsigrok.git/blobdiff - sigrok.h
Make the demo driver work.
[libsigrok.git] / sigrok.h
index ede379bb24aa101f0517c48ca11722b802dc3d2f..9551b8874a8ad01fb0095c57f334a8809ea21cfa 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
 #define SIGROK_ERR_MALLOC              -2 /* Malloc/calloc/realloc error */
 #define SIGROK_ERR_SAMPLERATE          -3 /* Incorrect samplerate */
 
+/* limited by uint64_t */
+#define MAX_NUM_PROBES 64
+#define MAX_PROBENAME_LEN 32
+
+
 /* Handy little macros */
 #define KHZ(n) ((n) * 1000)
 #define MHZ(n) ((n) * 1000000)
@@ -94,7 +99,7 @@ enum {
 
 struct datafeed_packet {
        uint16_t type;
-       uint16_t length;
+       uint64_t length;
        void *payload;
 };
 
@@ -118,8 +123,8 @@ struct input {
 struct input_format {
        char *extension;
        char *description;
-       int (*format_match) (char *filename);
-       int (*in_loadfile) (char *filename);
+       int (*format_match) (const char *filename);
+       int (*in_loadfile) (const char *filename);
 };
 
 struct input_format **input_list(void);
@@ -153,6 +158,7 @@ int filter_probes(int in_unitsize, int out_unitsize, int *probelist,
                  uint64_t *length_out);
 
 char *sigrok_samplerate_string(uint64_t samplerate);
+char *sigrok_period_string(uint64_t frequency);
 
 /*--- analyzer.c ------------------------------------------------------------*/
 
@@ -242,7 +248,7 @@ enum {
        HWCAP_LOGIC_ANALYZER,
        HWCAP_SAMPLERATE,       /* Change samplerate */
        HWCAP_PROBECONFIG,      /* Configure probe mask */
-       HWCAP_CAPTURE_RATIO,    /* Set pre-trigger / post-trigger ratio */
+       HWCAP_CAPTURE_RATIO,    /* Set pre/post-trigger capture ratio */
        HWCAP_LIMIT_MSEC,       /* Set a time limit for sample acquisition */
        HWCAP_LIMIT_SAMPLES,    /* Set a limit on number of samples */
 };
@@ -429,6 +435,7 @@ int ezusb_upload_firmware(libusb_device *dev, int configuration,
 GSList *list_serial_ports(void);
 int serial_open(const char *pathname, int flags);
 int serial_close(int fd);
+int serial_flush(int fd);
 void *serial_backup_params(int fd);
 void serial_restore_params(int fd, void *backup);
 int serial_set_params(int fd, int speed, int bits, int parity, int stopbits,