]>
Commit | Line | Data |
---|---|---|
a1bb33af | 1 | /* |
fed16f06 UH |
2 | * This file is part of the sigrok project. |
3 | * | |
4 | * Copyright (C) 2010 Sven Peter <sven@fail0verflow.com> | |
5 | * Copyright (C) 2010 Haxx Enterprises <bushing@gmail.com> | |
6 | * All rights reserved. | |
7 | * | |
8 | * Redistribution and use in source and binary forms, with or | |
9 | * without modification, are permitted provided that the following | |
10 | * conditions are met: | |
11 | * | |
12 | * * Redistributions of source code must retain the above copyright notice, | |
13 | * this list of conditions and the following disclaimer. | |
14 | * | |
15 | * * Redistributions in binary form must reproduce the above copyright notice, | |
16 | * this list of conditions and the following disclaimer in the documentation | |
17 | * and/or other materials provided with the distribution. | |
18 | * | |
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | |
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | |
29 | * THE POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | |
a1bb33af | 31 | |
0f8522bf UH |
32 | #ifndef LIBSIGROK_HARDWARE_ZEROPLUS_LOGIC_CUBE_ANALYZER_H |
33 | #define LIBSIGROK_HARDWARE_ZEROPLUS_LOGIC_CUBE_ANALYZER_H | |
fed16f06 | 34 | |
a1bb33af | 35 | #include <libusb.h> |
45c59c8b | 36 | #include "libsigrok.h" |
a1bb33af | 37 | |
fed16f06 UH |
38 | #define STATUS_FLAG_NONE 0x00 |
39 | #define STATUS_FLAG_RESET 0x01 | |
40 | #define STATUS_FLAG_INIT 0x02 | |
41 | #define STATUS_FLAG_GO 0x04 | |
42 | #define STATUS_FLAG_PAUSE 0x08 | |
43 | #define STATUS_FLAG_READ 0x10 | |
44 | #define STATUS_FLAG_20 0x20 | |
45 | ||
46 | #define MEMORY_SIZE_8K 0x00 | |
47 | #define MEMORY_SIZE_64K 0x01 | |
48 | #define MEMORY_SIZE_128K 0x02 | |
49 | #define MEMORY_SIZE_512K 0x04 | |
a1bb33af | 50 | |
fed16f06 UH |
51 | #define STATUS_BUSY 0x01 /* WTF / ??? */ |
52 | #define STATUS_READY 0x02 | |
53 | #define STATUS_BUTTON_PRESSED 0x04 | |
a1bb33af | 54 | |
fed16f06 UH |
55 | #define CHANNEL_A 0x1000 |
56 | #define CHANNEL_B 0x2000 | |
57 | #define CHANNEL_C 0x3000 | |
58 | #define CHANNEL_D 0x4000 | |
a1bb33af | 59 | |
fed16f06 UH |
60 | #define FREQ_SCALE_HZ 0 |
61 | #define FREQ_SCALE_KHZ 1 | |
62 | #define FREQ_SCALE_MHZ 2 | |
a1bb33af | 63 | |
fed16f06 UH |
64 | #define FILTER_HIGH 0 |
65 | #define FILTER_LOW 1 | |
a1bb33af | 66 | |
fed16f06 UH |
67 | #define COMPRESSION_NONE 0x0001 |
68 | #define COMPRESSION_ENABLE 0x8001 | |
69 | #define COMPRESSION_DOUBLE 0x8002 | |
a1bb33af UH |
70 | |
71 | enum { | |
72 | TRIGGER_HIGH = 0, | |
73 | TRIGGER_LOW, | |
74 | TRIGGER_POSEDGE, | |
75 | TRIGGER_NEGEDGE, | |
fed16f06 | 76 | TRIGGER_ANYEDGE, |
a1bb33af UH |
77 | }; |
78 | ||
ca070ed9 UH |
79 | SR_PRIV void analyzer_set_freq(int freq, int scale); |
80 | SR_PRIV void analyzer_set_ramsize_trigger_address(unsigned int address); | |
81 | SR_PRIV void analyzer_set_triggerbar_address(unsigned int address); | |
82 | SR_PRIV void analyzer_set_compression(unsigned int type); | |
83 | SR_PRIV void analyzer_set_memory_size(unsigned int size); | |
84 | SR_PRIV void analyzer_add_trigger(int channel, int type); | |
85 | SR_PRIV void analyzer_set_trigger_count(int count); | |
86 | SR_PRIV void analyzer_add_filter(int channel, int type); | |
a1bb33af | 87 | |
ca070ed9 UH |
88 | SR_PRIV unsigned int analyzer_read_id(libusb_device_handle *devh); |
89 | SR_PRIV unsigned int analyzer_get_stop_address(libusb_device_handle *devh); | |
90 | SR_PRIV unsigned int analyzer_get_now_address(libusb_device_handle *devh); | |
91 | SR_PRIV unsigned int analyzer_get_trigger_address(libusb_device_handle *devh); | |
92 | SR_PRIV int analyzer_decompress(void *input, unsigned int input_len, | |
93 | void *output, unsigned int output_len); | |
a1bb33af | 94 | |
ca070ed9 UH |
95 | SR_PRIV void analyzer_reset(libusb_device_handle *devh); |
96 | SR_PRIV void analyzer_initialize(libusb_device_handle *devh); | |
97 | SR_PRIV void analyzer_wait(libusb_device_handle *devh, int set, int unset); | |
98 | SR_PRIV void analyzer_read_start(libusb_device_handle *devh); | |
99 | SR_PRIV int analyzer_read_data(libusb_device_handle *devh, void *buffer, | |
100 | unsigned int size); | |
101 | SR_PRIV void analyzer_read_stop(libusb_device_handle *devh); | |
102 | SR_PRIV void analyzer_start(libusb_device_handle *devh); | |
103 | SR_PRIV void analyzer_configure(libusb_device_handle *devh); | |
a1bb33af | 104 | |
ca070ed9 UH |
105 | SR_PRIV void analyzer_wait_button(libusb_device_handle *devh); |
106 | SR_PRIV void analyzer_wait_data(libusb_device_handle *devh); | |
fed16f06 | 107 | |
a1bb33af | 108 | #endif |