2 * This file is part of the libsigrok project.
4 * Copyright (C) 2019 Vitaliy Vorobyov
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_SYSCLK_SLA5032_SLA5032_H
21 #define LIBSIGROK_HARDWARE_SYSCLK_SLA5032_SLA5032_H
26 #include <libsigrok/libsigrok.h>
28 /** SLA5032 protocol command ID codes. */
30 CMD_INIT_FW_UPLOAD = 1,
31 CMD_UPLOAD_FW_CHUNK = 2,
38 struct sr_usb_dev_inst;
40 SR_PRIV int sla5032_apply_fpga_config(const struct sr_dev_inst* sdi);
41 SR_PRIV int sla5032_start_sample(const struct sr_usb_dev_inst *usb);
42 SR_PRIV int sla5032_get_status(const struct sr_usb_dev_inst *usb, uint32_t status[3]);
43 SR_PRIV int sla5032_set_read_back(const struct sr_usb_dev_inst *usb);
44 SR_PRIV int sla5032_read_data_chunk(const struct sr_usb_dev_inst *usb, void *buf, unsigned int len, int *xfer_len);
45 SR_PRIV int sla5032_set_depth(const struct sr_usb_dev_inst *usb, uint32_t pre, uint32_t post);
46 SR_PRIV int sla5032_set_triggers(const struct sr_usb_dev_inst *usb, uint32_t trg_value, uint32_t trg_edge_mask, uint32_t trg_mask);
47 SR_PRIV int sla5032_set_samplerate(const struct sr_usb_dev_inst *usb, unsigned int sr);
48 SR_PRIV int sla5032_set_pwm1(const struct sr_usb_dev_inst *usb, uint32_t hi, uint32_t lo);
49 SR_PRIV int sla5032_set_pwm2(const struct sr_usb_dev_inst* usb, uint32_t hi, uint32_t lo);
50 SR_PRIV int sla5032_write_reg14_zero(const struct sr_usb_dev_inst* usb);