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

tinyusb: USB function enable rework #2834

Merged
merged 1 commit into from May 11, 2022

Conversation

kasjer
Copy link
Contributor

@kasjer kasjer commented May 10, 2022

USB function in TinyUSB stack is enabled by one of the following
definitions: CFG_TUD_CDC, CFG_TUD_HID, CFG_TUD_MSC, CFG_TUD_MIDI,
CFG_TUD_MSC, CFG_TUD_VENDOR, CFG_TUD_USBTMC, CFG_TUD_DFU_RT, CFG_TUD_DFU,
USBD_BTH need to be set to non-zero value.

So far some of those could be set in syscfg (definition were provided
in std_descriptors package). Following syscfg values were there:
USBD_HID, USBD_CDC, USBD_MSC, USBD_DFU, UDBD_BTH.

In order to enable standard functionality two things had to be set.
For example to have USB console one had to include hw/usb/tinyusb/cdc_console
(this could be done by settings CONSOLE_USB: 1) and separate settings in
target or application was needed USBD_CDC: 1.
For BT one had to set BLE_TRANSPORT_HS: usb and USBD_BTH: 1.

Now that any package can overwrite setting that is defined but no set
it is possible to for package that implements some USB functionality
to enabled it in TinyUSB stack.

This change leaves all previously defined USBD_xxx: values to not defined
and packages can just enabled it when they are included.

There is no need to have USBD_CDC: 1 when CONSOLE_USB: 1 is present.
For BTH separate commit will go to nimble repository.

USB function in TinyUSB stack is enabled by one of the following
definitions: CFG_TUD_CDC, CFG_TUD_HID, CFG_TUD_MSC, CFG_TUD_MIDI,
CFG_TUD_MSC, CFG_TUD_VENDOR, CFG_TUD_USBTMC, CFG_TUD_DFU_RT, CFG_TUD_DFU,
USBD_BTH need to be set to non-zero value.

So far some of those could be set in syscfg (definition were provided
in std_descriptors package). Following syscfg values were there:
USBD_HID, USBD_CDC, USBD_MSC, USBD_DFU, UDBD_BTH.

In order to enable standard functionality two things had to be set.
For example to have USB console one had to include hw/usb/tinyusb/cdc_console
(this could be done by settings CONSOLE_USB: 1) and separate settings in
target or application was needed USBD_CDC: 1.
For BT one had to set BLE_TRANSPORT_HS: usb and USBD_BTH: 1.

Now that any package can overwrite setting that is defined but no set
it is possible to for package that implements some USB functionality
to enabled it in TinyUSB stack.

This change leaves all previously defined USBD_xxx: values to not defined
and packages can just enabled it when they are included.

There is no need to have USBD_CDC: 1 when CONSOLE_USB: 1 is present.
For BTH separate commit will go to nimble repository.
@utzig
Copy link
Member

utzig commented May 10, 2022

Style check summary

No suggestions at this time!

@kasjer kasjer merged commit 00dfba3 into apache:master May 11, 2022
@kasjer kasjer deleted the kasjer/tinyusb-function-enable-rework branch May 11, 2022 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants