Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions
EndpointResolver Class Reference

Utility class for resolving endpoints. More...

#include <EndpointResolver.h>

Public Member Functions

void endpoint_ctrl (uint32_t size)
 Add control endpoint size. More...
 
usb_ep_t endpoint_in (usb_ep_type_t type, uint32_t size)
 Return a free IN endpoint of the given size. More...
 
usb_ep_t endpoint_out (usb_ep_type_t type, uint32_t size)
 Return a free OUT endpoint of the given size. More...
 
usb_ep_t next_free_endpoint (bool in_not_out, usb_ep_type_t type, uint32_t size)
 Get next free endpoint. More...
 
bool valid ()
 Check if the endpoint configuration created so far is valid. More...
 
void reset ()
 Reset this class's state to when it was constructed. More...
 

Detailed Description

Utility class for resolving endpoints.

This class is intended to make the process of selecting the correct endpoint from a device endpoint table easier. It also provides a verification function to check if the device has enough resources for the given configuration.

Definition at line 39 of file EndpointResolver.h.

Member Function Documentation

void endpoint_ctrl ( uint32_t  size)

Add control endpoint size.

Parameters
sizeSpace reserved for control in and control out
usb_ep_t endpoint_in ( usb_ep_type_t  type,
uint32_t  size 
)

Return a free IN endpoint of the given size.

Parameters
typeDesired endpoint type
sizeSpace to reserve for this endpoint
Returns
Endpoint index or 0 if there are not enough resources
usb_ep_t endpoint_out ( usb_ep_type_t  type,
uint32_t  size 
)

Return a free OUT endpoint of the given size.

Parameters
typeDesired endpoint type
sizeSpace to reserve for this endpoint
Returns
Endpoint index or 0 if there are not enough resources
usb_ep_t next_free_endpoint ( bool  in_not_out,
usb_ep_type_t  type,
uint32_t  size 
)

Get next free endpoint.

void reset ( )

Reset this class's state to when it was constructed.

bool valid ( )

Check if the endpoint configuration created so far is valid.

Returns
true if all endpoint sizes are available and fit, false otherwise
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.