From b0249b60cc34dfb838af64cd3e509d14ab0c2e84 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Thu, 5 Dec 2024 11:22:15 +0100 Subject: [PATCH] generic_device: Add custom_ep parameter --- lambdalib/cores/usb/generic_device.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lambdalib/cores/usb/generic_device.py b/lambdalib/cores/usb/generic_device.py index 2544c93..97dafba 100644 --- a/lambdalib/cores/usb/generic_device.py +++ b/lambdalib/cores/usb/generic_device.py @@ -37,6 +37,7 @@ def __init__(self, pins, # or pass a list() of interfaces force_contiguous_blockram=False, bufferize_ep_in=True, + custom_ep=[], **kwargs): self.pins = pins @@ -84,6 +85,7 @@ def __init__(self, pins, self.tx_activity = Signal(self.ep_pairs) self.rx_activity = Signal(self.ep_pairs) + self.custom_ep = custom_ep def create_descriptors(self): """ Create the descriptors we want to use for our device. """ @@ -211,6 +213,9 @@ def elaborate(self, platform): usb.add_endpoint(stream_in_ep) m.d.comb += self.sinks[k].connect(stream_in_ep.sink) + for ep in self.custom_ep: + usb.add_endpoint(ep) + m.d.comb += usb.connect.eq(1) # Activity & Status