summaryrefslogtreecommitdiff
path: root/src/device/usbd.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-09-26 00:38:37 +0700
committerGitHub <[email protected]>2019-09-26 00:38:37 +0700
commit9a8d23e95ed6a48b3a3d43f7cf7d3f360ee61977 (patch)
tree8f918208a29c15988396e910f679ec399cd8826c /src/device/usbd.c
parent1d49fb42ce1ab206eb0518d57fb67e9ac28a3206 (diff)
parent6841b236e89cad45024280c44a77e43490635af2 (diff)
Merge pull request #160 from pigrew/usbtmc
Add usbtmc class driver (READY FOR TESTING)
Diffstat (limited to 'src/device/usbd.c')
-rw-r--r--src/device/usbd.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index 50964bdee..3700fb988 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -145,6 +145,23 @@ 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 = TUD_USBTMC_APP_CLASS,
+ //.subclass_code = TUD_USBTMC_APP_SUBCLASS
+ .init = usbtmcd_init_cb,
+ .reset = usbtmcd_reset_cb,
+ .open = usbtmcd_open_cb,
+ .control_request = usbtmcd_control_request_cb,
+ .control_complete = usbtmcd_control_complete_cb,
+ .xfer_cb = usbtmcd_xfer_cb,
+ .sof = NULL
+ },
+ #endif
};
enum { USBD_CLASS_DRIVER_COUNT = TU_ARRAY_SIZE(usbd_class_drivers) };