cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

DiDi_4439146
New Contributor II

Hi,

I am using the hid_examples/cyfx3_hid example. With my current mouse if the computer is in sleep mode and I press any button on the mouse - the computer will wake up. How do I implement this in the hid example?

0 Likes
1 Solution
YashwantK_46
Moderator
Moderator

Hello DiDi_4439146​,

Please refer to the attached firmware with the remote wake up from sleep enabled.
Please test and let me know if you face any issues.


Apologies for the delay.


Regards,

Yashwant

View solution in original post

5 Replies
YashwantK_46
Moderator
Moderator

Hello,

The default hid_examples/cyfx3_hid example can be used without any changes to wake up the PC when the screen turns off automatically by pressing the switch 'SW2'.

I have tried this as follows (on a Windows 10 host PC):

1.) Change the Power and Sleep setting in the Settings application to go to sleep in '1 minute'.
2.) The FX3 superspeed explorer kit is programmed with the MouseDemo.img and allowed the PC to go into sleep.3.) Press the switch SW2, wakes up the PC to the log-in screen of windows (as expected, like with a real mouse).

Please try as mentioned above and let me know if you face any issues.


Regards,Yashwant

0 Likes
DiDi_4439146
New Contributor II

Hi Yashwant,

Sorry I don't think I was clear in my first post. I don't mean when the screen turns off I mean when the PC goes into this sleep mode (screenshot added)
pastedImage_1.png

I think this is also called "hibernation" mode. With other mice, all I need to do is pretty the mouse button and the computer wakes up from this state.

0 Likes
YashwantK_46
Moderator
Moderator

Hello DiDi_4439146​,

Please refer to the attached firmware with the remote wake up from sleep enabled.
Please test and let me know if you face any issues.


Apologies for the delay.


Regards,

Yashwant

View solution in original post

DiDi_4439146
New Contributor II

Hi Yashwant,

This worked for me - can you please explain the purpose of this code though?

if ((bTarget == CY_U3P_USB_TARGET_DEVICE) && (bRequest == CY_U3P_USB_SC_SET_FEATURE)){

        //    switch (wValue)

    {

        case CY_U3P_USB2_FS_REMOTE_WAKE:

            CyU3PDeviceReset(CyFalse);

            break;

    }

}

0 Likes
YashwantK_46
Moderator
Moderator

Hello,

Apologies about that.
That piece of code was added for debug purposes and i forgot to remove it before sharing it with you.

Please comment out or remove the code from the firmware:

if ((bTarget == CY_U3P_USB_TARGET_DEVICE) && (bRequest == CY_U3P_USB_SC_SET_FEATURE)){

        //    switch (wValue)

    {

        case CY_U3P_USB2_FS_REMOTE_WAKE:

            CyU3PDeviceReset(CyFalse);

            break;

    }

Regards,

Yashwant

0 Likes