whiskers 0.2.0
RP2350 BadUSB Tool
Loading...
Searching...
No Matches
usb_callbacks Struct Reference

Struct holding callback functions for internal USB events. More...

#include <usb.h>

Data Fields

void(* mounted_cb )(void)
void(* unmounted_cb )(void)
void(* suspend_cb )(bool)
void(* unsuspend_cb )(void)

Detailed Description

Struct holding callback functions for internal USB events.

Note here that only mounted and unmounted are typically required for normal operation. The suspend and unsuspend only matter if the device is meant to keep working while plugged in, (ie. waiting for a certain event to deliver a payload) rather then just firing immediately.

Also note that our powersupply comes from VBUS from the host computer, therefore we'd probably lose power before the unmounted callback even fires.

Field Documentation

◆ mounted_cb

void(* usb_callbacks::mounted_cb) (void)

Callback function for when the device gets mounted.

◆ suspend_cb

void(* usb_callbacks::suspend_cb) (bool)

Callback function for when the host requests the device to be suspended (note the device must draw less than 2.5ma current at this stage). The bool parameter is whether or not the host can be remote wakeup-ed

◆ unmounted_cb

void(* usb_callbacks::unmounted_cb) (void)

Callback function for when the device gets unmounted.

◆ unsuspend_cb

void(* usb_callbacks::unsuspend_cb) (void)

Callback function for when the host wants to unspend the device.


The documentation for this struct was generated from the following file:
  • /home/zane/whiskers/code/hal/usb.h