Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
USB device core API

Data Structures

struct  usbd_msg
 USB device message. More...
 

Typedefs

typedef void(* usbd_msg_cb_t) (const struct usbd_msg *const msg)
 Callback type definition for USB device message delivery.
 

Enumerations

enum  usbd_msg_type {
  USBD_MSG_VBUS_READY , USBD_MSG_VBUS_REMOVED , USBD_MSG_RESUME , USBD_MSG_SUSPEND ,
  USBD_MSG_RESET , USBD_MSG_UDC_ERROR , USBD_MSG_STACK_ERROR , USBD_MSG_CDC_ACM_LINE_CODING ,
  USBD_MSG_CDC_ACM_CONTROL_LINE_STATE
}
 USB device support message types. More...
 

Functions

static const char * usbd_msg_type_string (const enum usbd_msg_type type)
 Returns the message type as a constant string.
 

Variables

static const char *const usbd_msg_type_list []
 
Number of entries in usbd_msg_type_list is not equal to USBD_MSG_MAX_NUMBER
 Maximum number of message types.
 

Detailed Description

Typedef Documentation

◆ usbd_msg_cb_t

typedef void(* usbd_msg_cb_t) (const struct usbd_msg *const msg)

#include <zephyr/usb/usbd_msg.h>

Callback type definition for USB device message delivery.

The implementation uses the system workqueue, and a callback provided and registered by the application. The application callback is called in the context of the system workqueue. Notification messages are stored in a queue and delivered to the callback in sequence.

Parameters
[in]msgPointer to USB device message

Enumeration Type Documentation

◆ usbd_msg_type

#include <zephyr/usb/usbd_msg.h>

USB device support message types.

The first set of message types map to event types from the UDC driver API.

Enumerator
USBD_MSG_VBUS_READY 

VBUS ready message (optional)

USBD_MSG_VBUS_REMOVED 

VBUS removed message (optional)

USBD_MSG_RESUME 

Device resume message.

USBD_MSG_SUSPEND 

Device suspended message.

USBD_MSG_RESET 

Bus reset detected.

USBD_MSG_UDC_ERROR 

Non-correctable UDC error message

USBD_MSG_STACK_ERROR 

Unrecoverable device stack error message

USBD_MSG_CDC_ACM_LINE_CODING 

CDC ACM Line Coding update.

USBD_MSG_CDC_ACM_CONTROL_LINE_STATE 

CDC ACM Line State update.

Function Documentation

◆ usbd_msg_type_string()

static const char * usbd_msg_type_string ( const enum usbd_msg_type  type)
inlinestatic

#include <zephyr/usb/usbd_msg.h>

Returns the message type as a constant string.

Parameters
[in]typeUSBD message type
Returns
Message type as a constant string

Variable Documentation

◆ USBD_MSG_MAX_NUMBER

USBD_MSG_MAX_NUMBER

#include <zephyr/usb/usbd_msg.h>

Maximum number of message types.

◆ usbd_msg_type_list

const char* const usbd_msg_type_list[]
static

#include <zephyr/usb/usbd_msg.h>

Initial value:
= {
"VBUS ready",
"VBUS removed",
"Device resumed",
"Device suspended",
"Bus reset",
"Controller error",
"Stack error",
"CDC ACM line coding",
"CDC ACM control line state",
}