summaryrefslogtreecommitdiff
path: root/sigrokdecode.h
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2012-03-15 22:00:24 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2012-03-18 14:34:22 +0100
commit361fdcaafec8ddd37f0d381204e4c2a22c56b238 (patch)
tree3ec78b57af80df493faf87048ee6f85f06f205ba /sigrokdecode.h
parented2306a6f29bc4d85f5f248c83fff252b22c60a5 (diff)
downloadlibsigrokdecode-361fdcaafec8ddd37f0d381204e4c2a22c56b238.tar.gz
libsigrokdecode-361fdcaafec8ddd37f0d381204e4c2a22c56b238.zip
srd: Cosmetics, fix/add Doxygen comments.
Diffstat (limited to 'sigrokdecode.h')
-rw-r--r--sigrokdecode.h38
1 files changed, 25 insertions, 13 deletions
diff --git a/sigrokdecode.h b/sigrokdecode.h
index e523a45..bebad10 100644
--- a/sigrokdecode.h
+++ b/sigrokdecode.h
@@ -101,16 +101,19 @@ struct srd_decoder {
/** The decoder ID. Must be non-NULL and unique for all decoders. */
char *id;
- /** The (short) decoder name. */
+ /** The (short) decoder name. Must be non-NULL. */
char *name;
/** The (long) decoder name. May be NULL. */
char *longname;
- /** A (short, one-line) description of the decoder. */
+ /** A (short, one-line) description of the decoder. Must be non-NULL. */
char *desc;
- /** The license of the decoder. Valid values: "gplv2+", "gplv3+". */
+ /**
+ * The license of the decoder. Valid values: "gplv2+", "gplv3+".
+ * Other values are currently not allowed. Must be non-NULL.
+ */
char *license;
/** TODO */
@@ -119,29 +122,37 @@ struct srd_decoder {
/** TODO */
GSList *outputformats;
- /** Probes */
+ /** List of probes required by this decoder. */
GSList *probes;
- /** Optional probes */
+ /** List of optional probes for this decoder. */
GSList *opt_probes;
- /*
+ /**
* List of NULL-terminated char[], containing descriptions of the
* supported annotation output.
*/
GSList *annotations;
- /** Python module */
+ /** Python module. */
PyObject *py_mod;
- /** sigrokdecode.Decoder class */
+ /** sigrokdecode.Decoder class. */
PyObject *py_dec;
};
+/**
+ * Structure which contains information about one protocol decoder probe.
+ * For example, I2C has two probes, SDA and SCL.
+ */
struct srd_probe {
+ /** The ID of the probe. Must be non-NULL. */
char *id;
+ /** The name of the probe. Must not be NULL. */
char *name;
+ /** The description of the probe. Must not be NULL. */
char *desc;
+ /** The index of the probe, i.e. its order in the list of probes. */
int order;
};
@@ -182,7 +193,8 @@ struct srd_pd_callback {
void *cb_data;
};
-/* custom python types */
+/* Custom Python types: */
+
typedef struct {
PyObject_HEAD
} srd_Decoder;
@@ -202,13 +214,13 @@ typedef struct {
SRD_API int srd_init(char *path);
SRD_API int srd_exit(void);
SRD_API int srd_inst_options_set(struct srd_decoder_inst *di,
- GHashTable *options);
+ GHashTable *options);
SRD_API int srd_inst_probes_set(struct srd_decoder_inst *di,
- GHashTable *probes);
+ GHashTable *probes);
SRD_API struct srd_decoder_inst *srd_inst_new(const char *id,
- GHashTable *options);
+ GHashTable *options);
SRD_API int srd_inst_stack(struct srd_decoder_inst *di_from,
- struct srd_decoder_inst *di_to);
+ struct srd_decoder_inst *di_to);
SRD_API struct srd_decoder_inst *srd_inst_find_by_id(char *inst_id);
SRD_API int srd_session_start(int num_probes, int unitsize,
uint64_t samplerate);