Add support for Electronut Labs Papyr

Signed-off-by: Tavish Naruka <tavishnaruka@gmail.com>
This commit is contained in:
Tavish Naruka
2019-04-12 19:41:55 +05:30
parent 9d7de45aeb
commit 389c05b643
4 changed files with 131 additions and 20 deletions

View File

@ -79,30 +79,33 @@ enum {
// STRING DESCRIPTORS
//--------------------------------------------------------------------+
#ifndef USB_STRING_DESCRIPTORS
#define USB_STRING_DESCRIPTORS { \
/* 0: is supported language = English */ \
TUD_DESC_STRCONV(0x0409), \
\
/* 1: Manufacturer */ \
TUD_DESC_STRCONV('A','d','a','f','r','u','i','t',' ','I','n','d','u','s','t','r','i','e','s'), \
\
/* 2: Product */ \
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','n','R','F','5','2','8','4','0', ' ', 'D','F','U'), \
\
/* 3: Serials TODO use chip ID */ \
usb_desc_str_serial, \
\
/* 4: CDC Interface */ \
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','S','e','r','i','a','l'), \
\
/* 5: MSC Interface */ \
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','U','F','2'), \
}
#endif
// Serial is 64-bit DeviceID -> 16 chars len
uint16_t usb_desc_str_serial[1+16] = { TUD_DESC_STR_HEADER(16) };
// array of pointer to string descriptors
uint16_t const * const string_desc_arr [] =
{
// 0: is supported language = English
TUD_DESC_STRCONV(0x0409),
// 1: Manufacturer
TUD_DESC_STRCONV('A','d','a','f','r','u','i','t',' ','I','n','d','u','s','t','r','i','e','s'),
// 2: Product
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','n','R','F','5','2','8','4','0', ' ', 'D','F','U'),
// 3: Serials TODO use chip ID
usb_desc_str_serial,
// 4: CDC Interface
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','S','e','r','i','a','l'),
// 5: MSC Interface
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','U','F','2'),
};
uint16_t const * const string_desc_arr [] = USB_STRING_DESCRIPTORS;
//--------------------------------------------------------------------+
// Device Descriptor

View File

@ -40,15 +40,23 @@
#define USB_DESC_H_
#include "tusb.h"
#include "boards.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef USB_DESC_VID
#define USB_DESC_VID 0x239A
#endif
#ifndef USB_DESC_UF2_PID
#define USB_DESC_UF2_PID 0x0029
#endif
#ifndef USB_DESC_SERIAL_ONLY_PID
#define USB_DESC_SERIAL_ONLY_PID 0x002A
#endif
/*------------- Configuration Descriptor -------------*/