User`s manual
RSK+ RX62N USB Stack
3.USB Stack (Target)
The USB software is implemented in the form of a USB stack comprising of three layers.
At the bottom of the stack is a hardware abstraction layer (HAL) that provides a hardware independent API for the
upper layers.
In the middle is a core layer (USBCore) that handles standard device requests.
At the top of the stack are the USB Device Classes consisting of HID, CDC and MSC. These specific classes are
described in their own sections below.
This modular design means this software can be still be used even if developing a proprietary USB interface. For
example a proprietary module could be implemented by calling functions directly exposed by both the USBHAL API
and USBCore API.
3.1 Hardware Abstraction Layer
The HAL is a hardware specific layer that provides a non-hardware specific API. The HAL supports the following
transfer modes:
• Control (Setup, Data IN/OUT, Status)
• Bulk (IN and OUT)
• Interrupt (IN)
Here is a list of the functions that make up the USBHAL API.
Name Description
USBHAL_Init Initialise the HAL. Register callback functions. Note: If using the USB Core layer then this is done
automatically.
USBHAL_Config_Get Get the current HAL configuration.
USBHAL_Config_Set Set the current HAL configuration.
USBHAL_Control_Status Generate the status stage of a Control transfer.
USBHAL_Control_IN Send data on the Control IN pipe.
USBHAL_Control_OUT Receive data on the Control OUT pipe.
USBHAL_Bulk_IN Send data on the Bulk IN pipe.
USBHAL_Bulk_OUT Receive data on the Bulk OUT pipe.
USBHAL_Interrupt_IN Send data on the Interrupt IN pipe.
USBHAL_Reset Reset this module. (Following an error).
USBHAL_ResetEndpoints Resets endpoint data toggle bits.
USBHAL_Control_Stall Stall the Control pipe. Automatically cleared.
USBHAL_Bulk_IN_Stall Stall the Bulk IN pipe.
USBHAL_Bulk_OUT_Stall Stall the Bulk OUT pipe.
USBHAL_Interrupt_IN_Stall Stall the Interrupt IN pipe.
USBHAL_Bulk_IN_Stall_Clear Clear stall on Bulk IN pipe.
USBHAL_Bulk_OUT_Stall_Clear Clear stall on Bulk OUT pipe.
USBHAL_Interrupt_IN_Stall_Clear Clear stall on Interrupt IN pipe.
USBHAL_Bulk_IN_Is_Stalled Gets the stall status of the Bulk IN pipe.
USBHAL_Bulk_OUT_Is_Stalled Gets the stall status of the Bulk OUT pipe.
USBHAL_Interrupt_IN_Is_Stalled Gets the stall status of the Interrupt IN pipe.
R20UT0255EG0100 Page 9 of 9
August 26, 2010