X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fsaleae-logic16%2Fprotocol.h;h=cd8380e3d1d7d399a50be0b87fcd42aca8bf2280;hb=3e43da1f70d48aba917026074d46ca4c91e43bf1;hp=d7ddb9a4722e4d8f7258f58ded65256d3916aae1;hpb=15abcf0f5888dab4c077af6600fab219342af830;p=libsigrok.git diff --git a/hardware/saleae-logic16/protocol.h b/hardware/saleae-logic16/protocol.h index d7ddb9a4..cd8380e3 100644 --- a/hardware/saleae-logic16/protocol.h +++ b/hardware/saleae-logic16/protocol.h @@ -2,6 +2,8 @@ * This file is part of the libsigrok project. * * Copyright (C) 2013 Marcus Comstedt + * Copyright (C) 2013 Bert Vermeulen + * Copyright (C) 2012 Joel Holdsworth * * 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 @@ -53,17 +55,41 @@ struct dev_context { /** The currently configured samplerate of the device. */ uint64_t cur_samplerate; - /** The currently configured input voltage of the device */ + /** Maximum number of samples to capture, if nonzero. */ + uint64_t limit_samples; + + /** The currently configured input voltage of the device. */ enum voltage_range cur_voltage_range; - /* - * EEPROM data from address 8 - */ + /** The input voltage selected by the user. */ + enum voltage_range selected_voltage_range; + + /** Channels to use. */ + uint16_t cur_channels; + + /* EEPROM data from address 8. */ uint8_t eeprom_data[8]; + + int64_t num_samples; + int submitted_transfers; + int empty_transfer_count; + int num_channels, cur_channel; + uint16_t channel_masks[16]; + uint16_t channel_data[16]; + uint8_t *convbuffer; + size_t convbuffer_size; + + void *cb_data; + unsigned int num_transfers; + struct libusb_transfer **transfers; + int *usbfd; }; -SR_PRIV int saleae_logic16_abort_acquisition(const struct sr_dev_inst *sdi); -SR_PRIV int saleae_logic16_init_device(const struct sr_dev_inst *sdi); -SR_PRIV int saleae_logic16_receive_data(int fd, int revents, void *cb_data); +SR_PRIV int logic16_setup_acquisition(const struct sr_dev_inst *sdi, + uint64_t samplerate, uint16_t channels); +SR_PRIV int logic16_start_acquisition(const struct sr_dev_inst *sdi); +SR_PRIV int logic16_abort_acquisition(const struct sr_dev_inst *sdi); +SR_PRIV int logic16_init_device(const struct sr_dev_inst *sdi); +SR_PRIV void logic16_receive_transfer(struct libusb_transfer *transfer); #endif