|
co_usb
|
USB endpoint templated on its direction. More...
#include <endpoint.hpp>
Public Member Functions | |
| uint8_t | addr () const noexcept |
| auto * | dev () const noexcept |
| template<ep_direction ToDirection> requires (Direction == ep_direction::both) | |
| std::optional< endpoint< ToDirection > > | as () const noexcept |
| Safe cast from an endpoint with an unknown direction to an endpoint with a concrete direction. | |
Static Public Member Functions | |
| static endpoint< Direction > | make_safe (uint8_t ep, const interface &iface) noexcept |
| Makes an endpoint and completes address to proper value. | |
| static endpoint< Direction > | make_unsafe (uint8_t ep, libusb_device_handle *devh) noexcept |
| static endpoint< Direction > | make_throwing (uint8_t ep, libusb_device_handle *devh) |
| Creates an endpoint or throws if the address doesn't match expected direction. | |
Friends | |
| template<ep_direction ToDirection> | |
| endpoint< ToDirection > | endpoint_cast (endpoint< ep_direction::both > ep) noexcept |
USB endpoint templated on its direction.
Must be used with transfer types to provide directional information. Prefer make_safe function to construct a valid endpoint
| Direction | direction of an endpoint. Value co_usb::ep_direction::both is semantically equal to an unknown endpoint direction and as such only allows casts to either in or out endpoint. |
|
inlinenoexcept |
|
inlinenoexcept |
Safe cast from an endpoint with an unknown direction to an endpoint with a concrete direction.
|
inlinenoexcept |
|
inlinestaticnoexcept |
Makes an endpoint and completes address to proper value.
Example:
|
inlinestatic |
Creates an endpoint or throws if the address doesn't match expected direction.
ref std::invalid_argument when endpoint address does not match @tp Direction
|
inlinestaticnoexcept |
|
friend |