summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-06-12 14:57:50 +0700
committerhathach <[email protected]>2023-06-12 14:57:50 +0700
commitc28503060c0c3cb09d8e2ce63d1b0009affbdf72 (patch)
treecec78bebefd0310de1498eb864a8c67bc2e82d48 /src/common
parentdebde4cc97cb7c6c13d62d0e3bbe195c80bfec9f (diff)
ad pd_types.h
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_types.h96
1 files changed, 1 insertions, 95 deletions
diff --git a/src/common/tusb_types.h b/src/common/tusb_types.h
index cad633ee4..fab680989 100644
--- a/src/common/tusb_types.h
+++ b/src/common/tusb_types.h
@@ -480,6 +480,7 @@ typedef struct TU_ATTR_PACKED
//--------------------------------------------------------------------+
//
//--------------------------------------------------------------------+
+
typedef struct TU_ATTR_PACKED{
union {
struct TU_ATTR_PACKED {
@@ -499,101 +500,6 @@ typedef struct TU_ATTR_PACKED{
TU_VERIFY_STATIC( sizeof(tusb_control_request_t) == 8, "size is not correct");
-//--------------------------------------------------------------------+
-// TYPE-C
-//--------------------------------------------------------------------+
-
-typedef enum {
- TUSB_TYPEC_PORT_SRC,
- TUSB_TYPEC_PORT_SNK,
- TUSB_TYPEC_PORT_DRP
-} tusb_typec_port_type_t;
-
-typedef enum {
- TUSB_PD_CTRL_RESERVED = 0, // 0b00000: 0
- TUSB_PD_CTRL_GOOD_CRC, // 0b00001: 1
- TUSB_PD_CTRL_GO_TO_MIN, // 0b00010: 2
- TUSB_PD_CTRL_ACCEPT, // 0b00011: 3
- TUSB_PD_CTRL_REJECT, // 0b00100: 4
- TUSB_PD_CTRL_PING, // 0b00101: 5
- TUSB_PD_CTRL_PS_RDY, // 0b00110: 6
- TUSB_PD_CTRL_GET_SOURCE_CAP, // 0b00111: 7
- TUSB_PD_CTRL_GET_SINK_CAP, // 0b01000: 8
- TUSB_PD_CTRL_DR_SWAP, // 0b01001: 9
- TUSB_PD_CTRL_PR_SWAP, // 0b01010: 10
- TUSB_PD_CTRL_VCONN_SWAP, // 0b01011: 11
- TUSB_PD_CTRL_WAIT, // 0b01100: 12
- TUSB_PD_CTRL_SOFT_RESET, // 0b01101: 13
- TUSB_PD_CTRL_DATA_RESET, // 0b01110: 14
- TUSB_PD_CTRL_DATA_RESET_COMPLETE, // 0b01111: 15
- TUSB_PD_CTRL_NOT_SUPPORTED, // 0b10000: 16
- TUSB_PD_CTRL_GET_SOURCE_CAP_EXTENDED, // 0b10001: 17
- TUSB_PD_CTRL_GET_STATUS, // 0b10010: 18
- TUSB_PD_CTRL_FR_SWAP, // 0b10011: 19
- TUSB_PD_CTRL_GET_PPS_STATUS, // 0b10100: 20
- TUSB_PD_CTRL_GET_COUNTRY_CODES, // 0b10101: 21
- TUSB_PD_CTRL_GET_SINK_CAP_EXTENDED, // 0b10110: 22
- TUSB_PD_CTRL_GET_SOURCE_INFO, // 0b10111: 23
- TUSB_PD_CTRL_REVISION, // 0b11000: 24
-} tusb_pd_ctrl_type_t;
-
-typedef enum {
- TUSB_PD_DATA_RESERVED = 0, // 0b00000: 0
- TUSB_PD_DATA_SOURCE_CAP, // 0b00001: 1
- TUSB_PD_DATA_REQUEST, // 0b00010: 2
- TUSB_PD_DATA_BIST, // 0b00011: 3
- TUSB_PD_DATA_SINK_CAP, // 0b00100: 4
- TUSB_PD_DATA_BATTERY_STATUS, // 0b00101: 5
- TUSB_PD_DATA_ALERT, // 0b00110: 6
- TUSB_PD_DATA_GET_COUNTRY_INFO, // 0b00111: 7
- TUSB_PD_DATA_ENTER_USB, // 0b01000: 8
- TUSB_PD_DATA_EPR_REQUEST, // 0b01001: 9
- TUSB_PD_DATA_EPR_MODE, // 0b01010: 10
- TUSB_PD_DATA_SRC_INFO, // 0b01011: 11
- TUSB_PD_DATA_REVISION, // 0b01100: 12
- TUSB_PD_DATA_RESERVED_13, // 0b01101: 13
- TUSB_PD_DATA_RESERVED_14, // 0b01110: 14
- TUSB_PD_DATA_VENDOR_DEFINED, // 0b01111: 15
-} tusb_pd_data_type_t;
-
-enum {
- TUSB_PD_REV10 = 0x0,
- TUSB_PD_REV20 = 0x1,
- TUSB_PD_REV30 = 0x2,
-};
-
-enum {
- TUSB_PD_DATA_ROLE_UFP = 0x0,
- TUSB_PD_DATA_ROLE_DFP = 0x1,
-};
-
-enum {
- TUSB_PD_POWER_ROLE_SINK = 0x0,
- TUSB_PD_POWER_ROLE_SOURCE = 0x1,
-};
-
-typedef struct TU_ATTR_PACKED {
- uint16_t msg_type : 5; // [0:4]
- uint16_t data_role : 1; // [5] SOP only: 0 UFP, 1 DFP
- uint16_t specs_rev : 2; // [6:7]
- uint16_t power_role : 1; // [8] SOP only: 0 Sink, 1 Source
- uint16_t msg_id : 3; // [9:11]
- uint16_t n_data_obj : 3; // [12:14]
- uint16_t extended : 1; // [15]
-} tusb_pd_header_t;
-
-TU_VERIFY_STATIC( sizeof(tusb_pd_header_t) == 2, "size is not correct");
-
-typedef struct TU_ATTR_PACKED {
- uint16_t data_size : 9; // [0:8]
- uint16_t reserved : 1; // [9]
- uint16_t request_chunk : 1; // [10]
- uint16_t chunk_number : 4; // [11:14]
- uint16_t chunked : 1; // [15]
-} tusb_pd_header_extended_t;
-
-TU_VERIFY_STATIC( sizeof(tusb_pd_header_extended_t) == 2, "size is not correct");
-
TU_ATTR_PACKED_END // End of all packed definitions
TU_ATTR_BIT_FIELD_ORDER_END