From ef42abb8184b4c26e8ad4d047d7cca4372c9300b Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Fri, 4 Oct 2019 13:49:33 +0200 Subject: Add a way to change max packet size for MSC --- supervisor/supervisor.mk | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'supervisor') diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index ee47be4b0..2b646f898 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -99,6 +99,10 @@ ifndef USB_MSC_NUM_ENDPOINT_PAIRS USB_MSC_NUM_ENDPOINT_PAIRS = 1 endif +ifndef USB_MSC_MAX_PACKET_SIZE +USB_MSC_MAX_PACKET_SIZE = 64 +endif + SUPERVISOR_O = $(addprefix $(BUILD)/, $(SRC_SUPERVISOR:.c=.o)) $(BUILD)/autogen_display_resources.o $(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h @@ -119,6 +123,7 @@ autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile --devices $(USB_DEVICES)\ --hid_devices $(USB_HID_DEVICES)\ --msc_num_endpoint_pairs $(USB_MSC_NUM_ENDPOINT_PAIRS)\ + --msc_max_packet_size $(USB_MSC_MAX_PACKET_SIZE)\ --output_c_file $(BUILD)/autogen_usb_descriptor.c\ --output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h -- cgit v1.2.3 From 7aefcc449a8a0f05bfd7c76ae745b8013f36dc57 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Tue, 1 Oct 2019 10:00:32 +0200 Subject: Add an alternative way to number the USB endpoints Two options available: - relative numbering (USB_RELATIVE_EP_NUM = 1) - default - absolute numbering (USB_RELATIVE_EP_NUM = 0) - new! --- ports/atmel-samd/mpconfigport.mk | 2 +- supervisor/supervisor.mk | 49 +++++++++++++++++++++++++++++++---- tools/gen_usb_descriptor.py | 55 +++++++++++++++++++++++++--------------- 3 files changed, 80 insertions(+), 26 deletions(-) (limited to 'supervisor') diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 51bbdd658..88ddb49e0 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -22,7 +22,7 @@ CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_TOUCHIO_USE_NATIVE = 1 # SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic. -USB_MSC_NUM_ENDPOINT_PAIRS = 2 +USB_MSC_EP_NUM_OUT = 1 endif # Put samd51-only choices here. diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index ee47be4b0..072066630 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -94,9 +94,40 @@ ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" endif -# SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic. -ifndef USB_MSC_NUM_ENDPOINT_PAIRS -USB_MSC_NUM_ENDPOINT_PAIRS = 1 +ifndef USB_RELATIVE_EP_NUM +USB_RELATIVE_EP_NUM = 1 +endif + +ifndef USB_CDC_EP_NUM_NOTIFICATION +USB_CDC_EP_NUM_NOTIFICATION = 0 +endif + +ifndef USB_CDC_EP_NUM_DATA_OUT +USB_CDC_EP_NUM_DATA_OUT = 0 +endif + +ifndef USB_CDC_EP_NUM_DATA_IN +USB_CDC_EP_NUM_DATA_IN = 0 +endif + +ifndef USB_MSC_EP_NUM_OUT +USB_MSC_EP_NUM_OUT = 0 +endif + +ifndef USB_MSC_EP_NUM_IN +USB_MSC_EP_NUM_IN = 0 +endif + +ifndef USB_HID_EP_NUM_IN +USB_HID_EP_NUM_IN = 0 +endif + +ifndef USB_MIDI_EP_NUM_OUT +USB_MIDI_EP_NUM_OUT = 0 +endif + +ifndef USB_MIDI_EP_NUM_IN +USB_MIDI_EP_NUM_IN = 0 endif SUPERVISOR_O = $(addprefix $(BUILD)/, $(SRC_SUPERVISOR:.c=.o)) $(BUILD)/autogen_display_resources.o @@ -116,9 +147,17 @@ autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile --vid $(USB_VID)\ --pid $(USB_PID)\ --serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\ - --devices $(USB_DEVICES)\ + --devices $(USB_DEVICES)\ --hid_devices $(USB_HID_DEVICES)\ - --msc_num_endpoint_pairs $(USB_MSC_NUM_ENDPOINT_PAIRS)\ + --relative_ep_num $(USB_RELATIVE_EP_NUM)\ + --cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\ + --cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\ + --cdc_ep_num_data_in $(USB_CDC_EP_NUM_DATA_IN)\ + --msc_ep_num_out $(USB_MSC_EP_NUM_OUT)\ + --msc_ep_num_in $(USB_MSC_EP_NUM_IN)\ + --hid_ep_num_in $(USB_HID_EP_NUM_IN)\ + --midi_ep_num_out $(USB_MIDI_EP_NUM_OUT)\ + --midi_ep_num_in $(USB_MIDI_EP_NUM_IN)\ --output_c_file $(BUILD)/autogen_usb_descriptor.c\ --output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index c4ff74d39..eccfbea67 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -32,8 +32,24 @@ parser.add_argument('--devices', type=lambda l: tuple(l.split(',')), default=DEF help='devices to include in descriptor (AUDIO includes MIDI support)') parser.add_argument('--hid_devices', type=lambda l: tuple(l.split(',')), default=DEFAULT_HID_DEVICES, help='HID devices to include in HID report descriptor') -parser.add_argument('--msc_num_endpoint_pairs', type=int, default=1, - help='Use 1 or 2 endpoint pairs for MSC (1 bidirectional, or 1 input + 1 output (required by SAMD21))') +parser.add_argument('--relative_ep_num', type=int, default=1, + help='use relative(1) or absolute(0) endpoint number') +parser.add_argument('--cdc_ep_num_notification', type=int, default=0, + help='endpoint number of CDC NOTIFICATION') +parser.add_argument('--cdc_ep_num_data_out', type=int, default=0, + help='endpoint number of CDC DATA OUT') +parser.add_argument('--cdc_ep_num_data_in', type=int, default=0, + help='endpoint number of CDC DATA IN') +parser.add_argument('--msc_ep_num_out', type=int, default=0, + help='endpoint number of MSC OUT') +parser.add_argument('--msc_ep_num_in', type=int, default=0, + help='endpoint number of MSC IN') +parser.add_argument('--hid_ep_num_in', type=int, default=0, + help='endpoint number of HID IN') +parser.add_argument('--midi_ep_num_out', type=int, default=0, + help='endpoint number of MIDI OUT') +parser.add_argument('--midi_ep_num_in', type=int, default=0, + help='endpoint number of MIDI IN') parser.add_argument('--output_c_file', type=argparse.FileType('w'), required=True) parser.add_argument('--output_h_file', type=argparse.FileType('w'), required=True) @@ -47,10 +63,6 @@ unknown_hid_devices = list(frozenset(args.hid_devices) - ALL_HID_DEVICES_SET) if unknown_hid_devices: raise ValueError("Unknown HID devices(s)", unknown_hid_devices) -if args.msc_num_endpoint_pairs not in (1, 2): - raise ValueError("--msc_num_endpoint_pairs must be 1 or 2") - - class StringIndex: """Assign a monotonically increasing index to each unique string. Start with 0.""" string_to_index = {} @@ -120,7 +132,7 @@ cdc_comm_interface = standard.InterfaceDescriptor( cdc_union, standard.EndpointDescriptor( description="CDC comm in", - bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN, + bEndpointAddress=args.cdc_ep_num_notification | standard.EndpointDescriptor.DIRECTION_IN, bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT, wMaxPacketSize=0x0040, bInterval=0x10) @@ -133,11 +145,11 @@ cdc_data_interface = standard.InterfaceDescriptor( subdescriptors=[ standard.EndpointDescriptor( description="CDC data out", - bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_OUT, + bEndpointAddress=args.cdc_ep_num_data_out | standard.EndpointDescriptor.DIRECTION_OUT, bmAttributes=standard.EndpointDescriptor.TYPE_BULK), standard.EndpointDescriptor( description="CDC data in", - bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN, + bEndpointAddress=args.cdc_ep_num_data_in | standard.EndpointDescriptor.DIRECTION_IN, bmAttributes=standard.EndpointDescriptor.TYPE_BULK), ]) @@ -153,14 +165,12 @@ msc_interfaces = [ subdescriptors=[ standard.EndpointDescriptor( description="MSC in", - bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN, + bEndpointAddress=args.msc_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN, bmAttributes=standard.EndpointDescriptor.TYPE_BULK, bInterval=0), standard.EndpointDescriptor( description="MSC out", - # SAMD21 needs to use a separate pair of endpoints for MSC. - bEndpointAddress=((0x1 if args.msc_num_endpoint_pairs == 2 else 0x0) | - standard.EndpointDescriptor.DIRECTION_OUT), + bEndpointAddress=(args.msc_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT), bmAttributes=standard.EndpointDescriptor.TYPE_BULK, bInterval=0) ] @@ -197,7 +207,7 @@ else: # and will fail (possibly silently) if both are not supplied. hid_endpoint_in_descriptor = standard.EndpointDescriptor( description="HID in", - bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN, + bEndpointAddress=args.hid_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN, bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT, bInterval=8) @@ -267,12 +277,12 @@ audio_midi_interface = standard.InterfaceDescriptor( ), standard.EndpointDescriptor( description="MIDI data out to CircuitPython", - bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_OUT, + bEndpointAddress=args.midi_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT, bmAttributes=standard.EndpointDescriptor.TYPE_BULK), midi.DataEndpointDescriptor(baAssocJack=[midi_in_jack_emb]), standard.EndpointDescriptor( description="MIDI data in from CircuitPython", - bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN, + bEndpointAddress=args.midi_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN, bmAttributes=standard.EndpointDescriptor.TYPE_BULK, bInterval = 0x0), midi.DataEndpointDescriptor(baAssocJack=[midi_out_jack_emb]), @@ -313,10 +323,15 @@ if 'HID' in args.devices: if 'AUDIO' in args.devices: interfaces_to_join.append(audio_interfaces) -# util.join_interfaces() will renumber the endpoints to make them unique across descriptors, -# and renumber the interfaces in order. But we still need to fix up certain -# interface cross-references. -interfaces = util.join_interfaces(*interfaces_to_join) +if args.relative_ep_num: + # util.join_interfaces() will renumber the endpoints to make them unique across descriptors, + # and renumber the interfaces in order. But we still need to fix up certain + # interface cross-references. + interfaces = util.join_interfaces(*interfaces_to_join) +else: + # util.renumbers_interfaces() will renumber the interfaces in order. But we still need to + # fix up certain interface cross-references. + interfaces = util.renumbers_interfaces(*interfaces_to_join) # Now adjust the CDC interface cross-references. -- cgit v1.2.3 From 1205d3e3052bf057e4bae0d1da046bfcfbb2c21b Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Fri, 4 Oct 2019 11:00:00 +0200 Subject: Add validation --- supervisor/supervisor.mk | 6 +++--- tools/gen_usb_descriptor.py | 33 +++++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 13 deletions(-) (limited to 'supervisor') diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 072066630..2a9cb30e1 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -94,8 +94,8 @@ ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" endif -ifndef USB_RELATIVE_EP_NUM -USB_RELATIVE_EP_NUM = 1 +ifndef USB_RENUMBER_ENDPOINTS +USB_RENUMBER_ENDPOINTS = 1 endif ifndef USB_CDC_EP_NUM_NOTIFICATION @@ -149,7 +149,7 @@ autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile --serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\ --devices $(USB_DEVICES)\ --hid_devices $(USB_HID_DEVICES)\ - --relative_ep_num $(USB_RELATIVE_EP_NUM)\ + --renumber_endpoints $(USB_RENUMBER_ENDPOINTS)\ --cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\ --cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\ --cdc_ep_num_data_in $(USB_CDC_EP_NUM_DATA_IN)\ diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index eccfbea67..ab6beca42 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -32,7 +32,7 @@ parser.add_argument('--devices', type=lambda l: tuple(l.split(',')), default=DEF help='devices to include in descriptor (AUDIO includes MIDI support)') parser.add_argument('--hid_devices', type=lambda l: tuple(l.split(',')), default=DEFAULT_HID_DEVICES, help='HID devices to include in HID report descriptor') -parser.add_argument('--relative_ep_num', type=int, default=1, +parser.add_argument('--renumber_endpoints', type=int, default=1, help='use relative(1) or absolute(0) endpoint number') parser.add_argument('--cdc_ep_num_notification', type=int, default=0, help='endpoint number of CDC NOTIFICATION') @@ -63,6 +63,24 @@ unknown_hid_devices = list(frozenset(args.hid_devices) - ALL_HID_DEVICES_SET) if unknown_hid_devices: raise ValueError("Unknown HID devices(s)", unknown_hid_devices) +if not args.renumber_endpoints: + if 'CDC' in args.devices: + if (args.cdc_ep_num_notification == 0 or args.cdc_ep_num_data_out == 0 or + args.cdc_ep_num_data_in == 0): + raise ValueError("Endpoint address must not be 0") + + if 'MSC' in args.devices: + if args.msc_ep_num_out == 0 or args.msc_ep_num_in == 0: + raise ValueError("Endpoint address must not be 0") + + if 'HID' in args.devices: + if args.hid_ep_num_in == 0: + raise ValueError("Endpoint address must not be 0") + + if 'AUDIO' in args.devices: + if args.midi_ep_num_out == 0 or args.midi_ep_num_in == 0: + raise ValueError("Endpoint address must not be 0") + class StringIndex: """Assign a monotonically increasing index to each unique string. Start with 0.""" string_to_index = {} @@ -323,15 +341,10 @@ if 'HID' in args.devices: if 'AUDIO' in args.devices: interfaces_to_join.append(audio_interfaces) -if args.relative_ep_num: - # util.join_interfaces() will renumber the endpoints to make them unique across descriptors, - # and renumber the interfaces in order. But we still need to fix up certain - # interface cross-references. - interfaces = util.join_interfaces(*interfaces_to_join) -else: - # util.renumbers_interfaces() will renumber the interfaces in order. But we still need to - # fix up certain interface cross-references. - interfaces = util.renumbers_interfaces(*interfaces_to_join) +# util.join_interfaces() will renumber the endpoints to make them unique across descriptors, +# and renumber the interfaces in order. But we still need to fix up certain +# interface cross-references. +interfaces = util.join_interfaces(interfaces_to_join, renumber_endpoints=args.renumber_endpoints) # Now adjust the CDC interface cross-references. -- cgit v1.2.3 From badf32e88d149eb286672a3acfd2d9804ffdbe6b Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Mon, 7 Oct 2019 13:40:44 +0200 Subject: Add HID OUT --- supervisor/supervisor.mk | 5 +++++ tools/gen_usb_descriptor.py | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'supervisor') diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 2a9cb30e1..7aac85958 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -118,6 +118,10 @@ ifndef USB_MSC_EP_NUM_IN USB_MSC_EP_NUM_IN = 0 endif +ifndef USB_HID_EP_NUM_OUT +USB_HID_EP_NUM_OUT = 0 +endif + ifndef USB_HID_EP_NUM_IN USB_HID_EP_NUM_IN = 0 endif @@ -155,6 +159,7 @@ autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile --cdc_ep_num_data_in $(USB_CDC_EP_NUM_DATA_IN)\ --msc_ep_num_out $(USB_MSC_EP_NUM_OUT)\ --msc_ep_num_in $(USB_MSC_EP_NUM_IN)\ + --hid_ep_num_out $(USB_HID_EP_NUM_OUT)\ --hid_ep_num_in $(USB_HID_EP_NUM_IN)\ --midi_ep_num_out $(USB_MIDI_EP_NUM_OUT)\ --midi_ep_num_in $(USB_MIDI_EP_NUM_IN)\ diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index ab6beca42..916e3ec47 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -44,6 +44,8 @@ parser.add_argument('--msc_ep_num_out', type=int, default=0, help='endpoint number of MSC OUT') parser.add_argument('--msc_ep_num_in', type=int, default=0, help='endpoint number of MSC IN') +parser.add_argument('--hid_ep_num_out', type=int, default=0, + help='endpoint number of HID OUT') parser.add_argument('--hid_ep_num_in', type=int, default=0, help='endpoint number of HID IN') parser.add_argument('--midi_ep_num_out', type=int, default=0, @@ -74,7 +76,7 @@ if not args.renumber_endpoints: raise ValueError("Endpoint address must not be 0") if 'HID' in args.devices: - if args.hid_ep_num_in == 0: + if args.args.hid_ep_num_out == 0 or args.hid_ep_num_in == 0: raise ValueError("Endpoint address must not be 0") if 'AUDIO' in args.devices: @@ -231,7 +233,7 @@ hid_endpoint_in_descriptor = standard.EndpointDescriptor( hid_endpoint_out_descriptor = standard.EndpointDescriptor( description="HID out", - bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_OUT, + bEndpointAddress=args.hid_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT, bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT, bInterval=8) -- cgit v1.2.3 From 29844db332f3498166c938f25d9129c827ebf755 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Tue, 8 Oct 2019 09:26:02 +0200 Subject: Use boolean type for renumber_endpoints --- supervisor/supervisor.mk | 49 +++++++++++++++++++++++---------------------- tools/gen_usb_descriptor.py | 4 ++-- 2 files changed, 27 insertions(+), 26 deletions(-) (limited to 'supervisor') diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 7aac85958..e1d5f5951 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -94,10 +94,6 @@ ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" endif -ifndef USB_RENUMBER_ENDPOINTS -USB_RENUMBER_ENDPOINTS = 1 -endif - ifndef USB_CDC_EP_NUM_NOTIFICATION USB_CDC_EP_NUM_NOTIFICATION = 0 endif @@ -134,6 +130,30 @@ ifndef USB_MIDI_EP_NUM_IN USB_MIDI_EP_NUM_IN = 0 endif +USB_DESCRIPTOR_ARGS = \ + --manufacturer $(USB_MANUFACTURER)\ + --product $(USB_PRODUCT)\ + --vid $(USB_VID)\ + --pid $(USB_PID)\ + --serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\ + --devices $(USB_DEVICES)\ + --hid_devices $(USB_HID_DEVICES)\ + --cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\ + --cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\ + --cdc_ep_num_data_in $(USB_CDC_EP_NUM_DATA_IN)\ + --msc_ep_num_out $(USB_MSC_EP_NUM_OUT)\ + --msc_ep_num_in $(USB_MSC_EP_NUM_IN)\ + --hid_ep_num_out $(USB_HID_EP_NUM_OUT)\ + --hid_ep_num_in $(USB_HID_EP_NUM_IN)\ + --midi_ep_num_out $(USB_MIDI_EP_NUM_OUT)\ + --midi_ep_num_in $(USB_MIDI_EP_NUM_IN)\ + --output_c_file $(BUILD)/autogen_usb_descriptor.c\ + --output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h + +ifeq ($(USB_RENUMBER_ENDPOINTS), 0) +USB_DESCRIPTOR_ARGS += --no-renumber_endpoints +endif + SUPERVISOR_O = $(addprefix $(BUILD)/, $(SRC_SUPERVISOR:.c=.o)) $(BUILD)/autogen_display_resources.o $(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h @@ -145,26 +165,7 @@ $(BUILD)/autogen_usb_descriptor.c $(BUILD)/genhdr/autogen_usb_descriptor.h: auto autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile | $(HEADER_BUILD) $(STEPECHO) "GEN $@" $(Q)install -d $(BUILD)/genhdr - $(Q)$(PYTHON3) ../../tools/gen_usb_descriptor.py \ - --manufacturer $(USB_MANUFACTURER)\ - --product $(USB_PRODUCT)\ - --vid $(USB_VID)\ - --pid $(USB_PID)\ - --serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\ - --devices $(USB_DEVICES)\ - --hid_devices $(USB_HID_DEVICES)\ - --renumber_endpoints $(USB_RENUMBER_ENDPOINTS)\ - --cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\ - --cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\ - --cdc_ep_num_data_in $(USB_CDC_EP_NUM_DATA_IN)\ - --msc_ep_num_out $(USB_MSC_EP_NUM_OUT)\ - --msc_ep_num_in $(USB_MSC_EP_NUM_IN)\ - --hid_ep_num_out $(USB_HID_EP_NUM_OUT)\ - --hid_ep_num_in $(USB_HID_EP_NUM_IN)\ - --midi_ep_num_out $(USB_MIDI_EP_NUM_OUT)\ - --midi_ep_num_in $(USB_MIDI_EP_NUM_IN)\ - --output_c_file $(BUILD)/autogen_usb_descriptor.c\ - --output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h + $(Q)$(PYTHON3) ../../tools/gen_usb_descriptor.py $(USB_DESCRIPTOR_ARGS) CIRCUITPY_DISPLAY_FONT ?= "../../tools/fonts/ter-u12n.bdf" diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index 916e3ec47..74f6584f8 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -32,8 +32,8 @@ parser.add_argument('--devices', type=lambda l: tuple(l.split(',')), default=DEF help='devices to include in descriptor (AUDIO includes MIDI support)') parser.add_argument('--hid_devices', type=lambda l: tuple(l.split(',')), default=DEFAULT_HID_DEVICES, help='HID devices to include in HID report descriptor') -parser.add_argument('--renumber_endpoints', type=int, default=1, - help='use relative(1) or absolute(0) endpoint number') +parser.add_argument('--no-renumber_endpoints', dest='renumber_endpoints', action='store_false', + help='use to not renumber endpoint') parser.add_argument('--cdc_ep_num_notification', type=int, default=0, help='endpoint number of CDC NOTIFICATION') parser.add_argument('--cdc_ep_num_data_out', type=int, default=0, -- cgit v1.2.3 From f1ab9aaa9cb9cb506619757296f4b595da662a97 Mon Sep 17 00:00:00 2001 From: Cedar Grove Maker Studios Date: Mon, 14 Oct 2019 11:58:14 -0700 Subject: add def for AT25SF161-SSHD-T 2MiB SPI flash chip --- supervisor/shared/external_flash/devices.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'supervisor') diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h index 4de22719a..21d53b5fd 100644 --- a/supervisor/shared/external_flash/devices.h +++ b/supervisor/shared/external_flash/devices.h @@ -85,6 +85,26 @@ typedef struct { .single_status_byte = false, \ } +// Settings for the Adesto Tech AT25SF161-SSHD-T 2MiB SPI flash +// for the StringCar M0 (SAMD21) Express board. +// Source: https://www.digikey.com/product-detail/en/adesto-technologies/AT25SF161-SDHD-T/1265-1230-1-ND/ +// Datasheet: https://www.adestotech.com/wpo-content/uploads/jDS-AT25SF161_046.pdf +#define AT25SF161 {\ + .total_size = (1 << 21), /* 2 MiB */ \ + .start_up_time_us = 10000, \ + .manufacturer_id = 0x1f, \ + .memory_type = 0x86, \ + .capacity = 0x01, \ + .max_clock_speed_mhz = 85, \ + .quad_enable_bit_mask = 0x00, \ + .has_sector_protection = true, \ + .supports_fast_read = true, \ + .supports_qspi = false, \ + .supports_qspi_writes = false, \ + .write_status_register_split = false, \ + .single_status_byte = false, \ +} + // Settings for the Gigadevice GD25Q16C 2MiB SPI flash. // Datasheet: http://www.gigadevice.com/datasheet/gd25q16c/ #define GD25Q16C {\ @@ -442,5 +462,4 @@ typedef struct { .write_status_register_split = false, \ .single_status_byte = false, \ } - #endif // MICROPY_INCLUDED_ATMEL_SAMD_EXTERNAL_FLASH_DEVICES_H -- cgit v1.2.3 From e0f60d0c173f889199e431de3838cd1d93376500 Mon Sep 17 00:00:00 2001 From: arturo182 Date: Mon, 14 Oct 2019 23:42:53 +0200 Subject: Add IS25LP128F flash device definition --- supervisor/shared/external_flash/devices.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'supervisor') diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h index 4de22719a..2e9dfabf5 100644 --- a/supervisor/shared/external_flash/devices.h +++ b/supervisor/shared/external_flash/devices.h @@ -443,4 +443,22 @@ typedef struct { .single_status_byte = false, \ } +// Settings for the ISSI IS25LP128F 16MiB SPI flash. +// Datasheet: http://www.issi.com/WW/pdf/25LP-WP128F.pdf +#define IS25LP128F {\ + .total_size = (1 << 24), /* 16 MiB */ \ + .start_up_time_us = 10000, \ + .manufacturer_id = 0x9d, \ + .memory_type = 0x60, \ + .capacity = 0x18, \ + .max_clock_speed_mhz = 133, \ + .quad_enable_bit_mask = 0x02, \ + .has_sector_protection = true, \ + .supports_fast_read = true, \ + .supports_qspi = true, \ + .supports_qspi_writes = true, \ + .write_status_register_split = false, \ + .single_status_byte = true, \ +} + #endif // MICROPY_INCLUDED_ATMEL_SAMD_EXTERNAL_FLASH_DEVICES_H -- cgit v1.2.3