From 795fe21860fb0627b6b7216f62e75d0048465762 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Wed, 5 Jun 2019 21:48:28 +0000 Subject: [PATCH] usbd: document that only 8 eps are allowed. The internal stack has a hard internal limit of 8, which is as many as all supported devices support, but not as flexible as the arbitrary addressing that USB actually allows. At _least_ document this. Fixes: https://github.com/libopencm3/libopencm3/issues/666 --- include/libopencm3/usb/usbd.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/libopencm3/usb/usbd.h b/include/libopencm3/usb/usbd.h index b0ba701d..3272f26d 100644 --- a/include/libopencm3/usb/usbd.h +++ b/include/libopencm3/usb/usbd.h @@ -172,6 +172,9 @@ extern void usbd_disconnect(usbd_device *usbd_dev, bool disconnected); /** Setup an endpoint * @param addr Full EP address including direction (e.g. 0x01 or 0x81) * @param type Value for bmAttributes (USB_ENDPOINT_ATTR_*) + * @note The stack only supports 8 endpoints, 0..7, so don't try + * and use arbitrary addresses here, even though USB itself would allow this. + * Not all backends support arbitrary addressing anyway. */ extern void usbd_ep_setup(usbd_device *usbd_dev, uint8_t addr, uint8_t type, uint16_t max_size, usbd_endpoint_callback callback);