USB Component  Version 5.1
MDK-Professional Middleware for USB Device and Host
 All Data Structures Functions Variables Enumerations Enumerator Groups Pages
Library Functions (Internal)

Internal USB functions not to be used in an user application. More...

Functions

void USBH_HID_DataReceived (int8_t instance, uint16_t len)
 Callback function called when data is received from the Human Interface Device.
 
usbStatus USBH_GetStatus (uint8_t ctrl, uint8_t recipient, uint8_t index, uint8_t *ptr_stat_dat)
 Standard Device Request - GET_STATUS.
 
usbStatus USBH_ClearFeature (uint8_t ctrl, uint8_t recipient, uint8_t index, uint8_t feature_selector)
 Standard Device Request - CLEAR_FEATURE.
 
usbStatus USBH_SetFeature (uint8_t ctrl, uint8_t recipient, uint8_t index, uint8_t feature_selector)
 Standard Device Request - SET_FEATURE.
 
usbStatus USBH_SetAddress (uint8_t ctrl, uint8_t device_address)
 Standard Device Request - SET_ADDRESS.
 
usbStatus USBH_GetDescriptor (uint8_t ctrl, uint8_t recipient, uint8_t descriptor_type, uint8_t descriptor_index, uint8_t language_id, uint8_t *descriptor_data, uint16_t descriptor_length)
 Standard Device Request - GET_DESCRIPTOR.
 
usbStatus USBH_SetDescriptor (uint8_t ctrl, uint8_t recipient, uint8_t descriptor_type, uint8_t descriptor_index, uint8_t language_id, uint8_t *descriptor_data, uint16_t descriptor_length)
 Standard Device Request - SET_DESCRIPTOR.
 
usbStatus USBH_GetConfiguration (uint8_t ctrl, uint8_t *ptr_configuration)
 Standard Device Request - GET_CONFIGURATION.
 
usbStatus USBH_SetConfiguration (uint8_t ctrl, uint8_t configuration)
 Standard Device Request - SET_CONFIGURATION.
 
usbStatus USBH_GetInterface (uint8_t ctrl, uint8_t index, uint8_t *ptr_alternate)
 Standard Device Request - GET_INTERFACE.
 
usbStatus USBH_SetInterface (uint8_t ctrl, uint8_t index, uint8_t alternate)
 Standard Device Request - SET_INTERFACE.
 
usbStatus USBH_SyncFrame (uint8_t ctrl, uint8_t index, uint8_t *ptr_frame_number)
 Standard Device Request - SYNC_FRAME.
 
usbStatus USBH_MemoryAllocate (uint8_t ctrl, uint8_t **ptr, uint32_t size)
 Allocate a chunk of memory from the initialized pool to be used by USB Host controller.
 
usbStatus USBH_MemoryFree (uint8_t ctrl, uint8_t *ptr)
 Release a piece of memory back to memory pool used by USB Host controller.
 

Description

Internal USB functions not to be used in an user application.

The following functions are for internal use only. They should not be called from within an user application. They are part of the USB Component library and are defined in rl_usbh.h.

Function Documentation

usbStatus USBH_ClearFeature ( uint8_t  ctrl,
uint8_t  recipient,
uint8_t  index,
uint8_t  feature_selector 
)

Standard Device Request - CLEAR_FEATURE.

Parameters
[in]ctrlindex of USB Host controller.
[in]recipientrecipient.
[in]indexinterface or endpoint index.
[in]feature_selectorfeature selector.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The function USBH_ClearFeature implements the standard device request CLEAR_FEATURE. This request is used to clear or disable a specific feature.

Note
This internal function should not be called by the user.
usbStatus USBH_GetConfiguration ( uint8_t  ctrl,
uint8_t *  ptr_configuration 
)

Standard Device Request - GET_CONFIGURATION.

Parameters
[in]ctrlindex of USB Host controller.
[out]ptr_configurationpointer to where configuration will be read.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The function USBH_GetConfiguration implements the standard device request GET_CONFIGURATION. This request returns the current device configuration value.

Note
This internal function should not be called by the user.
usbStatus USBH_GetDescriptor ( uint8_t  ctrl,
uint8_t  recipient,
uint8_t  descriptor_type,
uint8_t  descriptor_index,
uint8_t  language_id,
uint8_t *  descriptor_data,
uint16_t  descriptor_length 
)

Standard Device Request - GET_DESCRIPTOR.

Parameters
[in]ctrlindex of USB Host controller.
[in]recipientrecipient.
[in]descriptor_typedescriptor type.
[in]descriptor_indexdescriptor index.
[in]language_idlanguage ID.
[out]descriptor_datapointer to where descriptor data will be read.
[in]descriptor_lengthdescriptor length.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The function USBH_GetDescriptor implements the standard device request GET_DESCRIPTOR. This request returns the specified descriptor if the descriptor exists.

Note
This internal function should not be called by the user.
usbStatus USBH_GetInterface ( uint8_t  ctrl,
uint8_t  index,
uint8_t *  ptr_alternate 
)

Standard Device Request - GET_INTERFACE.

Parameters
[in]ctrlindex of USB Host controller.
[in]indexinterface index.
[out]ptr_alternatepointer to where alternate setting data will be read.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The function USBH_GetInterface implements the standard device request GET_INTERFACE. This request returns the selected alternate setting for the specified interface.

