diff --git a/drivers/include/periph/usbdev.h b/drivers/include/periph/usbdev.h index d5bcd69ad4..115a613d6f 100644 --- a/drivers/include/periph/usbdev.h +++ b/drivers/include/periph/usbdev.h @@ -355,6 +355,22 @@ typedef struct usbdev_driver { int (*ready)(usbdev_ep_t *ep, size_t len); } usbdev_driver_t; +/** + * @brief Low level USB peripheral driver initialization + * + * This function prepares all usbdev peripherals available for initialization + */ +void usbdev_init_lowlevel(void); + +/** + * @brief Retrieve usbdev context from the peripheral + * + * @param num usbdev peripheral number to retrieve + * + * @returns the usbdev context at index @p num + */ +usbdev_t *usbdev_get_ctx(unsigned num); + /** * @brief Initialize the USB peripheral device * diff --git a/drivers/periph_common/init.c b/drivers/periph_common/init.c index a235eb7b65..4025f06310 100644 --- a/drivers/periph_common/init.c +++ b/drivers/periph_common/init.c @@ -35,6 +35,9 @@ #ifdef MODULE_PERIPH_HWRNG #include "periph/hwrng.h" #endif +#ifdef MODULE_PERIPH_USBDEV +#include "periph/usbdev.h" +#endif void periph_init(void) { @@ -65,4 +68,8 @@ void periph_init(void) #ifdef MODULE_PERIPH_HWRNG hwrng_init(); #endif + +#ifdef MODULE_PERIPH_USBDEV + usbdev_init_lowlevel(); +#endif }