From 97b874bd0b6913ed52df1b8aac5e7491479fac9a Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Thu, 11 May 2017 23:20:58 +0200 Subject: Add srd_inst_initial_pins_set_all() and support code. This allows frontends to set the assumed initial pins (i.e., the assumed state of the pins before the first sample of a capture) to user-specified values. The assumed initial pins can be either low, or high, or "use same value as the first sample of the capture". The special self.initial_pins decoder attribute is now removed. --- libsigrokdecode.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libsigrokdecode.h') diff --git a/libsigrokdecode.h b/libsigrokdecode.h index df1cb5c..d37c432 100644 --- a/libsigrokdecode.h +++ b/libsigrokdecode.h @@ -194,6 +194,12 @@ struct srd_decoder { void *py_dec; }; +enum srd_initial_pin { + SRD_INITIAL_PIN_LOW, + SRD_INITIAL_PIN_HIGH, + SRD_INITIAL_PIN_SAME_AS_SAMPLE0, +}; + /** * Structure which contains information about one protocol decoder channel. * For example, I2C has two channels, SDA and SCL. @@ -347,6 +353,8 @@ SRD_API int srd_inst_stack(struct srd_session *sess, struct srd_decoder_inst *di_from, struct srd_decoder_inst *di_to); SRD_API struct srd_decoder_inst *srd_inst_find_by_id(struct srd_session *sess, const char *inst_id); +SRD_API int srd_inst_initial_pins_set_all(struct srd_decoder_inst *di, + GArray *initial_pins); /* log.c */ typedef int (*srd_log_callback)(void *cb_data, int loglevel, -- cgit v1.2.3-70-g09d2