Lines Matching full:device
9 * @brief New USB device controller (UDC) driver API
16 #include <zephyr/device.h>
32 * USB device controller capabilities
34 * This structure is mainly intended for the USB device stack.
48 * @brief USB device actual speed
51 /** Device is probably not connected */
53 /** Device is connected to a full speed bus */
55 /** Device is connected to a high speed bus */
57 /** Device is connected to a super speed bus */
62 * USB device controller endpoint capabilities
82 * USB device controller endpoint status
98 * USB device controller endpoint configuration
123 * @brief USB device controller event types
130 /** Device resume event */
132 /** Device suspended event */
148 * USB device controller event
166 /** Pointer to device struct */
167 const struct device *dev;
206 * @param[in] dev Pointer to device struct of the driver instance
211 typedef int (*udc_event_cb_t)(const struct device *dev,
216 * This is the mandatory API any USB device controller driver needs to expose
221 enum udc_bus_speed (*device_speed)(const struct device *dev);
222 int (*ep_enqueue)(const struct device *dev,
225 int (*ep_dequeue)(const struct device *dev,
227 int (*ep_set_halt)(const struct device *dev,
229 int (*ep_clear_halt)(const struct device *dev,
231 int (*ep_try_config)(const struct device *dev,
233 int (*ep_enable)(const struct device *dev,
235 int (*ep_disable)(const struct device *dev,
237 int (*host_wakeup)(const struct device *dev);
238 int (*set_address)(const struct device *dev,
240 int (*enable)(const struct device *dev);
241 int (*disable)(const struct device *dev);
242 int (*init)(const struct device *dev);
243 int (*shutdown)(const struct device *dev);
244 int (*lock)(const struct device *dev);
245 int (*unlock)(const struct device *dev);
265 * To be implemented as device's private data (device->data).
276 /** USB device controller status */
287 * @brief New USB device controller (UDC) driver API
288 * @defgroup udc_api USB device controller driver API
296 * @param[in] dev Pointer to device struct of the driver instance
300 static inline bool udc_is_initialized(const struct device *dev) in udc_is_initialized()
310 * @param[in] dev Pointer to device struct of the driver instance
314 static inline bool udc_is_enabled(const struct device *dev) in udc_is_enabled()
324 * @param[in] dev Pointer to device struct of the driver instance
328 static inline bool udc_is_suspended(const struct device *dev) in udc_is_suspended()
336 * @brief Initialize USB device controller
338 * Initialize USB device controller and control IN/OUT endpoint.
342 * @param[in] dev Pointer to device struct of the driver instance
343 * @param[in] event_cb Event callback from the higher layer (USB device stack)
349 int udc_init(const struct device *dev, udc_event_cb_t event_cb);
352 * @brief Enable USB device controller
354 * Enable powered USB device controller and allow host to
355 * recognize and enumerate the device.
357 * @param[in] dev Pointer to device struct of the driver instance
363 int udc_enable(const struct device *dev);
366 * @brief Disable USB device controller
368 * Disable enabled USB device controller.
371 * @param[in] dev Pointer to device struct of the driver instance
376 int udc_disable(const struct device *dev);
379 * @brief Poweroff USB device controller
384 * @param[in] dev Pointer to device struct of the driver instance
389 int udc_shutdown(const struct device *dev);
392 * @brief Get USB device controller capabilities
397 * @param[in] dev Pointer to device struct of the driver instance
399 * @return USB device controller capabilities.
401 static inline struct udc_device_caps udc_caps(const struct device *dev) in udc_caps()
409 * @brief Get actual USB device speed
414 * @param[in] dev Pointer to device struct of the driver instance
416 * @return USB device controller capabilities.
418 enum udc_bus_speed udc_device_speed(const struct device *dev);
421 * @brief Set USB device address.
423 * Set address of enabled USB device.
425 * @param[in] dev Pointer to device struct of the driver instance
426 * @param[in] addr USB device address
431 static inline int udc_set_address(const struct device *dev, const uint8_t addr) in udc_set_address()
452 * @param[in] dev Pointer to device struct of the driver instance
457 static inline int udc_host_wakeup(const struct device *dev) in udc_host_wakeup()
483 * @param[in] dev Pointer to device struct of the driver instance
494 int udc_ep_try_config(const struct device *dev,
506 * @param[in] dev Pointer to device struct of the driver instance
518 int udc_ep_enable(const struct device *dev,
529 * @param[in] dev Pointer to device struct of the driver instance
538 int udc_ep_disable(const struct device *dev, const uint8_t ep);
545 * @param[in] dev Pointer to device struct of the driver instance
553 int udc_ep_set_halt(const struct device *dev, const uint8_t ep);
560 * @param[in] dev Pointer to device struct of the driver instance
568 int udc_ep_clear_halt(const struct device *dev, const uint8_t ep);
571 * @brief Queue USB device controller request
576 * @param[in] dev Pointer to device struct of the driver instance
585 int udc_ep_enqueue(const struct device *dev, struct net_buf *const buf);
588 * @brief Remove all USB device controller requests from endpoint queue
595 * @param[in] dev Pointer to device struct of the driver instance
603 int udc_ep_dequeue(const struct device *dev, const uint8_t ep);
610 * @param[in] dev Pointer to device struct of the driver instance
616 struct net_buf *udc_ep_buf_alloc(const struct device *dev,
625 * @param[in] dev Pointer to device struct of the driver instance
630 int udc_ep_buf_free(const struct device *dev, struct net_buf *const buf);