libsigrok
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Enumerations | Functions
analyzer.c File Reference
#include <assert.h>
#include "analyzer.h"
#include "gl_usb.h"
Include dependency graph for analyzer.c:

Go to the source code of this file.

Enumerations

enum  {
  HARD_DATA_CHECK_SUM = 0x00, PASS_WORD, DEV_ID0 = 0x10, DEV_ID1,
  START_STATUS = 0x20, DEV_STATUS = 0x21, FREQUENCY_REG0 = 0x30, FREQUENCY_REG1,
  FREQUENCY_REG2, FREQUENCY_REG3, FREQUENCY_REG4, MEMORY_LENGTH,
  CLOCK_SOURCE, TRIGGER_STATUS0 = 0x40, TRIGGER_STATUS1, TRIGGER_STATUS2,
  TRIGGER_STATUS3, TRIGGER_STATUS4, TRIGGER_STATUS5, TRIGGER_STATUS6,
  TRIGGER_STATUS7, TRIGGER_STATUS8, TRIGGER_COUNT0 = 0x50, TRIGGER_COUNT1,
  TRIGGER_LEVEL0 = 0x55, TRIGGER_LEVEL1, TRIGGER_LEVEL2, TRIGGER_LEVEL3,
  RAMSIZE_TRIGGERBAR_ADDRESS0 = 0x60, RAMSIZE_TRIGGERBAR_ADDRESS1, RAMSIZE_TRIGGERBAR_ADDRESS2, TRIGGERBAR_ADDRESS0,
  TRIGGERBAR_ADDRESS1, TRIGGERBAR_ADDRESS2, DONT_CARE_TRIGGERBAR, FILTER_ENABLE = 0x70,
  FILTER_STATUS, ENABLE_DELAY_TIME0 = 0x7a, ENABLE_DELAY_TIME1, ENABLE_INSERT_DATA0 = 0x80,
  ENABLE_INSERT_DATA1, ENABLE_INSERT_DATA2, ENABLE_INSERT_DATA3, COMPRESSION_TYPE0,
  COMPRESSION_TYPE1, TRIGGER_ADDRESS0 = 0x90, TRIGGER_ADDRESS1, TRIGGER_ADDRESS2,
  NOW_ADDRESS0 = 0x96, NOW_ADDRESS1, NOW_ADDRESS2, STOP_ADDRESS0 = 0x9b,
  STOP_ADDRESS1, STOP_ADDRESS2, READ_RAM_STATUS = 0xa0
}
 

Functions

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_add_trigger (int channel, int type)
 
SR_PRIV void analyzer_add_filter (int channel, int type)
 
SR_PRIV void analyzer_set_trigger_count (int count)
 
SR_PRIV void analyzer_set_freq (int freq, int scale)
 
SR_PRIV void analyzer_set_memory_size (unsigned int size)
 
SR_PRIV void analyzer_set_ramsize_trigger_address (unsigned int address)
 
SR_PRIV void analyzer_set_triggerbar_address (unsigned int address)
 
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 void analyzer_set_compression (unsigned int type)
 
SR_PRIV void analyzer_wait_button (libusb_device_handle *devh)
 
SR_PRIV void analyzer_wait_data (libusb_device_handle *devh)
 
SR_PRIV int analyzer_decompress (void *input, unsigned int input_len, void *output, unsigned int output_len)
 

Enumeration Type Documentation

anonymous enum
Enumerator
HARD_DATA_CHECK_SUM 
PASS_WORD 
DEV_ID0 
DEV_ID1 
START_STATUS 
DEV_STATUS 
FREQUENCY_REG0 
FREQUENCY_REG1 
FREQUENCY_REG2 
FREQUENCY_REG3 
FREQUENCY_REG4 
MEMORY_LENGTH 
CLOCK_SOURCE 
TRIGGER_STATUS0 
TRIGGER_STATUS1 
TRIGGER_STATUS2 
TRIGGER_STATUS3 
TRIGGER_STATUS4 
TRIGGER_STATUS5 
TRIGGER_STATUS6 
TRIGGER_STATUS7 
TRIGGER_STATUS8 
TRIGGER_COUNT0 
TRIGGER_COUNT1 
TRIGGER_LEVEL0 
TRIGGER_LEVEL1 
TRIGGER_LEVEL2 
TRIGGER_LEVEL3 
RAMSIZE_TRIGGERBAR_ADDRESS0 
RAMSIZE_TRIGGERBAR_ADDRESS1 
RAMSIZE_TRIGGERBAR_ADDRESS2 
TRIGGERBAR_ADDRESS0 
TRIGGERBAR_ADDRESS1 
TRIGGERBAR_ADDRESS2 
DONT_CARE_TRIGGERBAR 
FILTER_ENABLE 
FILTER_STATUS 
ENABLE_DELAY_TIME0 
ENABLE_DELAY_TIME1 
ENABLE_INSERT_DATA0 
ENABLE_INSERT_DATA1 
ENABLE_INSERT_DATA2 
ENABLE_INSERT_DATA3 
COMPRESSION_TYPE0 
COMPRESSION_TYPE1 
TRIGGER_ADDRESS0 
TRIGGER_ADDRESS1 
TRIGGER_ADDRESS2 
NOW_ADDRESS0 
NOW_ADDRESS1 
NOW_ADDRESS2 
STOP_ADDRESS0 
STOP_ADDRESS1 
STOP_ADDRESS2 
READ_RAM_STATUS 

Definition at line 36 of file analyzer.c.

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: