usbus_descr_gen_funcs_t Struct Reference

USBUS descriptor generator function pointers. More...

Detailed Description

USBUS descriptor generator function pointers.

Definition at line 202 of file usbus.h.

#include <usbus.h>

Data Fields

size_t(* fmt_pre_descriptor )(usbus_t *usbus, void *arg)
 function pointer to format the descriptor content of this descriptor generator. More...
 
size_t(* fmt_post_descriptor )(usbus_t *usbus, void *arg)
 function pointer to format the descriptor content of this descriptor generator. More...
 
union {
   size_t(*   get_descriptor_len )(usbus_t *usbus, void *arg)
 USBUS generic descriptor generator generated length. More...
 
   size_t   fixed_len
 Fixed total length of the generated descriptors. More...
 
len
 Fixed or generated length of the descriptor.
 
usbus_descr_len_type_t len_type
 Either USBUS_DESCR_LEN_FIXED or USBUS_DESCR_LEN_FUNC.
 

Field Documentation

◆ fixed_len

size_t usbus_descr_gen_funcs_t::fixed_len

Fixed total length of the generated descriptors.

Must return the total length of the descriptors that will be generated by the fmt_pre_descriptor and fmt_post_descriptor. This value is used when len_type is set to USBUS_DESCR_LEN_FIXED.

Definition at line 249 of file usbus.h.

◆ fmt_post_descriptor

size_t(* usbus_descr_gen_funcs_t::fmt_post_descriptor) (usbus_t *usbus, void *arg)

function pointer to format the descriptor content of this descriptor generator.

The content of this descriptor is appended after the descriptor of the object it is part of.

Parameters
usbusThe usbus context
argAdditional argument for the descriptor generator
Returns
Length of the generated descriptor

Definition at line 225 of file usbus.h.

◆ fmt_pre_descriptor

size_t(* usbus_descr_gen_funcs_t::fmt_pre_descriptor) (usbus_t *usbus, void *arg)

function pointer to format the descriptor content of this descriptor generator.

The content of this descriptor is prefixes before the descriptor of the object it is part of.

Parameters
usbusThe usbus context
argAdditional argument for the descriptor generator
Returns
Length of the generated descriptor

Definition at line 213 of file usbus.h.

◆ get_descriptor_len

size_t(* usbus_descr_gen_funcs_t::get_descriptor_len) (usbus_t *usbus, void *arg)

USBUS generic descriptor generator generated length.

Must return the total length of the descriptors that will be generated by fmt_pre_descriptor and fmt_post_descriptor This function is used when len_type is set to USBUS_DESCR_LEN_FUNC.

Parameters
usbusThe usbus context
argAdditional argument for the descriptor generators
Returns
Length of the generated descriptors

Definition at line 240 of file usbus.h.


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