USBD_HID_RdAsync

Description

Receives data from the host asynchronously through an interrupt OUT endpoint.

Files

usbd_hid.h/usbd_hid.c

Prototype

void  USBD_HID_RdAsync (CPU_INT08U            class_nbr,
                        void                 *p_buf,
                        CPU_INT32U            buf_len,
                        USBD_HID_ASYNC_FNCT   async_fnct,
                        void                 *p_async_arg,
                        USBD_ERR             *p_err);


Arguments

class_nbr

Class instance number.

p_buf

Pointer to receive buffer.

buf_len

Receive buffer length, in octets.

async_fnct

Receive callback.

p_async_arg

Additional argument provided by application for receive callback.

p_err

Pointer to variable that will receive the return error code from this function.

USBD_ERR_NONE                   
USBD_ERR_NULL_PTR               
USBD_ERR_INVALID_ARG            
USBD_ERR_INVALID_CLASS_STATE    
USBD_ERR_FAIL                   
USBD_ERR_DEV_INVALID_NBR        
USBD_ERR_EP_INVALID_NBR         
USBD_ERR_DEV_INVALID_STATE      
USBD_ERR_EP_INVALID_TYPE        
USBD_ERR_EP_INVALID_STATE       

Returned Value

None.

Callers

Application.

Notes / Warnings

This function is non-blocking and returns immediately after transfer preparation. Upon transfer completion, the callback provided is called to notify the application.