|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include <stdint.h>#include <stddef.h>#include <stdbool.h>Go to the source code of this file.
Functions | |
| bool | usb_cdc_init (void) |
| bool | usb_cdc_start (void) |
| Starts USB CDC runtime (or triggers re-enumeration in early-debug mode). | |
| bool | usb_cdc_ready (void) |
| Returns whether USB CDC is connected and ready. | |
| size_t | usb_cdc_write (const uint8_t *data, size_t len) |
| Writes byte buffer to USB CDC endpoint. | |
| size_t | usb_cdc_print (const char *str) |
| Writes null-terminated string to USB CDC. | |
| size_t | usb_cdc_read (uint8_t *data, size_t len) |
| Reads bytes from USB CDC endpoint. | |
| int | usb_cdc_getchar (void) |
| Reads one character from USB CDC stream. | |
| size_t | usb_cdc_available (void) |
| Returns number of bytes available for read. | |
| void | usb_cdc_flush (void) |
| Flushes pending USB CDC writes. | |
| size_t usb_cdc_available | ( | void | ) |
Returns number of bytes available for read.
Check if data is available to read
Definition at line 268 of file usb_cdc.cpp.
References g_usb_started.
| void usb_cdc_flush | ( | void | ) |
Flushes pending USB CDC writes.
Flush TX buffer (blocking)
Definition at line 276 of file usb_cdc.cpp.
References g_usb_started.
| int usb_cdc_getchar | ( | void | ) |
Reads one character from USB CDC stream.
Get single character from USB CDC (non-blocking)
Definition at line 254 of file usb_cdc.cpp.
References g_usb_started.
| bool usb_cdc_init | ( | void | ) |
USB CDC Serial Interface
Provides serial console via TinyUSB CDC. Initialize USB subsystem with CDC serial Behavior depends on CONFIG_USB_EARLY_DEBUG:
Definition at line 129 of file usb_cdc.cpp.
References g_usb_prepared, LOG_E, LOG_I, TAG, usb_hid_init(), and usb_start_stack().
Referenced by initCoreServices().
| size_t usb_cdc_print | ( | const char * | str | ) |
Writes null-terminated string to USB CDC.
Write string to USB CDC
| str | Null-terminated string |
| str | String to write. |
Definition at line 234 of file usb_cdc.cpp.
References usb_cdc_write().
| size_t usb_cdc_read | ( | uint8_t * | data, |
| size_t | len ) |
Reads bytes from USB CDC endpoint.
Read data from USB CDC (non-blocking)
| data | Buffer for received data |
| len | Maximum bytes to read |
| data | Output buffer. |
| len | Maximum bytes to read. |
Definition at line 245 of file usb_cdc.cpp.
References g_usb_started.
| bool usb_cdc_ready | ( | void | ) |
Returns whether USB CDC is connected and ready.
Check if USB CDC is ready for I/O
Definition at line 196 of file usb_cdc.cpp.
References g_usb_started.
| bool usb_cdc_start | ( | void | ) |
Starts USB CDC runtime (or triggers re-enumeration in early-debug mode).
Start USB stack (only needed when CONFIG_USB_EARLY_DEBUG is disabled) Call this after all modules have registered their USB interfaces.
Definition at line 166 of file usb_cdc.cpp.
References g_usb_prepared, g_usb_started, LOG_I, TAG, and usb_start_stack().
Referenced by startApp().
| size_t usb_cdc_write | ( | const uint8_t * | data, |
| size_t | len ) |
Writes byte buffer to USB CDC endpoint.
Write data to USB CDC
| data | Data to write |
| len | Data length |
| data | Data buffer. |
| len | Number of bytes to write. |
Definition at line 206 of file usb_cdc.cpp.
References g_usb_started.
Referenced by host_usb_cdc_write(), and usb_cdc_print().