Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Namespaces | Classes | Functions
sbl::usb Namespace Reference

USB device support. More...

Namespaces

namespace  anonymous_namespace{midi.cpp}
 

Classes

struct  CdcOutput
 Logger output sink for sbl::log integration. More...
 
class  CdcSerial
 USB CDC (Virtual COM Port) interface. More...
 
class  MidiPort
 USB MIDI device port (static class) More...
 

Functions

void init ()
 Initialize USB subsystem.
 
void task ()
 Process USB events.
 
bool ready ()
 Check if USB is enumerated and ready.
 

Detailed Description

USB device support.

USB CDC (virtual serial port) via TinyUSB integration. Cross-platform: RP2040, RP2350, STM32H7.

Function Documentation

◆ init()

void sbl::usb::init ( )

Initialize USB subsystem.

Sets up USB peripheral clocks, pins, and initializes TinyUSB. Call once at startup after sbl::driver::init().

◆ ready()

bool sbl::usb::ready ( )

Check if USB is enumerated and ready.

Returns
true if USB device is configured and ready for communication

Referenced by sbl::usb::CdcSerial::just_connected().

Here is the caller graph for this function:

◆ task()

void sbl::usb::task ( )

Process USB events.

Must be called periodically (from main loop or timer) to handle USB enumeration, data transfer, and protocol handling.

On RP2xxx: Can also be IRQ-driven, but task() still needs calling. On STM32: Typically polled from main loop.