SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
AXP517TcpcRegs.hpp
Go to the documentation of this file.
1
32#pragma once
33#include <stdint.h>
34
38namespace axp517::tcpc
39{
40static constexpr uint8_t TCPC_VENDOR_ID = 0xA0;
41static constexpr uint16_t VENDOR_ID = 0x1F3A;
42
45static constexpr uint8_t USBTYPEC_REV_L = 0xA6;
46static constexpr uint8_t USBTYPEC_REV_H = 0xA7;
47static constexpr uint8_t USBPD_VER = 0xA8;
48static constexpr uint8_t USBPD_REV = 0xA9;
49static constexpr uint8_t PD_INTERFACE_VER = 0xAA;
50static constexpr uint8_t PD_INTERFACE_REV = 0xAB;
52
55static constexpr uint8_t PD_ALERTL = 0xB0;
56static constexpr uint8_t PD_ALERTH = 0xB1;
57static constexpr uint8_t PD_ALERT_MASKL = 0xB2;
58static constexpr uint8_t PD_ALERT_MASKH = 0xB3;
59static constexpr uint8_t POWER_STATUS_MASK = 0xB4;
60static constexpr uint8_t FAULT_STATUS_MASK = 0xB5;
62
65static constexpr uint8_t TCPC_CONTROL = 0xB9;
66static constexpr uint8_t ROLE_CONTROL = 0xBA;
67static constexpr uint8_t FAULT_CONTROL = 0xBB;
68static constexpr uint8_t POWER_CONTROL = 0xBC;
69static constexpr uint8_t CC_STATUS = 0xBD;
70static constexpr uint8_t POWER_STATUS = 0xBE;
71static constexpr uint8_t FAULT_STATUS = 0xBF;
73
76static constexpr uint8_t COMMAND = 0xC3;
77static constexpr uint8_t DEVICE_CAPS_1L = 0xC4;
78static constexpr uint8_t DEVICE_CAPS_1H = 0xC5;
79static constexpr uint8_t DEVICE_CAPS_2L = 0xC6;
80static constexpr uint8_t DEVICE_CAPS_2H = 0xC7;
82
85static constexpr uint8_t MESSAGE_HEADER_INFO = 0xCE;
86static constexpr uint8_t RECEIVE_DETECT = 0xCF;
88
91static constexpr uint8_t VBUS_VOLTAGE_L = 0xD0;
92static constexpr uint8_t VBUS_VOLTAGE_H = 0xD1;
93static constexpr uint8_t VBUS_SINK_DISCONNECT_THRESH = 0xD2;
94static constexpr uint8_t VBUS_STOP_DISCHARGE_THRESH = 0xD4;
95static constexpr uint8_t VBUS_VOLTAGE_ALARM_HI_CFG = 0xD6;
96static constexpr uint8_t VBUS_VOLTAGE_ALARM_LO_CFG = 0xD8;
98
101static constexpr uint8_t RX_BUFFER_FIFO = 0xDA;
102static constexpr uint8_t TX_BUF_TRANSMIT = 0xDB;
103static constexpr uint8_t TX_BUFFER_FIFO = 0xDC;
104
105static constexpr uint8_t RX_BYTE_CNT = 0xDA;
106static constexpr uint8_t TX_BYTE_CNT = 0xDC;
107static constexpr uint8_t TX_HDR = 0x52;
108static constexpr uint8_t TX_DATA = 0x54;
109static constexpr uint8_t RX_HDR = 0x32;
110static constexpr uint8_t RX_DATA = 0x34;
112
115static constexpr uint8_t EXTENDED_STATUS = 0xC0;
116static constexpr uint8_t ALERT_EXTENDED = 0xC1;
118
120static constexpr uint8_t PD_STATE = 0xE3;
121
123static constexpr uint8_t AWAKE_EN = 0xE0;
124
126static constexpr uint8_t CC_CONNECTION_STATUS = 0xE6;
127
129static constexpr uint8_t CC_GENERAL_CONTROL = 0xE8;
130static constexpr uint8_t SW_RESET = 0x20;
131
133static constexpr uint8_t TWI_ADDR_STATIC = 0xEB;
134
136static constexpr uint8_t CLK_EN = 0x0B;
137
139static constexpr uint8_t MODULE_EN = 0x19;
140
144namespace alert
145{
146static constexpr uint16_t CC_STATUS = (1u << 0);
147static constexpr uint16_t POWER_STATUS = (1u << 1);
148static constexpr uint16_t RX_STATUS = (1u << 2);
149static constexpr uint16_t RX_HARD_RST = (1u << 3);
150static constexpr uint16_t TX_FAILED = (1u << 4);
151static constexpr uint16_t TX_DISCARDED = (1u << 5);
152static constexpr uint16_t TX_SUCCESS = (1u << 6);
153static constexpr uint16_t V_ALARM_HI = (1u << 7);
154static constexpr uint16_t V_ALARM_LO = (1u << 8);
155static constexpr uint16_t FAULT = (1u << 9);
156static constexpr uint16_t RX_BUF_OVF = (1u << 10);
157static constexpr uint16_t VBUS_DISCNCT = (1u << 11);
158static constexpr uint16_t EXTENDED_STATUS = (1u << 13);
159static constexpr uint16_t EXTND = (1u << 14);
160} // namespace alert
161
165namespace cmd
166{
167static constexpr uint8_t WAKE_I2C = 0x11;
168static constexpr uint8_t DISABLE_VBUS_DETECT = 0x22;
169static constexpr uint8_t ENABLE_VBUS_DETECT = 0x33;
170static constexpr uint8_t DISABLE_SINK_VBUS = 0x44;
171static constexpr uint8_t SINK_VBUS = 0x55;
172static constexpr uint8_t DISABLE_SRC_VBUS = 0x66;
173static constexpr uint8_t SRC_VBUS_DEFAULT = 0x77;
174static constexpr uint8_t SRC_VBUS_HIGH = 0x88;
175static constexpr uint8_t LOOK4CONNECTION = 0x99;
176static constexpr uint8_t RXONEMORE = 0xAA;
177static constexpr uint8_t I2C_IDLE = 0xFF;
178} // namespace cmd
179
180} // namespace axp517::tcpc
AXP517 TCPC register addresses, alert bits, and command constants.