1 /* 2 * Copyright (c) 2023 Nordic Semiconductor ASA. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_SAMPLES_SUBSYS_USB_COMMON_SAMPLE_USBD_H 8 #define ZEPHYR_SAMPLES_SUBSYS_USB_COMMON_SAMPLE_USBD_H 9 10 #include <stdint.h> 11 #include <zephyr/usb/usbd.h> 12 13 /* 14 * The scope of this header is limited to use in USB samples together with the 15 * new experimental USB device stack, you should not use it in your own 16 * application. However, you can use the code as a template. 17 */ 18 19 /* 20 * This function uses Kconfig.sample_usbd options to configure and initialize a 21 * USB device. It configures sample's device context, default string descriptors, 22 * USB device configuration, registers any available class instances, and 23 * finally initializes USB device. It is limited to a single device with a 24 * single configuration instantiated in sample_usbd_init.c, which should be 25 * enough for a simple USB device sample. 26 * 27 * It returns the configured and initialized USB device context on success, 28 * otherwise it returns NULL. 29 */ 30 struct usbd_context *sample_usbd_init_device(usbd_msg_cb_t msg_cb); 31 32 /* 33 * This function is similar to sample_usbd_init_device(), but does not 34 * initialize the device. It allows the application to set additional features, 35 * such as additional descriptors. 36 */ 37 struct usbd_context *sample_usbd_setup_device(usbd_msg_cb_t msg_cb); 38 39 #endif /* ZEPHYR_SAMPLES_SUBSYS_USB_COMMON_SAMPLE_USBD_H */ 40