English
Language : 

UM0463 Datasheet, PDF (15/30 Pages) STMicroelectronics – ST7 full-speed USB library
UM0463
The USB state machine of the control endpoint
3.5.1
3.5.2
3.5.3
Get status
Recipient of the device
The library exports a variable, vUSB_Current_Feature. This variable is defined as: unsigned
char vUSB_Current_Feature;
The meaning of this variable is:
● D7: Reserved as one
● D6: Power feature; 1=Self-Powered, 0=Bus-Powered
● D5: Remote-wake-up: 1=Support, 0=Not support
● D4-D2: Reserved as zero
● D1: Current Remote-wakeup: 1=Enable, 0=Disable
● D0: Current power feature: 1=Self-Powered, 0=Bus-Powered
This variable has the features of a device. The library requires that the user code copies the
bmAttributes field of the configuration descriptor to this variable in the
USER_USB_Set_Configuration() callback function.
With the help of the above variable, the library answers the request without any callback to
the user code.
Recipient of the interface
In the configured state, the library ensures that the interface index is valid by checking the
low byte of wIndex with the number of interfaces (vUSB_Num_Interface) given by the user
code. The library replies with two bytes of zero without any callback to the user code if the
interface index is valid.
Recipient of the endpoint
The library checks if the endpoint referred to is valid. In the address state, the valid endpoint
is endpoint address 0 on both directions only. In the configured state, the endpoint is valid if
its corresponding status register is not set as DISABLE (Section 1.2.1).
The library answers the request without the user code intervention if the endpoint referred to
is valid.
Clear feature and set feature
Recipient of device
The valid requests are set/clear the remote wakeup feature. The library sets or clears the
feature if the feature is supported (bit 5 of vUSB_Current_Feature is 1, see Section 3.5.1:
Get status)
The library answers the request without any callback to the user code.
Recipient of interface
The USB specification [1] specifies that this request is valid in the configured state but the
behavior is not specified. The library checks if the request parameters are valid and passes
the control to the user code. It is up to the user code to decide what to do.
15/30