libsigrok
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Defines | Enumerations | Functions
analyzer.h File Reference
#include <libusb.h>
#include "sigrok.h"
Include dependency graph for analyzer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define STATUS_FLAG_NONE   0x00
#define STATUS_FLAG_RESET   0x01
#define STATUS_FLAG_INIT   0x02
#define STATUS_FLAG_GO   0x04
#define STATUS_FLAG_PAUSE   0x08
#define STATUS_FLAG_READ   0x10
#define STATUS_FLAG_20   0x20
#define MEMORY_SIZE_8K   0x00
#define MEMORY_SIZE_64K   0x01
#define MEMORY_SIZE_128K   0x02
#define MEMORY_SIZE_512K   0x04
#define STATUS_BUSY   0x01 /* WTF / ??? */
#define STATUS_READY   0x02
#define STATUS_BUTTON_PRESSED   0x04
#define CHANNEL_A   0x1000
#define CHANNEL_B   0x2000
#define CHANNEL_C   0x3000
#define CHANNEL_D   0x4000
#define FREQ_SCALE_HZ   0
#define FREQ_SCALE_KHZ   1
#define FREQ_SCALE_MHZ   2
#define FILTER_HIGH   0
#define FILTER_LOW   1
#define COMPRESSION_NONE   0x0001
#define COMPRESSION_ENABLE   0x8001
#define COMPRESSION_DOUBLE   0x8002

Enumerations

enum  {
  TRIGGER_HIGH = 0, TRIGGER_LOW, TRIGGER_POSEDGE, TRIGGER_NEGEDGE,
  TRIGGER_ANYEDGE
}

Functions

SR_PRIV void analyzer_set_freq (int freq, int scale)
SR_PRIV void analyzer_set_ramsize_trigger_address (unsigned int address)
SR_PRIV void analyzer_set_triggerbar_address (unsigned int address)
SR_PRIV void analyzer_set_compression (unsigned int type)
SR_PRIV void analyzer_set_memory_size (unsigned int size)
SR_PRIV void analyzer_add_trigger (int channel, int type)
SR_PRIV void analyzer_set_trigger_count (int count)
SR_PRIV void analyzer_add_filter (int channel, int type)
SR_PRIV unsigned int analyzer_read_id (libusb_device_handle *devh)
SR_PRIV unsigned int analyzer_get_stop_address (libusb_device_handle *devh)
SR_PRIV unsigned int analyzer_get_now_address (libusb_device_handle *devh)
SR_PRIV unsigned int analyzer_get_trigger_address (libusb_device_handle *devh)
SR_PRIV int analyzer_decompress (void *input, unsigned int input_len, void *output, unsigned int output_len)
SR_PRIV void analyzer_reset (libusb_device_handle *devh)
SR_PRIV void analyzer_initialize (libusb_device_handle *devh)
SR_PRIV void analyzer_wait (libusb_device_handle *devh, int set, int unset)
SR_PRIV void analyzer_read_start (libusb_device_handle *devh)
SR_PRIV int analyzer_read_data (libusb_device_handle *devh, void *buffer, unsigned int size)
SR_PRIV void analyzer_read_stop (libusb_device_handle *devh)
SR_PRIV void analyzer_start (libusb_device_handle *devh)
SR_PRIV void analyzer_configure (libusb_device_handle *devh)
SR_PRIV void analyzer_wait_button (libusb_device_handle *devh)
SR_PRIV void analyzer_wait_data (libusb_device_handle *devh)

Define Documentation

#define CHANNEL_A   0x1000

Definition at line 55 of file analyzer.h.

Referenced by analyzer_add_filter(), and analyzer_add_trigger().

#define CHANNEL_B   0x2000

Definition at line 56 of file analyzer.h.

Referenced by analyzer_add_filter(), and analyzer_add_trigger().

#define CHANNEL_C   0x3000

Definition at line 57 of file analyzer.h.

Referenced by analyzer_add_filter(), and analyzer_add_trigger().

#define CHANNEL_D   0x4000

Definition at line 58 of file analyzer.h.

Referenced by analyzer_add_filter(), and analyzer_add_trigger().

#define COMPRESSION_DOUBLE   0x8002

Definition at line 69 of file analyzer.h.

#define COMPRESSION_ENABLE   0x8001

Definition at line 68 of file analyzer.h.

#define COMPRESSION_NONE   0x0001

Definition at line 67 of file analyzer.h.

#define FILTER_HIGH   0

Definition at line 64 of file analyzer.h.

Referenced by analyzer_add_filter().

#define FILTER_LOW   1

Definition at line 65 of file analyzer.h.

Referenced by analyzer_add_filter().

#define FREQ_SCALE_HZ   0

Definition at line 60 of file analyzer.h.

#define FREQ_SCALE_KHZ   1

Definition at line 61 of file analyzer.h.

#define FREQ_SCALE_MHZ   2

Definition at line 62 of file analyzer.h.

#define MEMORY_SIZE_128K   0x02

Definition at line 48 of file analyzer.h.

#define MEMORY_SIZE_512K   0x04

Definition at line 49 of file analyzer.h.

#define MEMORY_SIZE_64K   0x01

Definition at line 47 of file analyzer.h.

#define MEMORY_SIZE_8K   0x00

Definition at line 46 of file analyzer.h.

#define STATUS_BUSY   0x01 /* WTF / ??? */

Definition at line 51 of file analyzer.h.

Referenced by analyzer_wait_data().

#define STATUS_BUTTON_PRESSED   0x04

Definition at line 53 of file analyzer.h.

Referenced by analyzer_wait_button().

#define STATUS_FLAG_20   0x20

Definition at line 44 of file analyzer.h.

Referenced by analyzer_read_start(), and analyzer_read_stop().

