summaryrefslogtreecommitdiff
path: root/extmod/modmachine.h
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2023-11-23 09:48:41 +1100
committerDamien George <damien@micropython.org>2024-03-15 14:22:11 +1100
commit9d0d262be069089f01da6b40d2cd78f1da14de0f (patch)
tree197aae85f00879c35945fa32eb0a1552e5e10c1f /extmod/modmachine.h
parent43904acea8b2087fdf9f283c0f8ce7d92d16e605 (diff)
extmod/machine_usb_device: Add support for Python USB devices.
This new machine-module driver provides a "USBDevice" singleton object and a shim TinyUSB "runtime" driver that delegates the descriptors and all of the TinyUSB callbacks to Python functions. This allows writing arbitrary USB devices in pure Python. It's also possible to have a base built-in USB device implemented in C (eg CDC, or CDC+MSC) and a Python USB device added on top of that. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'extmod/modmachine.h')
-rw-r--r--extmod/modmachine.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/extmod/modmachine.h b/extmod/modmachine.h
index e6b08b3fc..7c16ed302 100644
--- a/extmod/modmachine.h
+++ b/extmod/modmachine.h
@@ -213,6 +213,7 @@ extern const mp_obj_type_t machine_signal_type;
extern const mp_obj_type_t machine_spi_type;
extern const mp_obj_type_t machine_timer_type;
extern const mp_obj_type_t machine_uart_type;
+extern const mp_obj_type_t machine_usbd_type;
extern const mp_obj_type_t machine_wdt_type;
#if MICROPY_PY_MACHINE_SOFTI2C
@@ -230,6 +231,10 @@ extern const mp_machine_spi_p_t mp_machine_soft_spi_p;
extern const mp_obj_dict_t mp_machine_spi_locals_dict;
#endif
+#if MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE
+extern const mp_obj_type_t machine_usb_device_type;
+#endif
+
#if defined(MICROPY_MACHINE_MEM_GET_READ_ADDR)
uintptr_t MICROPY_MACHINE_MEM_GET_READ_ADDR(mp_obj_t addr_o, uint align);
#endif