142 bool sendRaw(uint8_t msgType,
const uint8_t *payload, uint8_t payloadLen);
176 uint16_t buildHeader(uint8_t msgType, uint8_t objCnt);
180 HeaderInfoCfg _cfg{};
USB-PD message builder and FIFO helper for AXP517.
bool sendControl(ControlMsg msgType)
Send a USB-PD control message.
void resetMsgId()
Reset the local USB-PD message ID counter to zero.
PowerRole
USB-PD power role encoded in the message header.
@ Sink
Sink/UFP consumes VBUS.
@ Source
Source/DFP supplies VBUS.
bool sendRaw(uint8_t msgType, const uint8_t *payload, uint8_t payloadLen)
Send a raw USB-PD data message.
bool tryReceive(AXP517Tcpc::RxFifoMsg &out)
Try to read one pending RX FIFO message.
AXP517Pd(AXP517Tcpc &tcpc)
Construct a PD helper that uses an initialized TCPC instance.
bool handleFaultOnce(uint8_t &faultStatus)
Read and clear one TCPC fault status sample.
bool setReceiveDetectSop(bool enable)
Enable or disable SOP receive detection.
bool configureHeaderInfo(const HeaderInfoCfg &cfg)
Configure local message-header defaults.
DataRole
USB Type-C data role encoded in the message header.
@ UFP
Upstream Facing Port.
@ DFP
Downstream Facing Port.
SpecRev
USB-PD specification revision encoded in the message header.
ControlMsg
Supported USB-PD control message type values.
@ SoftReset
Soft Reset control message.
@ PS_RDY
Power Supply Ready control message.
@ GetSourceCap
Get Source Capabilities control message.
@ Accept
Accept control message.
bool sendHardReset()
Send a Hard Reset ordered set.
bool sendGetSourceCap()
Send a Get_Source_Cap control message.
AXP517 Type-C Port Controller helper.