2.25. usb
— Universal Serial Bus¶
Source code: src/drivers/usb.h, src/drivers/usb.c
Defines
-
REQUEST_TYPE_DATA_MASK
¶
-
REQUEST_TYPE_DATA_DIRECTION_HOST_TO_DEVICE
¶
-
REQUEST_TYPE_DATA_DIRECTION_DEVICE_TO_HOST
¶
-
REQUEST_TYPE_TYPE_MASK
¶
-
REQUEST_TYPE_TYPE_STANDARD
¶
-
REQUEST_TYPE_TYPE_CLASS
¶
-
REQUEST_TYPE_TYPE_VENDOR
¶
-
REQUEST_TYPE_RECIPIENT_MASK
¶
-
REQUEST_TYPE_RECIPIENT_DEVICE
¶
-
REQUEST_TYPE_RECIPIENT_INTERFACE
¶
-
REQUEST_TYPE_RECIPIENT_ENDPOINT
¶
-
REQUEST_TYPE_RECIPIENT_OTHER
¶
-
REQUEST_GET_STATUS
¶
-
REQUEST_SET_ADDRESS
¶
-
REQUEST_GET_DESCRIPTOR
¶
-
REQUEST_SET_CONFIGURATION
¶
-
DESCRIPTOR_TYPE_DEVICE
¶
-
DESCRIPTOR_TYPE_CONFIGURATION
¶
-
DESCRIPTOR_TYPE_STRING
¶
-
DESCRIPTOR_TYPE_INTERFACE
¶
-
DESCRIPTOR_TYPE_ENDPOINT
¶
-
DESCRIPTOR_TYPE_INTERFACE_ASSOCIATION
¶
-
DESCRIPTOR_TYPE_RPIPE
¶
-
DESCRIPTOR_TYPE_CDC
¶
-
USB_CLASS_USE_INTERFACE
¶
-
USB_CLASS_AUDIO
¶
-
USB_CLASS_CDC_CONTROL
¶
-
USB_CLASS_HID
¶
-
USB_CLASS_PHYSICAL
¶
-
USB_CLASS_IMAGE
¶
-
USB_CLASS_PRINTER
¶
-
USB_CLASS_MASS_STORAGE
¶
-
USB_CLASS_HUB
¶
-
USB_CLASS_CDC_DATA
¶
-
USB_CLASS_SMART_CARD
¶
-
USB_CLASS_CONTENT_SECURITY
¶
-
USB_CLASS_VIDEO
¶
-
USB_CLASS_PERSONAL_HEALTHCARE
¶
-
USB_CLASS_AUDIO_VIDEO_DEVICES
¶
-
USB_CLASS_BILLBOARD_DEVICE_CLASS
¶
-
USB_CLASS_DIAGNOSTIC_DEVICE
¶
-
USB_CLASS_WIRELESS_CONTROLLER
¶
-
USB_CLASS_MISCELLANEOUS
¶
-
USB_CLASS_APPLICATION_SPECIFIC
¶
-
USB_CLASS_VENDOR_SPECIFIC
¶
-
ENDPOINT_ENDPOINT_ADDRESS_DIRECTION
(address)¶
-
ENDPOINT_ENDPOINT_ADDRESS_NUMBER
(address)¶
-
ENDPOINT_ATTRIBUTES_USAGE_TYPE
(attributes)¶
-
ENDPOINT_ATTRIBUTES_SYNCHRONISATION_TYPE
(attributes)¶
-
ENDPOINT_ATTRIBUTES_TRANSFER_TYPE
(attributes)¶
-
ENDPOINT_ATTRIBUTES_TRANSFER_TYPE_CONTROL
¶
-
ENDPOINT_ATTRIBUTES_TRANSFER_TYPE_ISOCHRONOUS
¶
-
ENDPOINT_ATTRIBUTES_TRANSFER_TYPE_BULK
¶
-
ENDPOINT_ATTRIBUTES_TRANSFER_TYPE_INTERRUPT
¶
-
CONFIGURATION_ATTRIBUTES_BUS_POWERED
¶
-
USB_CDC_LINE_CODING
¶
-
USB_CDC_CONTROL_LINE_STATE
¶
-
USB_CDC_SEND_BREAK
¶
-
USB_MESSAGE_TYPE_ADD
¶
-
USB_MESSAGE_TYPE_REMOVE
¶
Functions
-
int
usb_format_descriptors
(void *out_p, uint8_t *buf_p, size_t size)¶ Format the descriptors and write them to given channel.
- Return
- zero(0) or negative error code.
- Parameters
out_p
-Output channel.
buf_p
-Pointer to the descriptors to format.
size
-Number of bytes in the descriptors buffer.
-
struct usb_descriptor_configuration_t *
usb_desc_get_configuration
(uint8_t *desc_p, size_t size, int configuration)¶ Get the configuration descriptor for given configuration index.
- Return
- Configuration or NULL on failure.
- Parameters
buf_p
-Pointer to the descriptors.
size
-Number of bytes in the descriptors buffer.
configuration
-Configuration to find.
-
struct usb_descriptor_interface_t *
usb_desc_get_interface
(uint8_t *desc_p, size_t size, int configuration, int interface)¶ Get the interface descriptor for given configuration and interface index.
- Return
- Interface or NULL on failure.
- Parameters
buf_p
-Pointer to the descriptors.
size
-Number of bytes in the descriptors buffer.
configuration
-Configuration to find.
interface
-Interface to find.
-
struct usb_descriptor_endpoint_t *
usb_desc_get_endpoint
(uint8_t *desc_p, size_t size, int configuration, int interface, int endpoint)¶ Get the endpoint descriptor for given configuration, interface and endpoint index.
- Return
- Endpoint or NULL on failure.
- Parameters
buf_p
-Pointer to the descriptors.
size
-Number of bytes in the descriptors buffer.
configuration
-Configuration to find.
interface
-Interface to find.
endpoint
-Endpoint to find.
-
int
usb_desc_get_class
(uint8_t *buf_p, size_t size, int configuration, int interface)¶ Get the interface class.
- Return
- Parameters
buf_p
-Pointer to the descriptors.
size
-Number of bytes in the descriptors buffer.
configuration
-Configuration to find.
interface
-Interface to find.
Variables
-
struct usb_device_t
usb_device
[USB_DEVICE_MAX]¶
-
struct
usb_setup_t
¶ Public Members
-
uint8_t
request_type
¶
-
uint8_t
request
¶
-
uint16_t
feature_selector
¶
-
uint16_t
zero_interface_endpoint
¶
-
struct usb_setup_t::@14::@15 usb_setup_t::clear_feature
-
uint16_t
zero0
¶
-
uint16_t
zero1
¶
-
struct usb_setup_t::@14::@16 usb_setup_t::get_configuration
-
uint8_t
descriptor_index
¶
-
uint8_t
descriptor_type
¶
-
uint16_t
language_id
¶
-
struct usb_setup_t::@14::@17 usb_setup_t::get_descriptor
-
uint16_t
device_address
¶
-
uint16_t
zero
¶
-
struct usb_setup_t::@14::@18 usb_setup_t::set_address
-
uint16_t
configuration_value
¶
-
struct usb_setup_t::@14::@19 usb_setup_t::set_configuration
-
uint16_t
value
¶
-
uint16_t
index
¶
-
struct usb_setup_t::@14::@20 usb_setup_t::base
-
union usb_setup_t::@14 usb_setup_t::u
-
uint16_t
length
¶
-
uint8_t
-
struct
usb_descriptor_header_t
¶
-
struct
usb_descriptor_device_t
¶ Public Members
-
uint8_t
length
¶
-
uint8_t
descriptor_type
¶
-
uint16_t
bcd_usb
¶
-
uint8_t
device_class
¶
-
uint8_t
device_subclass
¶
-
uint8_t
device_protocol
¶
-
uint8_t
max_packet_size_0
¶
-
uint16_t
id_vendor
¶
-
uint16_t
id_product
¶
-
uint16_t
bcd_device
¶
-
uint8_t
manufacturer
¶
-
uint8_t
product
¶
-
uint8_t
serial_number
¶
-
uint8_t
num_configurations
¶
-
uint8_t
-
struct
usb_descriptor_configuration_t
¶
-
struct
usb_descriptor_interface_t
¶
-
struct
usb_descriptor_endpoint_t
¶
-
struct
usb_descriptor_string_t
¶
-
struct
usb_descriptor_interface_association_t
¶
-
struct
usb_descriptor_cdc_header_t
¶
-
struct
usb_descriptor_cdc_acm_t
¶
-
struct
usb_descriptor_cdc_union_t
¶
-
struct
usb_descriptor_cdc_call_management_t
¶
-
union
usb_descriptor_t
¶ Public Members
-
struct usb_descriptor_header_t
header
¶
-
struct usb_descriptor_device_t
device
¶
-
struct usb_descriptor_configuration_t
configuration
¶
-
struct usb_descriptor_interface_t
interface
¶
-
struct usb_descriptor_endpoint_t
endpoint
¶
-
struct usb_descriptor_string_t
string
¶
-
struct usb_descriptor_header_t
-
struct
usb_cdc_line_info_t
¶
-
struct
usb_message_add_t
¶
-
union
usb_message_t
¶