Commit 7c708604 authored by Johann Fischer's avatar Johann Fischer Committed by Carles Cufi
Browse files

include: driver: usb: add check for endpoint capabilities



Add API function to check capabilities of an endpoint.
It should be used to check the capabilities of an endpoint
before configuration. The driver should return 0 if the
endpoint configuration is possible.

Signed-off-by: default avatarJohann Fischer <j.fischer@phytec.de>
parent 6807f3a8
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -141,6 +141,21 @@ int usb_dc_set_address(const u8_t addr);
 */
int usb_dc_set_status_callback(const usb_dc_status_callback cb);

/**
 * @brief check endpoint capabilities
 *
 * Function to check capabilities of an endpoint. usb_dc_ep_cfg_data structure
 * provides the endpoint configuration parameters: endpoint address,
 * endpoint maximum packet size and endpoint type.
 * The driver should check endpoint capabilities and return 0 if the
 * endpoint configuration is possible.
 *
 * @param[in] cfg Endpoint config
 *
 * @return 0 on success, negative errno code on fail.
 */
int usb_dc_ep_check_cap(const struct usb_dc_ep_cfg_data * const cfg);

/**
 * @brief configure endpoint
 *