I see a bunch of places in the code to enable "remote_wakeup". However, I can seem to find where to trigger the remote wakeup sequence from the perspective of the UsbBus trait.
I'm currently implementing this hal for atsam4 (which is very different from atsamd) and should hopefully get some code pushed in the next week or so (I have ep0 up and running now!).
In the context of a keyboard, when a key is pressed and the computer is asleep you need to check if the USB module is in a suspend state.
In Suspend state it is possible to wake up the host sending an external resume.
The device must wait at least 5 ms after being entered in suspend before sending an external resume.
The device has 10 ms from the moment it starts to drain current and it forces a K state to resume the host.
The device must force a K state from 1 to 15 ms to resume the host
In my case for atsam4s I need to set a bit in the USB (UDP) register block, then clear it immediately after.
I know from other MCUs (mk20dx256vlh7 iirc), you actually need to wait for an interrupt on when to clear this bit in order to handle the 1 to 15 ms timing. Other MCUs you have to keep track of this yourself.
Have these cases been considered in this crate yet?
I see a bunch of places in the code to enable "remote_wakeup". However, I can seem to find where to trigger the remote wakeup sequence from the perspective of the UsbBus trait.
I'm currently implementing this hal for atsam4 (which is very different from atsamd) and should hopefully get some code pushed in the next week or so (I have ep0 up and running now!).
In the context of a keyboard, when a key is pressed and the computer is asleep you need to check if the USB module is in a suspend state.
In my case for atsam4s I need to set a bit in the USB (UDP) register block, then clear it immediately after. I know from other MCUs (mk20dx256vlh7 iirc), you actually need to wait for an interrupt on when to clear this bit in order to handle the 1 to 15 ms timing. Other MCUs you have to keep track of this yourself.
Have these cases been considered in this crate yet?