Zephyr API Documentation 4.5.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
usb_hub.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Emerson Electric Co.
3 * SPDX-FileCopyrightText: Copyright 2026 NXP
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
11
12#ifndef ZEPHYR_INCLUDE_USB_CLASS_USB_HUB_H_
13#define ZEPHYR_INCLUDE_USB_CLASS_USB_HUB_H_
14
20#define USB_HUB_CLASS_CODE 0x09
22#define USB_HUB_SUBCLASS_CODE 0x00
25#define USB_HUB_PROTOCOL_FS 0x00
27#define USB_HUB_PROTOCOL_HS_SINGLE_TT 0x01
29#define USB_HUB_PROTOCOL_HS_MULTI_TT 0x02
31#define USB_HUB_PROTOCOL_CODE USB_HUB_PROTOCOL_HS_SINGLE_TT
33
39#define USB_HUB_DESCRIPTOR_TYPE 0x29
41
49#define USB_HCREQ_GET_STATUS 0x00
51#define USB_HCREQ_CLEAR_FEATURE 0x01
53#define USB_HCREQ_SET_FEATURE 0x03
55#define USB_HCREQ_GET_DESCRIPTOR 0x06
57#define USB_HCREQ_SET_DESCRIPTOR 0x07
59#define USB_HCREQ_CLEAR_TT_BUFFER 0x08
61#define USB_HCREQ_RESET_TT 0x09
63#define USB_HCREQ_GET_TT_STATE 0x0A
65#define USB_HCREQ_STOP_TT 0x0B
67
75#define USB_HCFS_C_HUB_LOCAL_POWER 0x00
77#define USB_HCFS_C_HUB_OVER_CURRENT 0x01
79#define USB_HCFS_PORT_CONNECTION 0x00
81#define USB_HCFS_PORT_ENABLE 0x01
83#define USB_HCFS_PORT_SUSPEND 0x02
85#define USB_HCFS_PORT_OVER_CURRENT 0x03
87#define USB_HCFS_PORT_RESET 0x04
89#define USB_HCFS_PORT_POWER 0x08
91#define USB_HCFS_PORT_LOW_SPEED 0x09
93#define USB_HCFS_C_PORT_CONNECTION 0x10
95#define USB_HCFS_C_PORT_ENABLE 0x11
97#define USB_HCFS_C_PORT_SUSPEND 0x12
99#define USB_HCFS_C_PORT_OVER_CURRENT 0x13
101#define USB_HCFS_C_PORT_RESET 0x14
103#define USB_HCFS_PORT_TEST 0x15
105#define USB_HCFS_PORT_INDICATOR 0x16
107
115#define USB_HUB_STATUS_LOCAL_POWER BIT(0)
117#define USB_HUB_STATUS_OVER_CURRENT BIT(1)
119
127#define USB_HUB_CHANGE_LOCAL_POWER BIT(0)
129#define USB_HUB_CHANGE_OVER_CURRENT BIT(1)
131
139#define USB_HUB_PORT_STATUS_CONNECTION BIT(0)
141#define USB_HUB_PORT_STATUS_ENABLE BIT(1)
143#define USB_HUB_PORT_STATUS_SUSPEND BIT(2)
145#define USB_HUB_PORT_STATUS_OVER_CURRENT BIT(3)
147#define USB_HUB_PORT_STATUS_RESET BIT(4)
149#define USB_HUB_PORT_STATUS_POWER BIT(8)
151#define USB_HUB_PORT_STATUS_LOW_SPEED BIT(9)
153#define USB_HUB_PORT_STATUS_HIGH_SPEED BIT(10)
155#define USB_HUB_PORT_STATUS_TEST BIT(11)
157#define USB_HUB_PORT_STATUS_INDICATOR BIT(12)
159
167#define USB_HUB_PORT_CHANGE_CONNECTION BIT(0)
169#define USB_HUB_PORT_CHANGE_ENABLE BIT(1)
171#define USB_HUB_PORT_CHANGE_SUSPEND BIT(2)
173#define USB_HUB_PORT_CHANGE_OVER_CURRENT BIT(3)
175#define USB_HUB_PORT_CHANGE_RESET BIT(4)
177
182#define USB_HUB_DESC_BUF_SIZE 71
183
191#define USB_HUB_GET_THINK_TIME(wHubCharacteristics) \
192 (((((wHubCharacteristics) & 0x0060U) >> 5) + 1) << 3)
193
215
225
235
236#endif /* ZEPHYR_INCLUDE_USB_CLASS_USB_HUB_H_ */
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
USB Hub Descriptor.
Definition usb_hub.h:197
uint16_t wHubCharacteristics
Hub characteristics bitmap.
Definition usb_hub.h:205
uint8_t bDescriptorType
Descriptor type.
Definition usb_hub.h:201
uint8_t bHubContrCurrent
Maximum current requirements of the Hub Controller (in mA).
Definition usb_hub.h:209
uint8_t bPwrOn2PwrGood
Time from power-on to power-good (in 2ms intervals).
Definition usb_hub.h:207
uint8_t bNbrPorts
Number of downstream facing ports.
Definition usb_hub.h:203
uint8_t bDescLength
Descriptor length.
Definition usb_hub.h:199
USB Hub Port Status.
Definition usb_hub.h:229
uint16_t wPortChange
Port status change bitmap.
Definition usb_hub.h:233
uint16_t wPortStatus
Port status bitmap.
Definition usb_hub.h:231
USB Hub Status.
Definition usb_hub.h:219
uint16_t wHubChange
Hub status change bitmap.
Definition usb_hub.h:223
uint16_t wHubStatus
Hub status bitmap.
Definition usb_hub.h:221