Skip to content

Commit

Permalink
generic_device: Add custom_ep parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanthom committed Dec 5, 2024
1 parent 69430ef commit b0249b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lambdalib/cores/usb/generic_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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. """
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b0249b6

Please sign in to comment.