Sound Byte Libs
0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
usb.hpp
Go to the documentation of this file.
1
#ifndef SBL_USB_USB_HPP_
2
#define SBL_USB_USB_HPP_
3
4
/**
5
* @file usb.hpp
6
* @brief USB subsystem control
7
*
8
* Provides initialization and task processing for USB functionality.
9
* The actual implementation is MCU-specific and lives in sbl-hardware.
10
*
11
* Usage:
12
* #include <sbl/usb/usb.hpp>
13
*
14
* int main() {
15
* sbl::driver::init();
16
* sbl::usb::init();
17
*
18
* while (true) {
19
* sbl::usb::task(); // Process USB events
20
* // ... application code ...
21
* }
22
* }
23
*/
24
25
#include <cstdint>
26
27
namespace
sbl::usb
{
28
29
/**
30
* @brief Initialize USB subsystem
31
*
32
* Sets up USB peripheral clocks, pins, and initializes TinyUSB.
33
* Call once at startup after sbl::driver::init().
34
*/
35
void
init
();
36
37
/**
38
* @brief Process USB events
39
*
40
* Must be called periodically (from main loop or timer) to handle
41
* USB enumeration, data transfer, and protocol handling.
42
*
43
* On RP2xxx: Can also be IRQ-driven, but task() still needs calling.
44
* On STM32: Typically polled from main loop.
45
*/
46
void
task
();
47
48
/**
49
* @brief Check if USB is enumerated and ready
50
*
51
* @return true if USB device is configured and ready for communication
52
*/
53
bool
ready
();
54
55
}
// namespace sbl::usb
56
57
#endif
// SBL_USB_USB_HPP_
sbl::usb
USB device classes.
Definition
cdc.cpp:24
sbl::usb::init
void init()
Initialize USB subsystem.
sbl::usb::task
void task()
Process USB events.
sbl::usb::ready
bool ready()
Check if USB is enumerated and ready.
src
sbl
usb
usb.hpp
Generated by
1.9.8