PebbleOS v4.47.0-757-g12b6c531f
Loading...
Searching...
No Matches
pbl_usbd_function Struct Reference

A function of the device: a class, on interfaces and endpoints of its own. More...

#include <usbd.h>

Data Fields

const uint8_t * desc
 Interface and endpoint descriptors, class-specific ones included.
 
uint16_t desc_len
 Length of desc, in bytes.
 
const char *const * strings
 Optional.
 
uint8_t num_strings
 Number of strings.
 
uint8_t first_iface
 First interface.
 
uint8_t num_ifaces
 Number of interfaces.
 
void(* configured )(bool on)
 Optional.
 
void(* set_alt )(uint8_t iface, uint8_t alt)
 Optional.
 
int(* class_request )(const struct pbl_usb_setup *setup, uint8_t **data, uint16_t *len)
 Optional.
 
void(* control_out )(const struct pbl_usb_setup *setup, const uint8_t *data, uint16_t len)
 Optional.
 
void(* xfer_done )(uint8_t ep, int ret)
 Optional.
 

Detailed Description

A function of the device: a class, on interfaces and endpoints of its own.

Field Documentation

◆ class_request

int(* pbl_usbd_function::class_request) (const struct pbl_usb_setup *setup, uint8_t **data, uint16_t *len)

Optional.

A class request to an interface of the function. For an IN request, point data at what to send, len bytes; for an OUT one, at room for len bytes, which then arrive through control_out. Returns 0, or a negative errno for the request to stall.

◆ configured

void(* pbl_usbd_function::configured) (bool on)

Optional.

The host configured the device, its endpoints now enabled, or left that configuration, at a reset or a disconnection.

◆ control_out

void(* pbl_usbd_function::control_out) (const struct pbl_usb_setup *setup, const uint8_t *data, uint16_t len)

Optional.

The data of an OUT class request, the request done.

◆ desc

const uint8_t* pbl_usbd_function::desc

Interface and endpoint descriptors, class-specific ones included.

◆ desc_len

uint16_t pbl_usbd_function::desc_len

Length of desc, in bytes.

◆ first_iface

uint8_t pbl_usbd_function::first_iface

First interface.

◆ num_ifaces

uint8_t pbl_usbd_function::num_ifaces

Number of interfaces.

◆ num_strings

uint8_t pbl_usbd_function::num_strings

Number of strings.

◆ set_alt

void(* pbl_usbd_function::set_alt) (uint8_t iface, uint8_t alt)

Optional.

The host selected alternate setting alt of interface iface, the endpoints of the previous setting now disabled, their transfers ended with -ECONNABORTED, and those of alt enabled. Not called when the host configures the device.

◆ strings

const char* const* pbl_usbd_function::strings

Optional.

Strings of the descriptors, ASCII, by their index minus 1.

◆ xfer_done

void(* pbl_usbd_function::xfer_done) (uint8_t ep, int ret)

Optional.

A transfer on an endpoint of the function ended: bytes moved, or a negative errno.


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