Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flash bridge descriptor updates #57

Merged
merged 4 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apollo_fpga/gateware/advertiser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is part of LUNA.
# This file is part of Apollo.
#
# Copyright (c) 2023 Great Scott Gadgets <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause
Expand Down Expand Up @@ -64,6 +64,10 @@ class ApolloAdvertiserRequestHandler(USBRequestHandler):

Implements default vendor requests related to ApolloAdvertiser.
"""

""" The bInterfaceProtocol version supported by this request handler. """
PROTOCOL_VERSION = 0x00

REQUEST_APOLLO_ADV_STOP = 0xF0

def __init__(self, if_number, stop_pin):
Expand Down
13 changes: 8 additions & 5 deletions apollo_fpga/gateware/flash_bridge.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is part of LUNA.
# This file is part of Apollo.
#
# Copyright (c) 2023 Great Scott Gadgets <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause
Expand All @@ -18,6 +18,8 @@
from usb_protocol.types import USBRequestType, USBRequestRecipient
from usb_protocol.emitters import DeviceDescriptorCollection

from .advertiser import ApolloAdvertiser, ApolloAdvertiserRequestHandler

VENDOR_ID = 0x1209
PRODUCT_ID = 0x000F

Expand Down Expand Up @@ -255,9 +257,8 @@ def create_descriptors(self, sharing):
d.idVendor = VENDOR_ID
d.idProduct = PRODUCT_ID

d.iManufacturer = "LUNA"
d.iProduct = "Configuration Flash bridge"
d.iSerialNumber = "no serial"
d.iManufacturer = "Apollo Project"
d.iProduct = "Configuration Flash Bridge"

d.bNumConfigurations = 1

Expand All @@ -268,6 +269,7 @@ def create_descriptors(self, sharing):
i.bInterfaceNumber = 0
i.bInterfaceClass = 0xFF
i.bInterfaceSubclass = 0x01
i.bInterfaceProtocol = 0x00

with i.EndpointDescriptor() as e:
e.bEndpointAddress = BULK_ENDPOINT_NUMBER
Expand All @@ -283,6 +285,7 @@ def create_descriptors(self, sharing):
i.bInterfaceNumber = 1
i.bInterfaceClass = 0xFF
i.bInterfaceSubclass = 0x00
i.bInterfaceProtocol = ApolloAdvertiserRequestHandler.PROTOCOL_VERSION

return descriptors

Expand All @@ -298,7 +301,7 @@ def elaborate(self, platform):
m.submodules.usb = usb = USBDevice(bus=ulpi)

# Check how the port is shared with Apollo.
sharing = platform.apollo_port_sharing(phy_name)
sharing = platform.port_sharing(phy_name)

# Add our standard control endpoint to the device.
descriptors = self.create_descriptors(sharing)
Expand Down
Loading