Commit graph

9 commits

Author SHA1 Message Date
Marek Pieta 059643062c usb: device_next: Update remote wakeup log level
The `Remote wakeup feature not enabled or not suspended` log is not
related to an actual error (connected host might not enable USB remote
wakeup feature). Use warning log level.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2024-06-04 07:55:22 +02:00
Tomasz Moń 8d344cc9d8 usb: device_next: Rename usbd_contex to usbd_context
Add the missing "t" to struct usbd_contex. No functional changes.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-06-03 06:43:20 -07:00
Johann Fischer eb9b46c118 usb: device_next: lock scheduler in usbd_init()
Lock the scheduler to ensure that the context is not preempted before it
is fully initialized.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Johann Fischer 4c360f38d1 usb: device_next: add controller can detect VBUS state change capability
There are controllers with capability to detect VBUS state change. This
can be used in a generic application to explicitly handle the VBUS
detected event after usbd_init() and for example allow the PMIC to
detect to what type of port device controller is connected.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Tomasz Moń 5144d0f65f usb: device_next: Introduce speed specific configurations
USB High-Speed devices must be able to operate at both High-Speed and
Full-Speed. The USB specification allows the device to have different
configurations depending on connection speed. Modify the API to reflect
USB Specification requirements on what can (e.g. configurations) and
what cannot (e.g. VID, PID) be speed dependent.

While the class configurations for different speeds are completely
independent, the actual class instances are shared between operating
speeds (because only one speed can be active at a time). Classes are
free to provide different number of interfaces and/or endpoints for
different speeds. The endpoints are assigned for all operating speeds
during initialization.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-04-22 06:51:22 -07:00
Johann Fischer 3fed5559e9 usb: device_next: add helpers to get highest supported and actual speed
Save actual device speed in the device context and add helpers to get
highest supported and actual speed.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-04-22 06:51:22 -07:00
Shane Snover e49d174be9 driver: usb: change function parameter name from class to base_class.
Change function parameter name in function usbd_device_set_code_triple
from `class` to `base_class` as `class` is a keyword in C++.

Signed-off-by: Shane Snover <ssnover95@gmail.com>
2024-01-10 11:08:11 +01:00
Johann Fischer 52686a8308 usb: device_next: simplify way to set/change triple code
Usually we want set all values of code triple Base Class, SubClass, and
Protocol at once. Merge existing functions to set code, subcode,
protocol into just one helper to set code triple.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-12-13 17:52:00 +01:00
Johann Fischer cb8b9ad38a usb: add new experimental USB device stack
The device supprt brings support for multiple stack instances,
multiple configuration, asynchronous transfer model, ability to
change most of the properties of a device at runtime and
the composition of configuration and classes at runtime.

The stack requires new UDC driver API and is not compatible
with old driver API (usb_dc_). The classes (functions) of old
(current) USB device stack cannot be used with new ones and must
be ported.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-02 12:55:18 +01:00