From 1cae96951f59e7549ff1a2d5643cda66784c22a1 Mon Sep 17 00:00:00 2001 From: Nathan Conrad Date: Sat, 14 Sep 2019 12:13:11 -0400 Subject: Add usbtmc class driver. --- src/device/usbd.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/device/usbd.c') diff --git a/src/device/usbd.c b/src/device/usbd.c index c92884334..572708f7d 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -145,6 +145,22 @@ static usbd_class_driver_t const usbd_class_drivers[] = .sof = NULL }, #endif + + #if CFG_TUD_USBTMC + // Presently USBTMC is the only defined class with the APP_SPECIFIC class code. + // We maybe need to add subclass codes here, or a callback to ask if a driver can + // handle a particular interface. + { + .class_code = TUSB_CLASS_APPLICATION_SPECIFIC, + .init = usbtmcd_init, + .reset = usbtmcd_reset, + .open = usbtmcd_open, + .control_request = usbtmcd_control_request, + .control_complete = usbtmcd_control_complete, + .xfer_cb = usbtmcd_xfer_cb, + .sof = NULL + }, + #endif }; enum { USBD_CLASS_DRIVER_COUNT = TU_ARRAY_SIZE(usbd_class_drivers) }; -- cgit v1.3.1