1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

Merge pull request #11213 from bergzand/pr/usb/periph_init

usbdev: Add low level initialization to `periph_init()`
This commit is contained in:
Dylan Laduranty 2019-03-25 20:49:25 +01:00 committed by GitHub
commit 784af0a9c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -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
*

View File

@ -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
}