In this use case, the USB remote wakeup feature is enabled.
Setup steps
Prior to implement this use case, be sure to have already apply the UDI module "basic use case".
Usage steps
Example code
Content of conf_usb.h:
#define USB_DEVICE_ATTR \
(USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_..._POWERED)
#define UDC_REMOTEWAKEUP_ENABLE() my_callback_remotewakeup_enable()
extern void my_callback_remotewakeup_enable(void);
#define UDC_REMOTEWAKEUP_DISABLE() my_callback_remotewakeup_disable()
extern void my_callback_remotewakeup_disable(void);
Add to application C-file:
void my_callback_remotewakeup_enable(void)
{
}
void my_callback_remotewakeup_disable(void)
{
}
void my_interrupt_event(void)
{
}
Workflow
- Ensure that conf_usb.h is available and contains the following parameters required to enable remote wakeup feature:
#define USB_DEVICE_ATTR (USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_..._POWERED)
#define UDC_REMOTEWAKEUP_ENABLE() my_callback_remotewakeup_enable()
extern void my_callback_remotewakeup_enable(void);
#define UDC_REMOTEWAKEUP_DISABLE() my_callback_remotewakeup_disable()
extern void my_callback_remotewakeup_disable(void);
- Send a remote wakeup (USB upstream):