X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fbaylibre-acme%2Fprotocol.h;h=d0c9761d6d0e4ac98832b1f10b0c2c2e04d7d17c;hb=67f890d5bb259539b930df15146f138974a849de;hp=5252118815b7070af1e87c76cd7603db0f64247f;hpb=6b80b80dcf2c6f6cdc4c8a782085846c861bd10d;p=libsigrok.git diff --git a/src/hardware/baylibre-acme/protocol.h b/src/hardware/baylibre-acme/protocol.h index 52521188..d0c9761d 100644 --- a/src/hardware/baylibre-acme/protocol.h +++ b/src/hardware/baylibre-acme/protocol.h @@ -22,8 +22,8 @@ #include #include -#include /* pipe() */ -#include "libsigrok.h" +#include +#include #include "libsigrok-internal.h" #define LOG_PREFIX "baylibre-acme" @@ -42,21 +42,13 @@ #define TEMP_PROBE_NAME "tmp435" /* For the user we number the probes starting from 1. */ -#define PROBE_NUM(n) ((n)+1) +#define PROBE_NUM(n) ((n) + 1) enum probe_type { PROBE_ENRG = 1, PROBE_TEMP, }; -enum channel_type { - ENRG_PWR = 1, - ENRG_CURR, - ENRG_VOL, - TEMP_IN, - TEMP_OUT, -}; - /** Private, per-device-instance driver context. */ struct dev_context { uint64_t samplerate; @@ -65,9 +57,10 @@ struct dev_context { uint32_t num_channels; uint64_t samples_read; + uint64_t samples_missed; int64_t start_time; int64_t last_sample_fin; - int pipe_fds[2]; + int timer_fd; GIOChannel *channel; }; @@ -81,6 +74,24 @@ SR_PRIV gboolean bl_acme_detect_probe(unsigned int addr, SR_PRIV gboolean bl_acme_register_probe(struct sr_dev_inst *sdi, int type, unsigned int addr, int prb_num); +SR_PRIV int bl_acme_get_probe_type(const struct sr_channel_group *cg); +SR_PRIV int bl_acme_probe_has_pws(const struct sr_channel_group *cg); + +SR_PRIV void bl_acme_maybe_set_update_interval(const struct sr_dev_inst *sdi, + uint64_t samplerate); + +SR_PRIV int bl_acme_get_shunt(const struct sr_channel_group *cg, + uint64_t *shunt); +SR_PRIV int bl_acme_set_shunt(const struct sr_channel_group *cg, + uint64_t shunt); +SR_PRIV int bl_acme_read_power_state(const struct sr_channel_group *cg, + gboolean *off); +SR_PRIV int bl_acme_set_power_off(const struct sr_channel_group *cg, + gboolean off); + SR_PRIV int bl_acme_receive_data(int fd, int revents, void *cb_data); +SR_PRIV int bl_acme_open_channel(struct sr_channel *ch); + +SR_PRIV void bl_acme_close_channel(struct sr_channel *ch); #endif