X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhung-chang-dso-2100%2Fprotocol.h;h=11de7b7254337946b68ea33edb1c2a5116971f80;hb=b89e6db910e4a38779fa033aa04040cb020d3fd2;hp=4a24aebc68edc1a9fe75e72942a1870143350d8d;hpb=05ac4a9828fc73bee0d420e96104d9cf3c5b658a;p=libsigrok.git diff --git a/src/hardware/hung-chang-dso-2100/protocol.h b/src/hardware/hung-chang-dso-2100/protocol.h index 4a24aebc..11de7b72 100644 --- a/src/hardware/hung-chang-dso-2100/protocol.h +++ b/src/hardware/hung-chang-dso-2100/protocol.h @@ -27,18 +27,38 @@ #define LOG_PREFIX "hung-chang-dso-2100" -/** Private, per-device-instance driver context. */ -struct dev_context { - /* Model-specific information */ - - /* Acquisition settings */ +#define MAX_RETRIES 4 +#define NUM_CHANNELS 2 - /* Operational state */ +struct dev_context { + GSList *enabled_channel; + uint8_t channel; + uint8_t rate; + uint8_t cctl[2]; + uint8_t edge; + uint8_t tlevel; + uint8_t pos[2]; + uint8_t offset[2]; + uint8_t gain[2]; - /* Temporary state across callbacks */ + uint64_t frame_limit; + uint64_t frame; + uint64_t probe[2]; + uint8_t step; + uint8_t last_step; + uint8_t retries; + gboolean adc2; + float *samples; + float factor; + gboolean state_known; }; -SR_PRIV int hung_chang_dso_2100_receive_data(int fd, int revents, void *cb_data); +SR_PRIV void hung_chang_dso_2100_reset_port(struct parport *port); +SR_PRIV gboolean hung_chang_dso_2100_check_id(struct parport *port); +SR_PRIV void hung_chang_dso_2100_write_mbox(struct parport *port, uint8_t val); +SR_PRIV uint8_t hung_chang_dso_2100_read_mbox(struct parport *port, float timeout); +SR_PRIV int hung_chang_dso_2100_move_to(const struct sr_dev_inst *sdi, uint8_t target); +SR_PRIV int hung_chang_dso_2100_poll(int fd, int revents, void *cb_data); #endif