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:
commit
784af0a9c8
@ -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
|
||||
*
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user