USBD_OS_Init
Description
Initialize USB RTOS layer internal objects.
Files
usbd_internal.h/usbd_os.c
Prototype
void USBD_OS_Init (USBD_ERR *p_err);
Arguments
p_err
Pointer to variable that will receive the return error code from this function.
Returned Value
None.
Callers
USB device core layer.
Implementation guidelines
The followings RTOS resources are required by the stack and should be allocated in when this function is called.
One task for core and asynchronous events.
One queue that can hold up to
USBD_CORE_EVENT_NBR_TOTALevents.USBD_CFG_MAX_NBR_DEVxUSBD_CFG_MAX_NBR_EP_OPENsemaphores and mutex for endpoints operations.If tracing is enabled, a semaphore and a task to manage debug events allocation and debug events processing respectively.
If any error happen,
USBD_ERR_OS_INIT_FAILshould be assigned top_errand the function should return immediately. Otherwise,USBD_ERR_NONEshould be assigned top_err.