ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
esphome::sy6970 Namespace Reference

Data Structures

class  SY6970Component
 
struct  SY6970Data
 

Enumerations

enum  BusStatus {
  BUS_STATUS_NO_INPUT = 0 , BUS_STATUS_USB_SDP = 1 , BUS_STATUS_USB_CDP = 2 , BUS_STATUS_USB_DCP = 3 ,
  BUS_STATUS_HVDCP = 4 , BUS_STATUS_ADAPTER = 5 , BUS_STATUS_NO_STD_ADAPTER = 6 , BUS_STATUS_OTG = 7
}
 
enum  ChargeStatus { CHARGE_STATUS_NOT_CHARGING = 0 , CHARGE_STATUS_PRE_CHARGE = 1 , CHARGE_STATUS_FAST_CHARGE = 2 , CHARGE_STATUS_CHARGE_DONE = 3 }
 
enum  I2CWatchdogTimeout { I2C_WATCHDOG_DISABLED = 0 , I2C_WATCHDOG_40S = 1 , I2C_WATCHDOG_80S = 2 , I2C_WATCHDOG_160S = 3 }
 

Functions

 ESPHOME_LOG_TAG (TAG, "sy6970")
 
 PROGMEM_STRING_TABLE (I2CWatchdogTimeoutStrings, "Disabled", "40s", "80s", "160s", "Unknown")
 
uint16_t vbus_voltage_mv (uint8_t reg)
 VBUS voltage in mV from REG11; 0 while VBUS_GD (bit 7) shows no input, as the ADC then reads its 2.6 V offset.
 
bool is_charging (uint8_t charge_status)
 
 PROGMEM_STRING_TABLE (BusStatusStrings, "No Input", "USB SDP", "USB CDP", "USB DCP", "HVDCP", "Adapter", "Non-Standard Adapter", "OTG")
 
 PROGMEM_STRING_TABLE (ChargeStatusStrings, "Not Charging", "Pre-charge", "Fast Charge", "Charge Done")
 
 PROGMEM_STRING_TABLE (NtcStatusStrings, "Normal", "Unknown", "Warm", "Cool", "Unknown", "Cold", "Hot", "Unknown")
 

Enumeration Type Documentation

◆ BusStatus

Enumerator
BUS_STATUS_NO_INPUT 
BUS_STATUS_USB_SDP 
BUS_STATUS_USB_CDP 
BUS_STATUS_USB_DCP 
BUS_STATUS_HVDCP 
BUS_STATUS_ADAPTER 
BUS_STATUS_NO_STD_ADAPTER 
BUS_STATUS_OTG 

Definition at line 49 of file sy6970.h.

◆ ChargeStatus

Enumerator
CHARGE_STATUS_NOT_CHARGING 
CHARGE_STATUS_PRE_CHARGE 
CHARGE_STATUS_FAST_CHARGE 
CHARGE_STATUS_CHARGE_DONE 

Definition at line 61 of file sy6970.h.

◆ I2CWatchdogTimeout

Enumerator
I2C_WATCHDOG_DISABLED 
I2C_WATCHDOG_40S 
I2C_WATCHDOG_80S 
I2C_WATCHDOG_160S 

Definition at line 70 of file sy6970.h.

Function Documentation

◆ ESPHOME_LOG_TAG()

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

◆ is_charging()

bool esphome::sy6970::is_charging ( uint8_t charge_status)
inline

Definition at line 87 of file sy6970.h.

◆ PROGMEM_STRING_TABLE() [1/4]

esphome::sy6970::PROGMEM_STRING_TABLE ( BusStatusStrings ,
"No Input" ,
"USB SDP" ,
"USB CDP" ,
"USB DCP" ,
"HVDCP" ,
"Adapter" ,
"Non-Standard Adapter" ,
"OTG"  )

◆ PROGMEM_STRING_TABLE() [2/4]

esphome::sy6970::PROGMEM_STRING_TABLE ( ChargeStatusStrings ,
"Not Charging" ,
"Pre-charge" ,
"Fast Charge" ,
"Charge Done"  )

◆ PROGMEM_STRING_TABLE() [3/4]

esphome::sy6970::PROGMEM_STRING_TABLE ( I2CWatchdogTimeoutStrings ,
"Disabled" ,
"40s" ,
"80s" ,
"160s" ,
"Unknown"  )

◆ PROGMEM_STRING_TABLE() [4/4]

esphome::sy6970::PROGMEM_STRING_TABLE ( NtcStatusStrings ,
"Normal" ,
"Unknown" ,
"Warm" ,
"Cool" ,
"Unknown" ,
"Cold" ,
"Hot" ,
"Unknown"  )

◆ vbus_voltage_mv()

uint16_t esphome::sy6970::vbus_voltage_mv ( uint8_t reg)
inline

VBUS voltage in mV from REG11; 0 while VBUS_GD (bit 7) shows no input, as the ADC then reads its 2.6 V offset.

Definition at line 83 of file sy6970.h.