#define STATUS_FLAG_GO   0x04

Definition at line 41 of file analyzer.h.

Referenced by analyzer_start().

#define STATUS_FLAG_INIT   0x02

Definition at line 40 of file analyzer.h.

Referenced by analyzer_configure(), analyzer_initialize(), and analyzer_start().

#define STATUS_FLAG_NONE   0x00
#define STATUS_FLAG_PAUSE   0x08

Definition at line 42 of file analyzer.h.

#define STATUS_FLAG_READ   0x10

Definition at line 43 of file analyzer.h.

Referenced by analyzer_read_start().

#define STATUS_FLAG_RESET   0x01

Definition at line 39 of file analyzer.h.

Referenced by analyzer_configure(), and analyzer_reset().

#define STATUS_READY   0x02

Definition at line 52 of file analyzer.h.

Referenced by analyzer_wait_data().


Enumeration Type Documentation

anonymous enum
Enumerator:
TRIGGER_HIGH 
TRIGGER_LOW 
TRIGGER_POSEDGE 
TRIGGER_NEGEDGE 
TRIGGER_ANYEDGE 

Definition at line 71 of file analyzer.h.


Function Documentation

SR_PRIV void analyzer_add_filter ( int  channel,
int  type 
)

Definition at line 451 of file analyzer.c.

References CHANNEL_A, CHANNEL_B, CHANNEL_C, CHANNEL_D, FILTER_HIGH, and FILTER_LOW.

SR_PRIV void analyzer_add_trigger ( int  channel,
int  type 
)
SR_PRIV void analyzer_configure ( libusb_device_handle *  devh)
SR_PRIV int analyzer_decompress ( void *  input,
unsigned int  input_len,
void *  output,
unsigned int  output_len 
)

Definition at line 546 of file analyzer.c.

SR_PRIV unsigned int analyzer_get_now_address ( libusb_device_handle *  devh)

Definition at line 519 of file analyzer.c.

References gl_reg_read(), NOW_ADDRESS0, NOW_ADDRESS1, and NOW_ADDRESS2.

Here is the call graph for this function:

SR_PRIV unsigned int analyzer_get_stop_address ( libusb_device_handle *  devh)

Definition at line 513 of file analyzer.c.

References gl_reg_read(), STOP_ADDRESS0, STOP_ADDRESS1, and STOP_ADDRESS2.

Here is the call graph for this function:

SR_PRIV unsigned int analyzer_get_trigger_address ( libusb_device_handle *  devh)

Definition at line 525 of file analyzer.c.

References gl_reg_read(), TRIGGER_ADDRESS0, TRIGGER_ADDRESS1, and TRIGGER_ADDRESS2.

Here is the call graph for this function:

SR_PRIV void analyzer_initialize ( libusb_device_handle *  devh)

Definition at line 311 of file analyzer.c.

References STATUS_FLAG_INIT, and STATUS_FLAG_NONE.

SR_PRIV int analyzer_read_data ( libusb_device_handle *  devh,
void *  buffer,
unsigned int  size 
)

Definition at line 338 of file analyzer.c.

References gl_read_bulk().

Here is the call graph for this function:

SR_PRIV unsigned int analyzer_read_id ( libusb_device_handle *  devh)

Definition at line 508 of file analyzer.c.

References DEV_ID0, DEV_ID1, and gl_reg_read().

Here is the call graph for this function:

SR_PRIV void analyzer_read_start ( libusb_device_handle *  devh)

Definition at line 328 of file analyzer.c.

References gl_reg_read(), READ_RAM_STATUS, STATUS_FLAG_20, and STATUS_FLAG_READ.

Here is the call graph for this function:

SR_PRIV void analyzer_read_stop ( libusb_device_handle *  devh)

Definition at line 344 of file analyzer.c.

References STATUS_FLAG_20, and STATUS_FLAG_NONE.

SR_PRIV void analyzer_reset ( libusb_device_handle *  devh)

Definition at line 305 of file analyzer.c.

References STATUS_FLAG_NONE, and STATUS_FLAG_RESET.

SR_PRIV void analyzer_set_compression ( unsigned int  type)

Definition at line 531 of file analyzer.c.

SR_PRIV void analyzer_set_freq ( int  freq,
int  scale 
)

Definition at line 487 of file analyzer.c.

SR_PRIV void analyzer_set_memory_size ( unsigned int  size)

Definition at line 493 of file analyzer.c.

SR_PRIV void analyzer_set_ramsize_trigger_address ( unsigned int  address)

Definition at line 498 of file analyzer.c.

SR_PRIV void analyzer_set_trigger_count ( int  count)

Definition at line 482 of file analyzer.c.

SR_PRIV void analyzer_set_triggerbar_address ( unsigned int  address)

Definition at line 503 of file analyzer.c.

SR_PRIV void analyzer_start ( libusb_device_handle *  devh)

Definition at line 350 of file analyzer.c.

References STATUS_FLAG_GO, STATUS_FLAG_INIT, and STATUS_FLAG_NONE.

SR_PRIV void analyzer_wait ( libusb_device_handle *  devh,
int  set,
int  unset 
)

Definition at line 318 of file analyzer.c.

References DEV_STATUS, and gl_reg_read().

Referenced by analyzer_wait_button(), and analyzer_wait_data().

Here is the call graph for this function:

SR_PRIV void analyzer_wait_button ( libusb_device_handle *  devh)

Definition at line 536 of file analyzer.c.

References analyzer_wait(), and STATUS_BUTTON_PRESSED.

Here is the call graph for this function:

SR_PRIV void analyzer_wait_data ( libusb_device_handle *  devh)

Definition at line 541 of file analyzer.c.

References analyzer_wait(), STATUS_BUSY, and STATUS_READY.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines