Skip to content

Commit e4d0509

Browse files
committed
sipeed-slogic-analyzer: fix: standardize product name to "SLogic16U3"
1 parent e5f26a9 commit e4d0509

1 file changed

Lines changed: 40 additions & 40 deletions

File tree

  • src/hardware/sipeed-slogic-analyzer

src/hardware/sipeed-slogic-analyzer/api.c

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -39,35 +39,35 @@ static const uint32_t devopts[] = {
3939

4040

4141
static void slogic_submit_raw_data(void *data, size_t len, const struct sr_dev_inst *sdi);
42-
static int slogic_lite_8_remote_run(const struct sr_dev_inst *sdi);
43-
static int slogic_lite_8_remote_stop(const struct sr_dev_inst *sdi);
44-
static int slogic_basic_16_remote_run(const struct sr_dev_inst *sdi);
45-
static int slogic_basic_16_remote_stop(const struct sr_dev_inst *sdi);
42+
static int slogic_combo8_remote_run(const struct sr_dev_inst *sdi);
43+
static int slogic_combo8_remote_stop(const struct sr_dev_inst *sdi);
44+
static int slogic16U3_remote_run(const struct sr_dev_inst *sdi);
45+
static int slogic16U3_remote_stop(const struct sr_dev_inst *sdi);
4646

4747
static const struct slogic_model support_models[] = {
4848
{
49-
.name = "Slogic Lite 8",
49+
.name = "Sogic Combo 8",
5050
.pid = 0x0300,
5151
.ep_in = 0x01 | LIBUSB_ENDPOINT_IN,
5252
.max_samplerate = SR_MHZ(160),
5353
.max_samplechannel = 8,
5454
.max_bandwidth = SR_MHZ(320),
5555
.operation = {
56-
.remote_run = slogic_lite_8_remote_run,
57-
.remote_stop = slogic_lite_8_remote_stop,
56+
.remote_run = slogic_combo8_remote_run,
57+
.remote_stop = slogic_combo8_remote_stop,
5858
},
5959
.submit_raw_data = slogic_submit_raw_data,
6060
},
6161
{
62-
.name = "Slogic Basic 16 U3",
62+
.name = "SLogic16U3",
6363
.pid = 0x3031,
6464
.ep_in = 0x02 | LIBUSB_ENDPOINT_IN,
6565
.max_samplerate = SR_MHZ(1600),
6666
.max_samplechannel = 16,
6767
.max_bandwidth = SR_MHZ(3200),
6868
.operation = {
69-
.remote_run = slogic_basic_16_remote_run,
70-
.remote_stop = slogic_basic_16_remote_stop,
69+
.remote_run = slogic16U3_remote_run,
70+
.remote_stop = slogic16U3_remote_stop,
7171
},
7272
.submit_raw_data = slogic_submit_raw_data,
7373
},
@@ -90,7 +90,7 @@ static const uint64_t samplerates[] = {
9090
SR_MHZ(20),
9191
SR_MHZ(32),
9292

93-
/* Slogic Lite 8 */
93+
/* SLogic Combo 8 */
9494
/* x 8ch */
9595
SR_MHZ(40),
9696
/* x 4ch */
@@ -99,7 +99,7 @@ static const uint64_t samplerates[] = {
9999
SR_MHZ(125),
100100
SR_MHZ(160),
101101

102-
/* Slogic Basic 16 U3 */
102+
/* SLogic16U3 */
103103
/* x 16ch */
104104
SR_MHZ(200),
105105
/* x 8ch */
@@ -440,7 +440,7 @@ static int config_list(uint32_t key, GVariant **data,
440440

441441
static struct sr_dev_driver sipeed_slogic_analyzer_driver_info = {
442442
.name = "sipeed-slogic-analyzer",
443-
.longname = "Sipeed Slogic Analyzer",
443+
.longname = "Sipeed SLogic Analyzer",
444444
.api_version = 1,
445445
.init = std_init,
446446
.cleanup = std_cleanup,
@@ -492,7 +492,7 @@ static void slogic_submit_raw_data(void *data, size_t len, const struct sr_dev_i
492492
g_free(ptr);
493493
}
494494

495-
/* Slogic Lite 8 start */
495+
/* SLogic Combo 8 start */
496496
#pragma pack(push, 1)
497497
struct cmd_start_acquisition {
498498
union {
@@ -509,7 +509,7 @@ struct cmd_start_acquisition {
509509
#define CMD_START 0xb1
510510
#define CMD_STOP 0xb3
511511

512-
static int slogic_lite_8_remote_run(const struct sr_dev_inst *sdi) {
512+
static int slogic_combo8_remote_run(const struct sr_dev_inst *sdi) {
513513
struct dev_context *devc = sdi->priv;
514514
const struct cmd_start_acquisition cmd_run = {
515515
.sample_rate = devc->cur_samplerate / SR_MHZ(1),
@@ -518,7 +518,7 @@ static int slogic_lite_8_remote_run(const struct sr_dev_inst *sdi) {
518518
return slogic_usb_control_write(sdi, CMD_START, 0x0000, 0x0000, (uint8_t *)&cmd_run, sizeof(cmd_run), 500);
519519
}
520520

521-
static int slogic_lite_8_remote_stop(const struct sr_dev_inst *sdi) {
521+
static int slogic_combo8_remote_stop(const struct sr_dev_inst *sdi) {
522522
struct dev_context *devc = sdi->priv;
523523
struct sr_usb_dev_inst *usb = sdi->conn;
524524
clear_ep(sdi);
@@ -528,49 +528,49 @@ static int slogic_lite_8_remote_stop(const struct sr_dev_inst *sdi) {
528528
// clear_ep(sdi);
529529
// return ret;
530530
}
531-
/* Slogic Lite 8 end */
531+
/* SLogic Combo 8 end */
532532

533533

534534

535-
/* Slogic Basic 16 start */
536-
#define SLOGIC_BASIC_16_CONTROL_IN_REQ_REG_READ 0x00
537-
#define SLOGIC_BASIC_16_CONTROL_OUT_REQ_REG_WRITE 0x01
535+
/* SLogic16U3 start */
536+
#define SLOGIC16U3_CONTROL_IN_REQ_REG_READ 0x00
537+
#define SLOGIC16U3_CONTROL_OUT_REQ_REG_WRITE 0x01
538538

539-
#define SLOGIC_BASIC_16_R32_CTRL 0x0004
540-
#define SLOGIC_BASIC_16_R32_FLAG 0x0008
541-
#define SLOGIC_BASIC_16_R32_AUX 0x000c
539+
#define SLOGIC16U3_R32_CTRL 0x0004
540+
#define SLOGIC16U3_R32_FLAG 0x0008
541+
#define SLOGIC16U3_R32_AUX 0x000c
542542

543-
static int slogic_basic_16_remote_run(const struct sr_dev_inst *sdi) {
543+
static int slogic16U3_remote_run(const struct sr_dev_inst *sdi) {
544544
struct dev_context *devc = sdi->priv;
545545
const uint8_t cmd_derst[] = {0x00, 0x00, 0x00, 0x00};
546546
const uint8_t cmd_run[] = {0x01, 0x00, 0x00, 0x00};
547547
uint8_t cmd_aux[64] = {0}; // configure aux
548548

549-
slogic_usb_control_write(sdi, SLOGIC_BASIC_16_CONTROL_OUT_REQ_REG_WRITE, SLOGIC_BASIC_16_R32_CTRL, 0x0000, ARRAY_AND_SIZE(cmd_derst), 500);
549+
slogic_usb_control_write(sdi, SLOGIC16U3_CONTROL_OUT_REQ_REG_WRITE, SLOGIC16U3_R32_CTRL, 0x0000, ARRAY_AND_SIZE(cmd_derst), 500);
550550

551551
{
552552
size_t retry = 0;
553553
memset(cmd_aux, 0, sizeof(cmd_aux));
554554
*(uint32_t*)(cmd_aux) = 0x00000001;
555-
slogic_usb_control_write(sdi, SLOGIC_BASIC_16_CONTROL_OUT_REQ_REG_WRITE, SLOGIC_BASIC_16_R32_AUX, 0x0000, cmd_aux, 4, 500);
555+
slogic_usb_control_write(sdi, SLOGIC16U3_CONTROL_OUT_REQ_REG_WRITE, SLOGIC16U3_R32_AUX, 0x0000, cmd_aux, 4, 500);
556556
do {
557-
slogic_usb_control_read(sdi, SLOGIC_BASIC_16_CONTROL_IN_REQ_REG_READ, SLOGIC_BASIC_16_R32_AUX, 0x0000, cmd_aux, 4, 500);
557+
slogic_usb_control_read(sdi, SLOGIC16U3_CONTROL_IN_REQ_REG_READ, SLOGIC16U3_R32_AUX, 0x0000, cmd_aux, 4, 500);
558558
sr_dbg("[%u]read aux channel: %08x.", retry, ((uint32_t*)cmd_aux)[0]);
559559
retry += 1;
560560
if (retry > 5)
561561
return SR_ERR_TIMEOUT;
562562
} while (!(cmd_aux[2] & 0x01));
563563
sr_dbg("channel length: %u.", (*(uint16_t*)cmd_aux)>>9);
564-
slogic_usb_control_read(sdi, SLOGIC_BASIC_16_CONTROL_IN_REQ_REG_READ, SLOGIC_BASIC_16_R32_AUX + 4, 0x0000, cmd_aux + 4, (*(uint16_t*)cmd_aux)>>9, 500);
564+
slogic_usb_control_read(sdi, SLOGIC16U3_CONTROL_IN_REQ_REG_READ, SLOGIC16U3_R32_AUX + 4, 0x0000, cmd_aux + 4, (*(uint16_t*)cmd_aux)>>9, 500);
565565

566566
sr_dbg("aux: %u %u %u %u %08x.", cmd_aux[0], cmd_aux[1], cmd_aux[2], cmd_aux[3], ((uint32_t*)(cmd_aux+4))[0]);
567567

568568
*(uint32_t*)(cmd_aux+4) = (1 << devc->cur_samplechannel) - 1;
569569

570570
sr_dbg("aux: %u %u %u %u %08x.", cmd_aux[0], cmd_aux[1], cmd_aux[2], cmd_aux[3], ((uint32_t*)(cmd_aux+4))[0]);
571-
slogic_usb_control_write(sdi, SLOGIC_BASIC_16_CONTROL_OUT_REQ_REG_WRITE, SLOGIC_BASIC_16_R32_AUX + 4, 0x0000, cmd_aux + 4, (*(uint16_t*)cmd_aux)>>9, 500);
571+
slogic_usb_control_write(sdi, SLOGIC16U3_CONTROL_OUT_REQ_REG_WRITE, SLOGIC16U3_R32_AUX + 4, 0x0000, cmd_aux + 4, (*(uint16_t*)cmd_aux)>>9, 500);
572572

573-
slogic_usb_control_read(sdi, SLOGIC_BASIC_16_CONTROL_IN_REQ_REG_READ, SLOGIC_BASIC_16_R32_AUX + 4, 0x0000, cmd_aux + 4, (*(uint16_t*)cmd_aux)>>9, 500);
573+
slogic_usb_control_read(sdi, SLOGIC16U3_CONTROL_IN_REQ_REG_READ, SLOGIC16U3_R32_AUX + 4, 0x0000, cmd_aux + 4, (*(uint16_t*)cmd_aux)>>9, 500);
574574
sr_dbg("aux: %u %u %u %u %08x.", cmd_aux[0], cmd_aux[1], cmd_aux[2], cmd_aux[3], ((uint32_t*)(cmd_aux+4))[0]);
575575

576576
if ((1 << devc->cur_samplechannel) - 1 != *(uint32_t*)(cmd_aux+4)) {
@@ -585,9 +585,9 @@ static int slogic_basic_16_remote_run(const struct sr_dev_inst *sdi) {
585585
size_t retry = 0;
586586
memset(cmd_aux, 0, sizeof(cmd_aux));
587587
*(uint32_t*)(cmd_aux) = 0x00000002;
588-
slogic_usb_control_write(sdi, SLOGIC_BASIC_16_CONTROL_OUT_REQ_REG_WRITE, SLOGIC_BASIC_16_R32_AUX, 0x0000, cmd_aux, 4, 500);
588+
slogic_usb_control_write(sdi, SLOGIC16U3_CONTROL_OUT_REQ_REG_WRITE, SLOGIC16U3_R32_AUX, 0x0000, cmd_aux, 4, 500);
589589
do {
590-
slogic_usb_control_read(sdi, SLOGIC_BASIC_16_CONTROL_IN_REQ_REG_READ, SLOGIC_BASIC_16_R32_AUX, 0x0000, cmd_aux, 4, 500);
590+
slogic_usb_control_read(sdi, SLOGIC16U3_CONTROL_IN_REQ_REG_READ, SLOGIC16U3_R32_AUX, 0x0000, cmd_aux, 4, 500);
591591
sr_dbg("[%u]read aux samplerate: %08x.", retry, ((uint32_t*)cmd_aux)[0]);
592592
retry += 1;
593593
if (retry > 5)
@@ -596,7 +596,7 @@ static int slogic_basic_16_remote_run(const struct sr_dev_inst *sdi) {
596596
sr_dbg("samplerate length: %u.", (*(uint16_t*)cmd_aux)>>9);
597597

598598
while (((uint16_t*)(cmd_aux+4))[0] <= 1) {
599-
slogic_usb_control_read(sdi, SLOGIC_BASIC_16_CONTROL_IN_REQ_REG_READ, SLOGIC_BASIC_16_R32_AUX + 4, 0x0000, cmd_aux + 4, (*(uint16_t*)cmd_aux)>>9, 500);
599+
slogic_usb_control_read(sdi, SLOGIC16U3_CONTROL_IN_REQ_REG_READ, SLOGIC16U3_R32_AUX + 4, 0x0000, cmd_aux + 4, (*(uint16_t*)cmd_aux)>>9, 500);
600600

601601
sr_dbg("aux: %u %u %u %u %x %u %u.", cmd_aux[0], cmd_aux[1], cmd_aux[2], cmd_aux[3], ((uint16_t*)(cmd_aux+4))[0], ((uint16_t*)(cmd_aux+4))[1], ((uint32_t*)(cmd_aux+4))[1]);
602602

@@ -605,16 +605,16 @@ static int slogic_basic_16_remote_run(const struct sr_dev_inst *sdi) {
605605
if (base % devc->cur_samplerate) {
606606
sr_dbg("Failed to configure samplerate from base[%u] %u.", ((uint16_t*)(cmd_aux+4))[0], base);
607607
((uint16_t*)(cmd_aux+4))[0] += 1;
608-
slogic_usb_control_write(sdi, SLOGIC_BASIC_16_CONTROL_OUT_REQ_REG_WRITE, SLOGIC_BASIC_16_R32_AUX + 4, 0x0000, cmd_aux + 4, 4, 500);
608+
slogic_usb_control_write(sdi, SLOGIC16U3_CONTROL_OUT_REQ_REG_WRITE, SLOGIC16U3_R32_AUX + 4, 0x0000, cmd_aux + 4, 4, 500);
609609
continue;
610610
}
611611
uint32_t div = base / devc->cur_samplerate;
612612
((uint32_t*)(cmd_aux+4))[1] = div;
613613

614614
sr_dbg("aux: %u %u %u %u %x %u %u.", cmd_aux[0], cmd_aux[1], cmd_aux[2], cmd_aux[3], ((uint16_t*)(cmd_aux+4))[0], ((uint16_t*)(cmd_aux+4))[1], ((uint32_t*)(cmd_aux+4))[1]);
615-
slogic_usb_control_write(sdi, SLOGIC_BASIC_16_CONTROL_OUT_REQ_REG_WRITE, SLOGIC_BASIC_16_R32_AUX + 4, 0x0000, cmd_aux + 4, (*(uint16_t*)cmd_aux)>>9, 500);
615+
slogic_usb_control_write(sdi, SLOGIC16U3_CONTROL_OUT_REQ_REG_WRITE, SLOGIC16U3_R32_AUX + 4, 0x0000, cmd_aux + 4, (*(uint16_t*)cmd_aux)>>9, 500);
616616

617-
slogic_usb_control_read(sdi, SLOGIC_BASIC_16_CONTROL_IN_REQ_REG_READ, SLOGIC_BASIC_16_R32_AUX + 4, 0x0000, cmd_aux + 4, (*(uint16_t*)cmd_aux)>>9, 500);
617+
slogic_usb_control_read(sdi, SLOGIC16U3_CONTROL_IN_REQ_REG_READ, SLOGIC16U3_R32_AUX + 4, 0x0000, cmd_aux + 4, (*(uint16_t*)cmd_aux)>>9, 500);
618618
sr_dbg("aux: %u %u %u %u %x %u %u.", cmd_aux[0], cmd_aux[1], cmd_aux[2], cmd_aux[3], ((uint16_t*)(cmd_aux+4))[0], ((uint16_t*)(cmd_aux+4))[1], ((uint32_t*)(cmd_aux+4))[1]);
619619
break;
620620
}
@@ -626,14 +626,14 @@ static int slogic_basic_16_remote_run(const struct sr_dev_inst *sdi) {
626626
}
627627
}
628628

629-
return slogic_usb_control_write(sdi, SLOGIC_BASIC_16_CONTROL_OUT_REQ_REG_WRITE, SLOGIC_BASIC_16_R32_CTRL, 0x0000, ARRAY_AND_SIZE(cmd_run), 500);
629+
return slogic_usb_control_write(sdi, SLOGIC16U3_CONTROL_OUT_REQ_REG_WRITE, SLOGIC16U3_R32_CTRL, 0x0000, ARRAY_AND_SIZE(cmd_run), 500);
630630
}
631631

632-
static int slogic_basic_16_remote_stop(const struct sr_dev_inst *sdi) {
632+
static int slogic16U3_remote_stop(const struct sr_dev_inst *sdi) {
633633
const uint8_t cmd_rst[] = {0x02, 0x00, 0x00, 0x00};
634-
return slogic_usb_control_write(sdi, SLOGIC_BASIC_16_CONTROL_OUT_REQ_REG_WRITE, SLOGIC_BASIC_16_R32_CTRL, 0x0000, ARRAY_AND_SIZE(cmd_rst), 500);
634+
return slogic_usb_control_write(sdi, SLOGIC16U3_CONTROL_OUT_REQ_REG_WRITE, SLOGIC16U3_R32_CTRL, 0x0000, ARRAY_AND_SIZE(cmd_rst), 500);
635635
}
636-
/* Slogic Basic 16 end */
636+
/* SLogic16U3 end */
637637

638638
static int slogic_usb_control_write(const struct sr_dev_inst *sdi, uint8_t request, uint16_t value, uint16_t index, uint8_t *data, size_t len, int timeout)
639639
{

0 commit comments

Comments
 (0)