-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drv/usb/stm32_usbd: use pbdrvconfig for USB info
This moves the USB VID/PID and strings into pbdrvconfig.h, so that each hub can set the appropriate values. Additionally, since SPIKE Prime and Robot Inventor use the same firmware, we have to dynamically set the PID at runtime based on the hub variant.
- Loading branch information
Showing
5 changed files
with
76 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) 2023 The Pybricks Authors | ||
|
||
// LEGO USB stuff | ||
// https://github.com/pybricks/technical-info/blob/master/assigned-numbers.md#usb | ||
|
||
|
||
#ifndef _LEGO_USB_H_ | ||
#define _LEGO_USB_H_ | ||
|
||
/** Official LEGO USB Vendor ID. */ | ||
#define LEGO_USB_VID 0x0694 | ||
/** Official LEGO USB Product ID for SPIKE Prime in DFU mode. */ | ||
#define LEGO_USB_PID_SPIKE_PRIME_DFU 0x0008 | ||
/** Official LEGO USB Product ID for SPIKE Prime. */ | ||
#define LEGO_USB_PID_SPIKE_PRIME 0x0009 | ||
/** Official LEGO USB Product ID for SPIKE Essential in DFU mode. */ | ||
#define LEGO_USB_PID_SPIKE_ESSENTIAL_DFU 0x000C | ||
/** Official LEGO USB Product ID for SPIKE Essential. */ | ||
#define LEGO_USB_PID_SPIKE_ESSENTIAL 0x000D | ||
/** Official LEGO USB Product ID for MINDSTORMS Robot Inventor in DFU mode. */ | ||
#define LEGO_USB_PID_ROBOT_INVENTOR_DFU 0x0010 | ||
/** Official LEGO USB Product ID for MINDSTORMS Robot Inventor. */ | ||
#define LEGO_USB_PID_ROBOT_INVENTOR 0x0011 | ||
|
||
/** Official LEGO USB Manufacturer String. */ | ||
#define LEGO_USB_MFG_STR "LEGO System A/S" | ||
/** Official LEGO USB Product String for SPIKE Prime and MINDSTORMS Robot Inventor. */ | ||
#define LEGO_USB_PROD_STR_TECHNIC_LARGE_HUB "LEGO Technic Large Hub" | ||
/** Official LEGO USB Product String for SPIKE Essential. */ | ||
#define LEGO_USB_PROD_STR_TECHNIC_SMALL_HUB "LEGO Technic Small Hub" | ||
|
||
#endif // _LEGO_USB_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters