X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fsysclk-lwla%2Flwla.h;h=9eb69566c6e89dabfdc1c2c18f787ed9c3f5cc50;hb=30f34dbdf0ee8a389b4219ed7808bec64421f3e0;hp=052e1199eeaf3360cbab7d613b84669f23d9ddba;hpb=db24496ac8575e917996e7812279987f2141c298;p=libsigrok.git diff --git a/src/hardware/sysclk-lwla/lwla.h b/src/hardware/sysclk-lwla/lwla.h index 052e1199..9eb69566 100644 --- a/src/hardware/sysclk-lwla/lwla.h +++ b/src/hardware/sysclk-lwla/lwla.h @@ -20,10 +20,10 @@ #ifndef LIBSIGROK_HARDWARE_SYSCLK_LWLA_LWLA_H #define LIBSIGROK_HARDWARE_SYSCLK_LWLA_LWLA_H -#include "libsigrok.h" #include #include #include +#include struct sr_usb_dev_inst; @@ -74,19 +74,19 @@ enum { STATUS_FLAG_MASK = 0x3F }; -/** LWLA register addresses. +/** LWLA1034 register addresses. */ enum { - REG_MEM_CTRL2 = 0x1074, /* capture buffer control ??? */ + REG_MEM_CTRL = 0x1074, /* capture buffer control */ REG_MEM_FILL = 0x1078, /* capture buffer fill level */ - REG_MEM_CTRL4 = 0x107C, /* capture buffer control ??? */ + REG_MEM_START = 0x107C, /* capture buffer start address */ REG_DIV_BYPASS = 0x1094, /* bypass clock divider flag */ - REG_CMD_CTRL1 = 0x10B0, /* command control ??? */ - REG_CMD_CTRL2 = 0x10B4, /* command control ??? */ - REG_CMD_CTRL3 = 0x10B8, /* command control ??? */ - REG_CMD_CTRL4 = 0x10BC, /* command control ??? */ + REG_LONG_STROBE = 0x10B0, /* long register read/write strobe */ + REG_LONG_ADDR = 0x10B4, /* long register address */ + REG_LONG_LOW = 0x10B8, /* long register low word */ + REG_LONG_HIGH = 0x10BC, /* long register high word */ REG_FREQ_CH1 = 0x10C0, /* channel 1 live frequency */ REG_FREQ_CH2 = 0x10C4, /* channel 2 live frequency */ @@ -94,6 +94,30 @@ enum { REG_FREQ_CH4 = 0x10CC, /* channel 4 live frequency */ }; +/** Flag bits for REG_MEM_CTRL. + */ +enum { + MEM_CTRL_WRITE = 1 << 0, /* "wr1rd0" bit */ + MEM_CTRL_CLR_IDX = 1 << 1, /* "clr_idx" bit */ +}; + +/* LWLA1034 long register addresses. + */ +enum { + LREG_CAP_CTRL = 10, /* capture control bits */ + LREG_TEST_ID = 100, /* constant test ID */ +}; + +/** Flag bits for LREG_CAP_CTRL. + */ +enum { + CAP_CTRL_TRG_EN = 1 << 0, /* "trg_en" bit */ + CAP_CTRL_CLR_TIMEBASE = 1 << 2, /* "do_clr_timebase" bit */ + CAP_CTRL_FLUSH_FIFO = 1 << 4, /* "flush_fifo" bit */ + CAP_CTRL_CLR_FIFOFULL = 1 << 5, /* "clr_fifo32_ful" bit */ + CAP_CTRL_CLR_COUNTER = 1 << 6, /* "clr_cntr0" bit */ +}; + /** Register/value pair. */ struct regval_pair { @@ -101,8 +125,9 @@ struct regval_pair { unsigned int val; }; -SR_PRIV int lwla_send_bitstream(const struct sr_usb_dev_inst *usb, - const char *basename); +SR_PRIV int lwla_send_bitstream(struct sr_context *ctx, + const struct sr_usb_dev_inst *usb, + const char *name); SR_PRIV int lwla_send_command(const struct sr_usb_dev_inst *usb, const uint16_t *command, int cmd_len); @@ -113,6 +138,9 @@ SR_PRIV int lwla_receive_reply(const struct sr_usb_dev_inst *usb, SR_PRIV int lwla_read_reg(const struct sr_usb_dev_inst *usb, uint16_t reg, uint32_t *value); +SR_PRIV int lwla_read_long_reg(const struct sr_usb_dev_inst *usb, + uint32_t addr, uint64_t *value); + SR_PRIV int lwla_write_reg(const struct sr_usb_dev_inst *usb, uint16_t reg, uint32_t value);