ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_usb_composite_class_t Struct Reference

Caller-owned class-layer registration record. More...

#include <ra8_usb_composite.h>

Collaboration diagram for ra8_usb_composite_class_t:

Data Fields

uint8_t interface_number_first
 First IF this class owns.
uint8_t interface_number_count
 IF count (CDC=2, HID=1...).
ra8_usb_composite_init_fn_t init
 init callback (non-NULL).
ra8_usb_composite_setup_fn_t handle_setup
 setup callback (non-NULL).
ra8_usb_composite_close_fn_t close
 close callback (non-NULL).
void * ctx
 Opaque context.

Detailed Description

Caller-owned class-layer registration record.

All three function pointers must be non-NULL. ctx is opaque to the composite layer and threaded back into each callback unchanged. The [interface_number_first, interface_number_first + interface_number_count) range describes which IF numbers from the configuration descriptor this class owns. CDC ACM consumes 2 IFs (control + data); HID and MSC each consume 1.

Invariant
interface_number_count >= 1.
interface_number_first + interface_number_count <= k_ra8_usb_composite_max_ifs.
static ra8_err_t my_init(void* ctx);
static ra8_err_t my_setup(void* ctx, const ra8_usb_setup_t* s);
static ra8_err_t my_close(void* ctx);
static const ra8_usb_composite_class_t s_cdc_layer = {
.interface_number_first = 0U,
.interface_number_count = 2U,
.init = my_init,
.handle_setup = my_setup,
.close = my_close,
.ctx = nullptr,
};
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Caller-owned class-layer registration record.
void * ctx
Opaque context.
Decoded 8-byte USB SETUP packet.

Definition at line 172 of file ra8_usb_composite.h.

Field Documentation

◆ close

ra8_usb_composite_close_fn_t ra8_usb_composite_class_t::close

close callback (non-NULL).

Definition at line 177 of file ra8_usb_composite.h.

Referenced by internal_validate_class(), and ra8_usb_composite_close().

◆ ctx

void* ra8_usb_composite_class_t::ctx

Opaque context.

Definition at line 178 of file ra8_usb_composite.h.

Referenced by internal_route_class(), ra8_usb_composite_close(), and ra8_usb_composite_register_class().

◆ handle_setup

ra8_usb_composite_setup_fn_t ra8_usb_composite_class_t::handle_setup

setup callback (non-NULL).

Definition at line 176 of file ra8_usb_composite.h.

Referenced by internal_route_class(), and internal_validate_class().

◆ init

ra8_usb_composite_init_fn_t ra8_usb_composite_class_t::init

init callback (non-NULL).

Definition at line 175 of file ra8_usb_composite.h.

Referenced by internal_validate_class(), and ra8_usb_composite_register_class().

◆ interface_number_count

uint8_t ra8_usb_composite_class_t::interface_number_count

IF count (CDC=2, HID=1...).

Definition at line 174 of file ra8_usb_composite.h.

Referenced by internal_check_collision(), internal_mark_ownership(), and internal_validate_class().

◆ interface_number_first

uint8_t ra8_usb_composite_class_t::interface_number_first

First IF this class owns.

Definition at line 173 of file ra8_usb_composite.h.

Referenced by internal_check_collision(), internal_mark_ownership(), and internal_validate_class().


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