X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fasix-sigma%2Fasix-sigma.h;h=4c9deff68bf480ddbf859fe8eb5c3bd747bad115;hb=b5bbc3f1b00d5f3096c6800af4069fb07704d3a9;hp=528e6617a6386076518f47473b9aa3b20af89835;hpb=ba7dd8bbb8168cba432a844259a3e239aa5f36d7;p=libsigrok.git diff --git a/hardware/asix-sigma/asix-sigma.h b/hardware/asix-sigma/asix-sigma.h index 528e6617..4c9deff6 100644 --- a/hardware/asix-sigma/asix-sigma.h +++ b/hardware/asix-sigma/asix-sigma.h @@ -55,17 +55,17 @@ enum sigma_read_register { READ_TEST = 15, }; -#define REG_ADDR_LOW (0 << 4) -#define REG_ADDR_HIGH (1 << 4) -#define REG_DATA_LOW (2 << 4) -#define REG_DATA_HIGH_WRITE (3 << 4) -#define REG_READ_ADDR (4 << 4) -#define REG_DRAM_WAIT_ACK (5 << 4) +#define REG_ADDR_LOW (0x0 << 4) +#define REG_ADDR_HIGH (0x1 << 4) +#define REG_DATA_LOW (0x2 << 4) +#define REG_DATA_HIGH_WRITE (0x3 << 4) +#define REG_READ_ADDR (0x4 << 4) +#define REG_DRAM_WAIT_ACK (0x5 << 4) /* Bit (1 << 4) can be low or high (double buffer / cache) */ -#define REG_DRAM_BLOCK (6 << 4) -#define REG_DRAM_BLOCK_BEGIN (8 << 4) -#define REG_DRAM_BLOCK_DATA (10 << 4) +#define REG_DRAM_BLOCK (0x6 << 4) +#define REG_DRAM_BLOCK_BEGIN (0x8 << 4) +#define REG_DRAM_BLOCK_DATA (0xa << 4) #define LEDSEL0 6 #define LEDSEL1 7 @@ -76,6 +76,25 @@ enum sigma_read_register { #define CHUNK_SIZE 1024 +/* + * The entire ASIX Sigma DRAM is an array of struct sigma_dram_line[1024]; + */ + +/* One "DRAM cluster" contains a timestamp and 7 samples, 16b total. */ +struct sigma_dram_cluster { + uint8_t timestamp_lo; + uint8_t timestamp_hi; + struct { + uint8_t sample_hi; + uint8_t sample_lo; + } samples[7]; +}; + +/* One "DRAM line" contains 64 "DRAM clusters", 1024b total. */ +struct sigma_dram_line { + struct sigma_dram_cluster cluster[64]; +}; + struct clockselect_50 { uint8_t async; uint8_t fraction; @@ -167,12 +186,8 @@ struct sigma_state { SIGMA_DOWNLOAD, } state; - uint32_t stoppos, triggerpos; uint16_t lastts; uint16_t lastsample; - - int triggerchunk; - int chunks_downloaded; }; /* Private, per-device-instance driver context. */ @@ -184,6 +199,7 @@ struct dev_context { struct timeval start_tv; int cur_firmware; int num_channels; + int cur_channels; int samples_per_event; int capture_ratio; struct sigma_trigger trigger;