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_TOTAL
events. USBD_CFG_MAX_NBR_DEV
xUSBD_CFG_MAX_NBR_EP_OPEN
semaphores 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_FAIL
should be assigned top_err
and the function should return immediately. Otherwise,USBD_ERR_NONE
should be assigned top_err
.