Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef LIBSIGROK_HARDWARE_ZEROPLUS_LOGIC_CUBE_ANALYZER_H
00033 #define LIBSIGROK_HARDWARE_ZEROPLUS_LOGIC_CUBE_ANALYZER_H
00034
00035 #include <libusb.h>
00036 #include "sigrok.h"
00037
00038 #define STATUS_FLAG_NONE 0x00
00039 #define STATUS_FLAG_RESET 0x01
00040 #define STATUS_FLAG_INIT 0x02
00041 #define STATUS_FLAG_GO 0x04
00042 #define STATUS_FLAG_PAUSE 0x08
00043 #define STATUS_FLAG_READ 0x10
00044 #define STATUS_FLAG_20 0x20
00045
00046 #define MEMORY_SIZE_8K 0x00
00047 #define MEMORY_SIZE_64K 0x01
00048 #define MEMORY_SIZE_128K 0x02
00049 #define MEMORY_SIZE_512K 0x04
00050
00051 #define STATUS_BUSY 0x01
00052 #define STATUS_READY 0x02
00053 #define STATUS_BUTTON_PRESSED 0x04
00054
00055 #define CHANNEL_A 0x1000
00056 #define CHANNEL_B 0x2000
00057 #define CHANNEL_C 0x3000
00058 #define CHANNEL_D 0x4000
00059
00060 #define FREQ_SCALE_HZ 0
00061 #define FREQ_SCALE_KHZ 1
00062 #define FREQ_SCALE_MHZ 2
00063
00064 #define FILTER_HIGH 0
00065 #define FILTER_LOW 1
00066
00067 #define COMPRESSION_NONE 0x0001
00068 #define COMPRESSION_ENABLE 0x8001
00069 #define COMPRESSION_DOUBLE 0x8002
00070
00071 enum {
00072 TRIGGER_HIGH = 0,
00073 TRIGGER_LOW,
00074 TRIGGER_POSEDGE,
00075 TRIGGER_NEGEDGE,
00076 TRIGGER_ANYEDGE,
00077 };
00078
00079 SR_PRIV void analyzer_set_freq(int freq, int scale);
00080 SR_PRIV void analyzer_set_ramsize_trigger_address(unsigned int address);
00081 SR_PRIV void analyzer_set_triggerbar_address(unsigned int address);
00082 SR_PRIV void analyzer_set_compression(unsigned int type);
00083 SR_PRIV void analyzer_set_memory_size(unsigned int size);
00084 SR_PRIV void analyzer_add_trigger(int channel, int type);
00085 SR_PRIV void analyzer_set_trigger_count(int count);
00086 SR_PRIV void analyzer_add_filter(int channel, int type);
00087
00088 SR_PRIV unsigned int analyzer_read_id(libusb_device_handle *devh);
00089 SR_PRIV unsigned int analyzer_get_stop_address(libusb_device_handle *devh);
00090 SR_PRIV unsigned int analyzer_get_now_address(libusb_device_handle *devh);
00091 SR_PRIV unsigned int analyzer_get_trigger_address(libusb_device_handle *devh);
00092 SR_PRIV int analyzer_decompress(void *input, unsigned int input_len,
00093 void *output, unsigned int output_len);
00094
00095 SR_PRIV void analyzer_reset(libusb_device_handle *devh);
00096 SR_PRIV void analyzer_initialize(libusb_device_handle *devh);
00097 SR_PRIV void analyzer_wait(libusb_device_handle *devh, int set, int unset);
00098 SR_PRIV void analyzer_read_start(libusb_device_handle *devh);
00099 SR_PRIV int analyzer_read_data(libusb_device_handle *devh, void *buffer,
00100 unsigned int size);
00101 SR_PRIV void analyzer_read_stop(libusb_device_handle *devh);
00102 SR_PRIV void analyzer_start(libusb_device_handle *devh);
00103 SR_PRIV void analyzer_configure(libusb_device_handle *devh);
00104
00105 SR_PRIV void analyzer_wait_button(libusb_device_handle *devh);
00106 SR_PRIV void analyzer_wait_data(libusb_device_handle *devh);
00107
00108 #endif