USBGetRemoteWakeupStatus Macro

Microchip USB Device Library

USB Device Library Help
USBGetRemoteWakeupStatus Macro
C
#define USBGetRemoteWakeupStatus RemoteWakeup
Description

This function indicates if remote wakeup has been enabled by the host. Devices that support remote wakeup should use this function to determine if it should send a remote wakeup. 

If a device does not support remote wakeup (the Remote wakeup bit, bit 5, of the bmAttributes field of the Configuration descriptor is set to 1), then it should not send a remote wakeup command to the PC and this function is not of any use to the device. If a device does support remote wakeup then it should use this function as described below. 

If this function returns FALSE and the device is suspended, it should not issue a remote wakeup (resume). 

If this function returns TRUE and the device is suspended, it should issue a remote wakeup (resume). 

A device can add remote wakeup support by having the _RWU symbol added in the configuration descriptor (located in the usb_descriptors.c file in the project). This done in the 8th byte of the configuration descriptor. For example: 

 

  ROM BYTE configDescriptor1[]={
    0x09,                           // Size 
    USB_DESCRIPTOR_CONFIGURATION,   // descriptor type 
    DESC_CONFIG_WORD(0x0022),       // Total length 
    1,                              // Number of interfaces 
    1,                              // Index value of this cfg 
    0,                              // Configuration string index 
    _DEFAULT | _SELF | _RWU,        // Attributes, see usb_device.h 
    50,                             // Max power consumption in 2X mA(100mA)
    
    //The rest of the configuration descriptor should follow

 

For more information about remote wakeup, see the following section of the USB v2.0 specification available at www.usb.org:

  • Section 9.2.5.2
  • Table 9-10
  • Section 7.1.7.7
  • Section 9.4.5

Preconditions

None

Return Values
Return Values 
Description 
TRUE 
Remote Wakeup has been enabled by the host 
FALSE 
Remote Wakeup is not currently enabled 
Remarks

None

Microchip MCHPFSUSB v2.3 - Sept 20, 2008
Copyright © 2008 Microchip Technology, Inc.  All rights reserved.