2 * This file is part of the libsigrok project.
4 * Copyright (C) 2018 Gerhard Sittig <gerhard.sittig@gmx.net>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef LIBSIGROK_HARDWARE_MICROCHIP_PICKIT2_PROTOCOL_H
21 #define LIBSIGROK_HARDWARE_MICROCHIP_PICKIT2_PROTOCOL_H
26 #include <libsigrok/libsigrok.h>
27 #include "libsigrok-internal.h"
29 #define LOG_PREFIX "microchip-pickit2"
31 #define PICKIT2_CHANNEL_COUNT 3
32 #define PICKIT2_SAMPLE_COUNT 1024
33 #define PICKIT2_SAMPLE_RAWLEN (4 * 128)
43 enum pickit_state state;
44 const uint64_t *samplerates;
45 size_t num_samplerates;
46 size_t curr_samplerate_idx;
47 const uint64_t *captureratios;
48 size_t num_captureratios;
49 size_t curr_captureratio_idx;
50 struct sr_sw_limits sw_limits;
51 gboolean detached_kernel_driver;
52 int32_t triggers[PICKIT2_CHANNEL_COUNT]; /**@< see @ref SR_TRIGGER_ZERO et al */
54 uint8_t samples_raw[PICKIT2_SAMPLE_RAWLEN];
55 uint8_t samples_conv[PICKIT2_SAMPLE_COUNT];
58 SR_PRIV int microchip_pickit2_setup_trigger(const struct sr_dev_inst *sdi);
59 SR_PRIV int microchip_pickit2_receive_data(int fd, int revents, void *cb_data);