$dir_pw_third_party/tinyusb/ module contains the build files needed to
integrate TinyUSB into a Pigweed build.
GN Build Support¶
This module provides support to compile TinyUSB with GN, however it doesn’t include the source code of the tinyusb project.
In order to use this you are expected to configure the following variables from
Set the GN
pw_third_party_tinyusb_SOURCEto the path of the TinyUSB source code directory. This is the directory that contains the
pw_source_setwhich provides the TinyUSB
tusb_config.hconfig header. While it is possible to provide public definitions in this
pw_source_setthe configuration header file is still required by TinyUSB.
pw_source_setwhich provides the TinyUSB port sources for the specific MCU. Several MCUs are supported by the upstream TinyUSB project, check the
src/portable/path for your MCU.
After this is done multiple
pw_source_set entries for the different parts of
TinyUSB library are created at
Adding TinyUSB dependency¶
TinyUSB library is split into a device side and host side, with a few common sources between the two. It is possible to depend on both at compile time, but initialize only one side. Device and host both provide classes on top such as Communications Device Class (CDC) or Mass Storage Class (MSC) which can be selectively included in the build by depending on the respective GN targets.