diff options
Diffstat (limited to 'firmware/fx3/b200')
-rw-r--r-- | firmware/fx3/b200/b200_main.c | 35 | ||||
-rw-r--r-- | firmware/fx3/b200/b200_main.h | 4 | ||||
-rw-r--r-- | firmware/fx3/b200/b200_usb_descriptors.c | 84 |
3 files changed, 120 insertions, 3 deletions
diff --git a/firmware/fx3/b200/b200_main.c b/firmware/fx3/b200/b200_main.c index 077ee251b..cb0172af3 100644 --- a/firmware/fx3/b200/b200_main.c +++ b/firmware/fx3/b200/b200_main.c @@ -2034,6 +2034,7 @@ void b200_usb_init(void) { /* Check to see if a VID/PID is in the EEPROM that we should use. */ uint8_t valid[4]; + uint8_t vidpid[4]; CyU3PMemSet(valid, 0, 4); CyFxUsbI2cTransfer(0x0, 0xA0, 4, valid, CyTrue); if(*((uint32_t *) &(valid[0])) == 0xB2145943) { @@ -2041,7 +2042,6 @@ void b200_usb_init(void) { /* Pull the programmed device serial out of the i2c EEPROM, and copy the * characters into the device serial string, which is then advertised as * part of the USB descriptors. */ - uint8_t vidpid[4]; CyU3PMemSet(vidpid, 0, 4); CyFxUsbI2cTransfer(0x4, 0xA0, 4, vidpid, CyTrue); b200_usb2_dev_desc[8] = vidpid[2]; @@ -2055,6 +2055,35 @@ void b200_usb_init(void) { b200_usb3_dev_desc[11] = vidpid[1]; } + /* We support two VIDs: + * Ettus Research: 0x2500 + * National Instruments: 0x3923 + * + * We support three PIDs: + * Ettus B200/B210: 0x0020 + * NI USRP-2900: 0x7813 + * NI USRP-2901: 0x7814 + */ + uint8_t *mfr_string = NULL; + uint8_t *product_string = NULL; + if((vidpid[3] == 0x25) && (vidpid[2] == 0x00)) { + mfr_string = b200_usb_manufacture_desc; + product_string = b200_usb_product_desc; + } else if((vidpid[3] == 0x39) && (vidpid[2] == 0x23)) { + mfr_string = niusrp_usb_manufacture_desc; + + if((vidpid[1] == 0x78) && (vidpid[0] == 0x13)) { + product_string = niusrp_2900_usb_product_desc; + } else if((vidpid[1] == 0x78) && (vidpid[0] == 0x14)) { + product_string = niusrp_2901_usb_product_desc; + } else { + product_string = unknown_desc; + } + } else { + mfr_string = unknown_desc; + product_string = unknown_desc; + } + uint8_t ascii_serial[9]; CyU3PMemSet(ascii_serial, 0, 9); CyFxUsbI2cTransfer(0x4f7, 0xA0, 9, ascii_serial, CyTrue); @@ -2101,10 +2130,10 @@ void b200_usb_init(void) { (uint8_t *) b200_string_lang_id_desc); CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 1, - (uint8_t *) b200_usb_manufacture_desc); + (uint8_t *) mfr_string); CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 2, - (uint8_t *) b200_usb_product_desc); + (uint8_t *) product_string); CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 3, (uint8_t *) dev_serial); diff --git a/firmware/fx3/b200/b200_main.h b/firmware/fx3/b200/b200_main.h index 2c6f178ec..61048abc9 100644 --- a/firmware/fx3/b200/b200_main.h +++ b/firmware/fx3/b200/b200_main.h @@ -128,6 +128,10 @@ extern const uint8_t b200_usb_ss_config_desc[]; extern const uint8_t b200_string_lang_id_desc[]; extern const uint8_t b200_usb_manufacture_desc[]; extern const uint8_t b200_usb_product_desc[]; +extern const uint8_t niusrp_usb_manufacture_desc[]; +extern const uint8_t niusrp_2900_usb_product_desc[]; +extern const uint8_t niusrp_2901_usb_product_desc[]; +extern const uint8_t unknown_desc[]; extern uint8_t dev_serial[]; diff --git a/firmware/fx3/b200/b200_usb_descriptors.c b/firmware/fx3/b200/b200_usb_descriptors.c index e8a765b24..03dbce74a 100644 --- a/firmware/fx3/b200/b200_usb_descriptors.c +++ b/firmware/fx3/b200/b200_usb_descriptors.c @@ -458,6 +458,39 @@ const uint8_t b200_usb_manufacture_desc[] __attribute__ ((aligned (32))) = 'C',0x00 }; +/* NI Manufacturer String Descriptor */ +const uint8_t niusrp_usb_manufacture_desc[] __attribute__ ((aligned (32))) = + { + 0x36, /* Descriptor Size */ + CY_U3P_USB_STRING_DESCR, /* Device Descriptor Type */ + 'N',0x00, + 'a',0x00, + 't',0x00, + 'i',0x00, + 'o',0x00, + 'n',0x00, + 'a',0x00, + 'l',0x00, + ' ',0x00, + 'I',0x00, + 'n',0x00, + 's',0x00, + 't',0x00, + 'r',0x00, + 'u',0x00, + 'm',0x00, + 'e',0x00, + 'n',0x00, + 't',0x00, + 's',0x00, + ' ',0x00, + 'C',0x00, + 'o',0x00, + 'r',0x00, + 'p',0x00, + '.',0x00 + }; + /* Standard Product String Descriptor */ const uint8_t b200_usb_product_desc[] __attribute__ ((aligned (32))) = @@ -475,6 +508,57 @@ const uint8_t b200_usb_product_desc[] __attribute__ ((aligned (32))) = '0',0x00 }; +/* NI-USRP 2900 Product String Descriptor */ +const uint8_t niusrp_2900_usb_product_desc[] __attribute__ ((aligned (32))) = + { + 0x1A, /* Descriptor Size */ + CY_U3P_USB_STRING_DESCR, /* Device Descriptor Type */ + 'N',0x00, + 'I',0x00, + ' ',0x00, + 'U',0x00, + 'S',0x00, + 'R',0x00, + 'P',0x00, + '-',0x00, + '2',0x00, + '9',0x00, + '0',0x00, + '0',0x00 + }; + +/* NI-USRP 2901 Product String Descriptor */ +const uint8_t niusrp_2901_usb_product_desc[] __attribute__ ((aligned (32))) = + { + 0x1A, /* Descriptor Size */ + CY_U3P_USB_STRING_DESCR, /* Device Descriptor Type */ + 'N',0x00, + 'I',0x00, + ' ',0x00, + 'U',0x00, + 'S',0x00, + 'R',0x00, + 'P',0x00, + '-',0x00, + '2',0x00, + '9',0x00, + '0',0x00, + '1',0x00 + }; + +const uint8_t unknown_desc[] __attribute__ ((aligned (32))) = + { + 0x10, /* Descriptor Size */ + CY_U3P_USB_STRING_DESCR, /* Device Descriptor Type */ + 'U',0x00, + 'n',0x00, + 'k',0x00, + 'n',0x00, + 'o',0x00, + 'w',0x00, + 'n',0x00 + }; + /* Microsoft OS Descriptor. */ const uint8_t CyFxUsbOSDscr[] __attribute__ ((aligned (32))) = { |