sysclk-lwla: Define constants for long registers
This commit is contained in:
parent
586ff70a21
commit
30f34dbdf0
|
@ -101,6 +101,23 @@ enum {
|
|||
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 {
|
||||
|
|
|
@ -328,7 +328,7 @@ static void issue_stop_capture(const struct sr_dev_inst *sdi)
|
|||
regvals = devc->reg_write_seq;
|
||||
|
||||
regvals[0].reg = REG_LONG_ADDR;
|
||||
regvals[0].val = 10;
|
||||
regvals[0].val = LREG_CAP_CTRL;
|
||||
|
||||
regvals[1].reg = REG_LONG_LOW;
|
||||
regvals[1].val = 0;
|
||||
|
@ -713,12 +713,12 @@ SR_PRIV int lwla_init_device(const struct sr_dev_inst *sdi)
|
|||
if (ret != SR_OK)
|
||||
return ret;
|
||||
|
||||
ret = lwla_read_long_reg(sdi->conn, 100, &value);
|
||||
ret = lwla_read_long_reg(sdi->conn, LREG_TEST_ID, &value);
|
||||
if (ret != SR_OK)
|
||||
return ret;
|
||||
|
||||
/* Ignore the value returned by the first read */
|
||||
ret = lwla_read_long_reg(sdi->conn, 100, &value);
|
||||
ret = lwla_read_long_reg(sdi->conn, LREG_TEST_ID, &value);
|
||||
if (ret != SR_OK)
|
||||
return ret;
|
||||
|
||||
|
@ -821,11 +821,11 @@ SR_PRIV int lwla_setup_acquisition(const struct sr_dev_inst *sdi)
|
|||
regvals[1].val = MEM_CTRL_WRITE;
|
||||
|
||||
regvals[2].reg = REG_LONG_ADDR;
|
||||
regvals[2].val = 10;
|
||||
regvals[2].val = LREG_CAP_CTRL;
|
||||
|
||||
regvals[3].reg = REG_LONG_LOW;
|
||||
regvals[3].val = 0x74;
|
||||
|
||||
regvals[3].val = CAP_CTRL_CLR_TIMEBASE | CAP_CTRL_FLUSH_FIFO
|
||||
| CAP_CTRL_CLR_FIFOFULL | CAP_CTRL_CLR_COUNTER;
|
||||
regvals[4].reg = REG_LONG_HIGH;
|
||||
regvals[4].val = 0;
|
||||
|
||||
|
@ -875,10 +875,10 @@ SR_PRIV int lwla_start_acquisition(const struct sr_dev_inst *sdi)
|
|||
regvals = devc->reg_write_seq;
|
||||
|
||||
regvals[0].reg = REG_LONG_ADDR;
|
||||
regvals[0].val = 10;
|
||||
regvals[0].val = LREG_CAP_CTRL;
|
||||
|
||||
regvals[1].reg = REG_LONG_LOW;
|
||||
regvals[1].val = 1;
|
||||
regvals[1].val = CAP_CTRL_TRG_EN;
|
||||
|
||||
regvals[2].reg = REG_LONG_HIGH;
|
||||
regvals[2].val = 0;
|
||||
|
|
Loading…
Reference in New Issue