X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Fhardware%2Fdemo%2Fprotocol.h;h=de0ac7a86078d125f1925c801638249bdff37a7c;hp=c35ea2d4c618db1a19da649f737e91c26d30e40e;hb=94f364ec11c938934f68cde067ee590218177140;hpb=015f09702a95ca3f3d17f3f45f24657547312fe3 diff --git a/src/hardware/demo/protocol.h b/src/hardware/demo/protocol.h index c35ea2d4..de0ac7a8 100644 --- a/src/hardware/demo/protocol.h +++ b/src/hardware/demo/protocol.h @@ -5,6 +5,7 @@ * Copyright (C) 2011 Olivier Fauchon * Copyright (C) 2012 Alexandru Gagniuc * Copyright (C) 2015 Bartosz Golaszewski + * Copyright (C) 2019 Frank Stettner * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,7 +35,8 @@ /* Size of the analog pattern space per channel. */ #define ANALOG_BUFSIZE 4096 /* This is a development feature: it starts a new frame every n samples. */ -#define SAMPLES_PER_FRAME 0 +#define SAMPLES_PER_FRAME 1000UL +#define DEFAULT_LIMIT_FRAMES 0 /* Logic patterns we can generate. */ enum logic_pattern_type { @@ -77,6 +79,9 @@ enum logic_pattern_type { * something that can get recognized. */ PATTERN_SQUID, + + /** Gray encoded data, like rotary encoder signals. */ + PATTERN_GRAYCODE, }; /* Analog patterns we can generate. */ @@ -91,6 +96,7 @@ struct dev_context { uint64_t cur_samplerate; uint64_t limit_samples; uint64_t limit_msec; + uint64_t limit_frames; uint64_t sent_samples; uint64_t sent_frame_samples; /* Number of samples that were sent for current frame. */ int64_t start_us; @@ -112,6 +118,10 @@ struct dev_context { size_t enabled_analog_channels; size_t first_partial_logic_index; uint8_t first_partial_logic_mask; + /* Triggers */ + uint64_t capture_ratio; + gboolean trigger_fired; + struct soft_trigger_logic *stl; }; static const char *analog_pattern_str[] = { @@ -123,6 +133,9 @@ static const char *analog_pattern_str[] = { struct analog_gen { struct sr_channel *ch; + enum sr_mq mq; + enum sr_mqflag mq_flags; + enum sr_unit unit; enum analog_pattern_type pattern; float amplitude; float pattern_data[ANALOG_BUFSIZE];