Note
This internal function should not be called by the user.
usbStatus USBH_GetStatus ( uint8_t  ctrl,
uint8_t  recipient,
uint8_t  index,
uint8_t *  ptr_stat_dat 
)

Standard Device Request - GET_STATUS.

Parameters
[in]ctrlindex of USB Host controller.
[in]recipientrecipient.
[in]indexinterface or endpoint index.
[out]ptr_stat_datpointer to where status data should be received.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The function USBH_GetStatus implements the standard device request GET_STATUS. This request returns the current device configuration value.

Note
This internal function should not be called by the user.
void USBH_HID_DataReceived ( int8_t  instance,
uint16_t  len 
)

Callback function called when data is received from the Human Interface Device.

Parameters
[in]instanceinstance index.
[in]lenlength of received data.
Returns
none.

The USBH_HID_DataReceived function enables programmers to analyse received data coming from an USB HID device. Implementing this function in user code overrides the library function that handles boot protocol device data reception. This is useful if the default HID functionality needs to be changed to support special HID devices.

Note
This internal function should not be called by the user.
usbStatus USBH_MemoryAllocate ( uint8_t  ctrl,
uint8_t **  ptr,
uint32_t  size 
)

Allocate a chunk of memory from the initialized pool to be used by USB Host controller.

Parameters
[in]ctrlindex of USB Host controller.
[out]ptrpointer to pointer to allocated memory chunk.
[in]sizesize of memory chunk to be allocated.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The USBH_MemoryAllocate function allocates a block of memory from previously initialized memory pool.

Note
This internal function should not be called by the user.
usbStatus USBH_MemoryFree ( uint8_t  ctrl,
uint8_t *  ptr 
)

Release a piece of memory back to memory pool used by USB Host controller.

Parameters
[in]ctrlindex of USB Host controller.
[in]ptrpointer to allocated memory chunk to be released.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The USBH_MemoryFree function frees a block of memory that was previously allocated from the memory pool. The argument ctrl is the index of the controller (memory pool). The argument ptr is the pointer to the start of the memory block to be freed.

Note
This internal function should not be called by the user.
usbStatus USBH_SetAddress ( uint8_t  ctrl,
uint8_t  device_address 
)

Standard Device Request - SET_ADDRESS.

Parameters
[in]ctrlindex of USB Host controller.
[in]device_addressdevice address.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The function USBH_SetAddress implements the standard device request SET_ADDRESS. This request sets the device address for all future device accesses.

Note
This internal function should not be called by the user.
usbStatus USBH_SetConfiguration ( uint8_t  ctrl,
uint8_t  configuration 
)

Standard Device Request - SET_CONFIGURATION.

Parameters
[in]ctrlindex of USB Host controller.
[in]configurationconfiguration.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The function USBH_SetConfiguration implements the standard device request SET_CONFIGURATION. This request sets the device configuration.

Note
This internal function should not be called by the user.
usbStatus USBH_SetDescriptor ( uint8_t  ctrl,
uint8_t  recipient,
uint8_t  descriptor_type,
uint8_t  descriptor_index,
uint8_t  language_id,
uint8_t *  descriptor_data,
uint16_t  descriptor_length 
)

Standard Device Request - SET_DESCRIPTOR.

Parameters
[in]ctrlindex of USB Host controller.
[in]recipientrecipient.
[in]descriptor_typedescriptor type.
[in]descriptor_indexdescriptor index.
[in]language_idlanguage ID.
[in]descriptor_datapointer to descriptor data to be written.
[in]descriptor_lengthdescriptor length.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The function USBH_SetDescriptor implements the standard device request SET_DESCRIPTOR. This request may be used to update existing or add new descriptors.

Note
This internal function should not be called by the user.
usbStatus USBH_SetFeature ( uint8_t  ctrl,
uint8_t  recipient,
uint8_t  index,
uint8_t  feature_selector 
)

Standard Device Request - SET_FEATURE.

Parameters
[in]ctrlindex of USB Host controller.
[in]recipientrecipient.
[in]indexinterface or endpoint index.
[in]feature_selectorfeature selector.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The function USBH_SetFeature implements the standard device request SET_FEATURE. This request is used to set or enable a specific feature.

Note
This internal function should not be called by the user.
usbStatus USBH_SetInterface ( uint8_t  ctrl,
uint8_t  index,
uint8_t  alternate 
)

Standard Device Request - SET_INTERFACE.

Parameters
[in]ctrlindex of USB Host controller.
[in]indexinterface index.
[in]alternatealternate setting.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The function USBH_SetInterface implements the standard device request SET_INTERFACE. This request allows the host to select an alternate setting for the specified interface.

Note
This internal function should not be called by the user.
usbStatus USBH_SyncFrame ( uint8_t  ctrl,
uint8_t  index,
uint8_t *  ptr_frame_number 
)

Standard Device Request - SYNC_FRAME.

Parameters
[in]ctrlindex of USB Host controller.
[in]indexinterface or endpoint index.
[out]ptr_frame_numberpointer to where frame number data will be read.
Returns
status code that indicates the execution status of the function as defined with usbStatus.

The function USBH_SyncFrame implements the standard device request SYNCH_FRAME. This request is used to set and then report an endpoint’s synchronization frame. When an endpoint supports isochronous transfers, the endpoint may also require per-frame transfers to vary in size according to a specific pattern. The host and the endpoint must agree on which frame the repeating pattern begins. The number of the frame in which the pattern began is returned to the host.

Note
This internal function should not be called by the user.