ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
esphome::zephyr::CdcAcm Class Referencefinal

Passes the bit rate a USB host sets on a CDC ACM port from the USB driver's thread to the main loop. More...

#include <cdc_acm.h>

Static Public Member Functions

template<typename F >
static void add_on_rate_callback (F &&callback)
 Call from setup().
 
static void rate_changed (const device *dev)
 Called by the USB driver, from its own thread, after the host set the bit rate of dev.
 

Static Protected Member Functions

static void start ()
 
static void post_rate (const device *dev)
 

Static Protected Attributes

static CallbackManager< void(const device *, uint32_t)> rate_callbacks
 

Detailed Description

Passes the bit rate a USB host sets on a CDC ACM port from the USB driver's thread to the main loop.

Definition at line 11 of file cdc_acm.h.

Member Function Documentation

◆ add_on_rate_callback()

template<typename F >
static void esphome::zephyr::CdcAcm::add_on_rate_callback ( F && callback)
inlinestatic

Call from setup().

Callbacks get each port's current rate, then every rate the host sets, on the main loop. Rates reach the callbacks on a scheduler tick, which normally comes after every subscriber's setup(); a component that holds setup back with can_proceed() runs the scheduler earlier, and a subscriber registered after that tick misses the boot-time rate.

Definition at line 17 of file cdc_acm.h.

◆ post_rate()

void esphome::zephyr::CdcAcm::post_rate ( const device * dev)
staticprotected

Definition at line 44 of file cdc_acm.cpp.

◆ rate_changed()

void esphome::zephyr::CdcAcm::rate_changed ( const device * dev)
static

Called by the USB driver, from its own thread, after the host set the bit rate of dev.

Definition at line 38 of file cdc_acm.cpp.

◆ start()

void esphome::zephyr::CdcAcm::start ( )
staticprotected

Definition at line 26 of file cdc_acm.cpp.

Field Documentation

◆ rate_callbacks

CallbackManager<void(const device *, uint32_t)> esphome::zephyr::CdcAcm::rate_callbacks
inlinestaticprotected

Definition at line 29 of file cdc_acm.h.


The documentation for this class was generated from the following files: