Loading...
Searching...
No Matches
usbus_handler_driver Struct Reference

USBUS event handler function pointers. More...

Detailed Description

USBUS event handler function pointers.

Definition at line 373 of file usbus.h.

#include <usbus.h>

Data Fields

void(* init )(usbus_t *usbus, struct usbus_handler *handler)
 Initialize the event handler.
 
void(* event_handler )(usbus_t *usbus, struct usbus_handler *handler, usbus_event_usb_t event)
 event handler function
 
void(* transfer_handler )(usbus_t *usbus, struct usbus_handler *handler, usbdev_ep_t *ep, usbus_event_transfer_t event)
 transfer handler function
 
int(* control_handler )(usbus_t *usbus, struct usbus_handler *handler, usbus_control_request_state_t state, usb_setup_t *request)
 control request handler function
 

Field Documentation

◆ control_handler

int(* usbus_handler_driver::control_handler) (usbus_t *usbus, struct usbus_handler *handler, usbus_control_request_state_t state, usb_setup_t *request)

control request handler function

This function receives USB control requests from the USBUS stack.

Parameters
usbusUSBUS context
handlerhandler context
statecontrol request state
setupsetup packet
Returns
Size of the returned data when the request is handled
negative to have the stack return an USB stall to the host
zero when the request is not handled by this handler

Definition at line 426 of file usbus.h.

◆ event_handler

void(* usbus_handler_driver::event_handler) (usbus_t *usbus, struct usbus_handler *handler, usbus_event_usb_t event)

event handler function

This function is passed USBUS events

Parameters
usbusUSBUS context
handlerhandler context
eventusbus_event_usb_t event to handle

Definition at line 395 of file usbus.h.

◆ init

void(* usbus_handler_driver::init) (usbus_t *usbus, struct usbus_handler *handler)

Initialize the event handler.

This function is called in the USBUS thread context to initialize the event handler

Parameters
usbusUSBUS context
handlerhandler context

Definition at line 384 of file usbus.h.

◆ transfer_handler

void(* usbus_handler_driver::transfer_handler) (usbus_t *usbus, struct usbus_handler *handler, usbdev_ep_t *ep, usbus_event_transfer_t event)

transfer handler function

This function receives transfer based events

Parameters
usbusUSBUS context
handlerhandler context
epusbdev endpoint that triggered the event
eventusbus_event_transfer_t event

Definition at line 408 of file usbus.h.


The documentation for this struct was generated from the following file: