X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=hardware%2Fbeaglelogic%2Fprotocol.h;h=f2acfeb0151e84da53ae42fb7ab876edb4a4008b;hp=07d3bf216f23aafb923ff64a80ec725958ec1b7a;hb=43cd4637285833706f8a404ca027bcf0ee75b9ae;hpb=bb993797611dc5dfcba339238bdfcdad0af0c0aa diff --git a/hardware/beaglelogic/protocol.h b/hardware/beaglelogic/protocol.h index 07d3bf21..f2acfeb0 100644 --- a/hardware/beaglelogic/protocol.h +++ b/hardware/beaglelogic/protocol.h @@ -27,16 +27,42 @@ #define LOG_PREFIX "beaglelogic" +/* Maximum possible input channels */ +#define NUM_CHANNELS 14 + +#define SAMPLEUNIT_TO_BYTES(x) ((x) == 1 ? 1 : 2) + /** Private, per-device-instance driver context. */ struct dev_context { /* Model-specific information */ + int max_channels; + uint32_t fw_ver; - /* Acquisition settings */ + /* Acquisition settings: see beaglelogic.h */ + uint64_t cur_samplerate; + uint64_t limit_samples; + uint32_t sampleunit; + uint32_t triggerflags; + + /* Buffers: size of each buffer block and the total buffer area */ + uint32_t bufunitsize; + uint32_t buffersize; /* Operational state */ + int fd; + GPollFD pollfd; + int last_error; + + uint64_t bytes_read; + uint64_t sent_samples; + uint32_t offset; + uint8_t *sample_buf; /* mmap'd kernel buffer here */ - /* Temporary state across callbacks */ + void *cb_data; + /* Trigger logic */ + struct soft_trigger_logic *stl; + gboolean trigger_fired; }; SR_PRIV int beaglelogic_receive_data(int fd, int revents, void *cb_data);