X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fbaylibre-acme%2Fprotocol.h;h=8717debd42cda396eb514983ab237a291355d48e;hb=e3b83c5ec3bff62c7b6e13954f2a654139874aa5;hp=b70182c7a8989ba825e0481101da238ed6e22df0;hpb=61f2b7f74cd2d05cacb2bfb3cad2c2d67c856f47;p=libsigrok.git diff --git a/src/hardware/baylibre-acme/protocol.h b/src/hardware/baylibre-acme/protocol.h index b70182c7..8717debd 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,32 +42,21 @@ #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; - uint64_t limit_samples; - uint64_t limit_msec; + struct sr_sw_limits limits; uint32_t num_channels; - uint64_t samples_read; - int64_t start_time; - int64_t last_sample_fin; - int pipe_fds[2]; + uint64_t samples_missed; + int timer_fd; GIOChannel *channel; }; @@ -81,11 +70,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