#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)
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#endif
+#ifndef ARRAY_AND_SIZE
+#define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a)
+#endif
+
/* Data types, used by hardware plugins for set_configuration() */
enum {
T_UINT64,
DF_HEADER,
DF_END,
DF_TRIGGER,
- DF_LOGIC8,
- DF_LOGIC16,
- DF_LOGIC24,
- DF_LOGIC32,
- DF_LOGIC48,
- DF_LOGIC64,
+ DF_LOGIC,
+ DF_PD,
+ DF_PA,
};
struct datafeed_packet {
uint16_t type;
- uint16_t length;
+ uint64_t length;
+ uint16_t unitsize;
void *payload;
};
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);
uint64_t *length_out);
char *sigrok_samplerate_string(uint64_t samplerate);
+char *sigrok_period_string(uint64_t frequency);
/*--- analyzer.c ------------------------------------------------------------*/
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,