20 #define FS_C_HUB_LOCAL_POWER 0 21 #define FS_C_HUB_OVER_CURRENT 1 23 #define FS_PORT_CONNECTION 0 24 #define FS_PORT_ENABLE 1 25 #define FS_PORT_SUSPEND 2 26 #define FS_PORT_OVER_CURRENT 3 27 #define FS_PORT_RESET 4 28 #define FS_PORT_POWER 8 29 #define FS_C_PORT_CONNECTION 16 30 #define FS_C_PORT_ENABLE 17 31 #define FS_C_PORT_SUSPEND 18 32 #define FS_C_PORT_OVER_CURRENT 19 33 #define FS_C_PORT_RESET 20 38 #define HUB_S_LOCAL_POWER (1UL << 0) 39 #define HUB_S_OVERCURRENT (1UL << 1) 41 #define HUB_C_LOCAL_POWER (1UL << 0) 42 #define HUB_C_OVERCURRENT (1UL << 1) 44 #define PORT_S_CONNECTION (1UL << 0) 45 #define PORT_S_ENABLE (1UL << 1) 46 #define PORT_S_SUSPEND (1UL << 2) 47 #define PORT_S_OVERCURRENT (1UL << 3) 48 #define PORT_S_RESET (1UL << 4) 49 #define PORT_S_PORT_POWER (1UL << 8) 50 #define PORT_S_LOW_SPEED (1UL << 9) 51 #define PORT_S_HIGH_SPEED (1UL << 10) 52 #define PORT_S_TEST (1UL << 11) 53 #define PORT_S_INDICATOR (1UL << 12) 55 #define PORT_C_CONNECTION (1UL << 0) 56 #define PORT_C_ENABLE (1UL << 1) 57 #define PORT_C_SUSPEND (1UL << 2) 58 #define PORT_C_OVERCURRENT (1UL << 3) 59 #define PORT_C_RESET (1UL << 4) 68 __packed uint8_t bDescLength;
69 __packed uint8_t bDescriptorType;
70 __packed uint8_t bNbrPorts;
71 __packed uint16_t wHubCharacteristics;
72 __packed uint8_t bPwrOn2PwrGood;
73 __packed uint8_t bHubContrCurrent;
74 __packed uint8_t bDeviceRemovble;
75 __packed uint8_t PortPwrCtrlMask[16];
81 uint8_t bDescriptorType;
83 uint16_t wHubCharacteristics;
84 uint8_t bPwrOn2PwrGood;
85 uint8_t bHubContrCurrent;
86 uint8_t bDeviceRemovble;
87 uint8_t PortPwrCtrlMask[16];
95 #define HUB_CHAR_LPSM 0x0003 96 #define HUB_CHAR_COMPOUND 0x0004 97 #define HUB_CHAR_OCPM 0x0018 98 #define HUB_CHAR_TTTT 0x0060 99 #define HUB_CHAR_PORTIND 0x0080 102 #define HUB_LED_AUTO 0 103 #define HUB_LED_AMBER 1 104 #define HUB_LED_GREEN 2 105 #define HUB_LED_OFF 3 111 #define HUB_DEBOUNCE_TIME 500 112 #define PORT_RESET_RETRY 3 113 #define PORT_RESET_TIME_MS 50 114 #define PORT_RESET_RETRY_INC_MS 250 117 #define HUB_STATUS_MAX_BYTE 2 122 typedef struct hub_dev_t
126 uint8_t buff[HUB_STATUS_MAX_BYTE];
129 uint8_t bPwrOn2PwrGood;
130 char pos_id[MAX_HUB_DEVICE+1];
131 int (*port_reset)(
struct hub_dev_t *hub,
int port);
void *__dso_handle __attribute__((weak))