ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::fusb302b Namespace Reference

Data Structures

struct  ConnectForwarder
 Triggers when a source is attached, including after recovering from a communication error. More...
 
struct  DisconnectForwarder
 Triggers when the source is removed, or is no longer known to be attached because communication failed. More...
 
struct  ErrorForwarder
 Triggers when communication with the chip fails. More...
 
class  FUSB302B
 FUSB302B USB Type-C / Power Delivery sink controller. More...
 
struct  PackedContract
 A contract packed into one word so it can be shared between tasks as an atomic. More...
 
struct  PdContract
 
struct  PdMsg
 
class  PowerDelivery
 USB-PD sink protocol logic, independent of the PHY chip. More...
 
struct  PowerReadyForwarder
 Triggers when negotiation is finished: a new PD contract is in place, or the source does not speak PD. More...
 

Enumerations

enum  PdSpecRevision : uint8_t { PD_SPEC_REV_1 = 0 , PD_SPEC_REV_2 = 1 , PD_SPEC_REV_3 = 2 }
 
enum  PdDataMsgType : uint8_t { PD_DATA_SOURCE_CAP = 0x01 , PD_DATA_REQUEST = 0x02 , PD_DATA_SINK_CAP = 0x04 }
 
enum  PdControlMsgType : uint8_t {
  PD_CNTRL_GOODCRC = 0x01 , PD_CNTRL_ACCEPT = 0x03 , PD_CNTRL_REJECT = 0x04 , PD_CNTRL_PING = 0x05 ,
  PD_CNTRL_PS_RDY = 0x06 , PD_CNTRL_GET_SOURCE_CAP = 0x07 , PD_CNTRL_GET_SINK_CAP = 0x08 , PD_CNTRL_WAIT = 0x0C ,
  PD_CNTRL_SOFT_RESET = 0x0D , PD_CNTRL_NOT_SUPPORTED = 0x10
}
 
enum  PdPdoType : uint8_t { PD_PDO_TYPE_FIXED_SUPPLY = 0 , PD_PDO_TYPE_BATTERY = 1 , PD_PDO_TYPE_VARIABLE_SUPPLY = 2 , PD_PDO_TYPE_AUGMENTED = 3 }
 
enum class  PdState : uint8_t {
  PD_STATE_DISCONNECTED , PD_STATE_PD_TIMEOUT , PD_STATE_DEFAULT_CONTRACT , PD_STATE_TRANSITION ,
  PD_STATE_EXPLICIT_CONTRACT , PD_STATE_ERROR
}
 

Functions

 ESPHOME_LOG_TAG (TAG, "fusb302b")
 
 ESPHOME_LOG_TAG (TAG, "fusb302b.pd")
 
bool is_connected_state (PdState state)
 Returns true for the states in which a source is attached and supplying power.
 

Enumeration Type Documentation

◆ PdControlMsgType

Enumerator
PD_CNTRL_GOODCRC 
PD_CNTRL_ACCEPT 
PD_CNTRL_REJECT 
PD_CNTRL_PING 
PD_CNTRL_PS_RDY 
PD_CNTRL_GET_SOURCE_CAP 
PD_CNTRL_GET_SINK_CAP 
PD_CNTRL_WAIT 
PD_CNTRL_SOFT_RESET 
PD_CNTRL_NOT_SUPPORTED 

Definition at line 27 of file pd.h.

◆ PdDataMsgType

Enumerator
PD_DATA_SOURCE_CAP 
PD_DATA_REQUEST 
PD_DATA_SINK_CAP 

Definition at line 21 of file pd.h.

◆ PdPdoType

Enumerator
PD_PDO_TYPE_FIXED_SUPPLY 
PD_PDO_TYPE_BATTERY 
PD_PDO_TYPE_VARIABLE_SUPPLY 
PD_PDO_TYPE_AUGMENTED 

Definition at line 40 of file pd.h.

◆ PdSpecRevision

Enumerator
PD_SPEC_REV_1 
PD_SPEC_REV_2 
PD_SPEC_REV_3 

Definition at line 15 of file pd.h.

◆ PdState

enum class esphome::fusb302b::PdState : uint8_t
strong
Enumerator
PD_STATE_DISCONNECTED 
PD_STATE_PD_TIMEOUT 

Negotiation is over without a PD contract (no capabilities, or the request was not accepted); the source supplies Type-C default power.

PD_STATE_DEFAULT_CONTRACT 
PD_STATE_TRANSITION 
PD_STATE_EXPLICIT_CONTRACT 
PD_STATE_ERROR 

Definition at line 47 of file pd.h.

Function Documentation

◆ ESPHOME_LOG_TAG() [1/2]

esphome::fusb302b::ESPHOME_LOG_TAG ( TAG ,
"fusb302b"  )

◆ ESPHOME_LOG_TAG() [2/2]

esphome::fusb302b::ESPHOME_LOG_TAG ( TAG ,
"fusb302b.pd"  )

◆ is_connected_state()

bool esphome::fusb302b::is_connected_state ( PdState state)
inline

Returns true for the states in which a source is attached and supplying power.

Definition at line 59 of file pd.h.