Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

EndpointResolver Class Reference

EndpointResolver Class Reference
[EndpointResolver class]

Utility class for resolving endpoints. More...

#include <EndpointResolver.h>

Public Member Functions

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

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

Definition at line 41 of file EndpointResolver.cpp.

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

Definition at line 62 of file EndpointResolver.cpp.

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

Definition at line 67 of file EndpointResolver.cpp.

usb_ep_t next_free_endpoint ( bool  in_not_out,
usb_ep_type_t  type,
uint32_t  size 
)

Get next free endpoint.

Definition at line 47 of file EndpointResolver.cpp.

void reset ( void   )

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

Definition at line 77 of file EndpointResolver.cpp.

bool valid (  )

Check if the endpoint configuration created so far is valid.

Returns:
true if all endpoint sizes are available and fit, false otherwise

Definition at line 72 of file EndpointResolver.cpp.