PF1550 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
Driver types

Errors, results, enumerations, status and interrupt types. More...

Classes

struct  pf1550::Result< T >
 The value of a call, or why there is none. More...
 
struct  pf1550::Result< void >
 The result of a call that returns no value. More...
 
struct  pf1550::Microvolts
 A voltage in microvolts, so that grids such as 12.5 mV steps stay exact. More...
 
struct  pf1550::VariantInfo
 What ReadVariant() reports. More...
 
struct  pf1550::VbusFlags
 VBUS flags of VBUS_SNS (Table 153). More...
 
struct  pf1550::ChargerStatus
 The charger status of one ReadChargerStatus() pass (separate reads, not atomic). More...
 
struct  pf1550::IrqMask
 Interrupt masks, one byte per group; a set bit masks the source. The default masks every source, as the chip does after power-up (section 9.4). More...
 
struct  pf1550::InterruptEvents
 Interrupt events returned by ServiceInterrupts(), one status byte per group. More...
 
struct  pf1550::Categories
 Which category-summary bits are set in INT_CATEGORY (Table 89). More...
 
struct  pf1550::PowerDownSequence
 The registers of the power-down sequence (Tables 139 to 145). More...
 
struct  pf1550::RailReadout
 One rail as the chip holds it. More...
 
struct  pf1550::ChargerAsFound
 Charger registers as found at start-up (the as-found check). More...
 
struct  pf1550::Snapshot
 A read-only view of the chip for diagnostics (ReadSnapshot()). More...
 
struct  pf1550::SelfCheckReport
 Result of SelfCheck(): what is wrong, if anything. More...
 
struct  pf1550::ShipConfirm
 Token: the caller confirms that EnterShip() cuts all supplies, VSNVS included. More...
 
struct  pf1550::CoreOffConfirm
 Token: the caller confirms that EnterCoreOff() turns the PMIC core off. More...
 
struct  pf1550::LoadSwitchConfirm
 Token: the caller confirms that a load switch has no current limit and cannot go back, and states the voltage of the LDO's input rail. The call refuses when that voltage is outside the rail's Limits window: in switch mode the output is the input voltage (section 7.2.6). More...
 

Enumerations

enum class  pf1550::Error : uint8_t {
  pf1550::Error::Ok = 0 , pf1550::Error::NotInitialized = 1 , pf1550::Error::InvalidArgument = 2 , pf1550::Error::Bus = 3 ,
  pf1550::Error::Timeout = 4 , pf1550::Error::DeviceIdMismatch = 5 , pf1550::Error::Crc = 6 , pf1550::Error::Busy = 7 ,
  pf1550::Error::DeviceFault = 8 , pf1550::Error::Unsupported = 9 , pf1550::Error::OutOfLimits = 16 , pf1550::Error::ReadOnlyRail = 17 ,
  pf1550::Error::Unsafe = 18 , pf1550::Error::Refused = 19 , pf1550::Error::ChargerFault = 20 , pf1550::Error::VerifyFailed = 21 ,
  pf1550::Error::NoDevice = 22 , pf1550::Error::DeviceReset = 23
}
 Why a call failed. Every call of the driver returns one of these in its Result. More...
 
enum class  pf1550::LogLevel : uint8_t { pf1550::LogLevel::Error = 0 , pf1550::LogLevel::Warning , pf1550::LogLevel::Info , pf1550::LogLevel::Debug }
 Severity passed to the optional Log() hook. More...
 
enum class  pf1550::Option : uint8_t {
  pf1550::Option::A0 = 0 , pf1550::Option::A1 = 1 , pf1550::Option::A2 = 2 , pf1550::Option::A3 = 3 ,
  pf1550::Option::A4 = 4 , pf1550::Option::A5 = 5 , pf1550::Option::A6 = 6 , pf1550::Option::A7 = 7 ,
  pf1550::Option::A8 = 8 , pf1550::Option::A9 = 9 , pf1550::Option::Unknown = 10
}
 The start-up option of the part (OTP_FLAVOR, Table 87; ordering codes A0 to A9). More...
 
enum class  pf1550::PowerState : uint8_t {
  pf1550::PowerState::Wait = 0 , pf1550::PowerState::Run = 1 , pf1550::PowerState::Standby = 2 , pf1550::PowerState::Sleep = 3 ,
  pf1550::PowerState::RegsDisable = 4 , pf1550::PowerState::Unknown = 5
}
 STATE_INFO decoded (Table 146). More...
 
enum class  pf1550::Rail : uint8_t {
  pf1550::Rail::Sw1 = 0 , pf1550::Rail::Sw2 = 1 , pf1550::Rail::Sw3 = 2 , pf1550::Rail::Ldo1 = 3 ,
  pf1550::Rail::Ldo2 = 4 , pf1550::Rail::Ldo3 = 5 , pf1550::Rail::VrefDdr = 6
}
 The power rails the driver configures. More...
 
enum class  pf1550::Dvs : uint8_t { pf1550::Dvs::Disabled = 0 , pf1550::Dvs::Enabled = 1 }
 Whether the OTP configured a buck for dynamic voltage scaling (OTP_SWx_DVS_SEL). More...
 
enum class  pf1550::SwCurrentLimit : uint8_t { pf1550::SwCurrentLimit::A1p0 = 0 , pf1550::SwCurrentLimit::A1p2 = 1 , pf1550::SwCurrentLimit::A1p5 = 2 , pf1550::SwCurrentLimit::A2p0 = 3 }
 Buck current limit, typical (SWx_ILIM, Tables 116, 121, 126). More...
 
enum class  pf1550::DvsSpeed : uint8_t { pf1550::DvsSpeed::Us2 = 0 , pf1550::DvsSpeed::Us4 = 1 }
 DVS slew rate (SWx_DVSSPEED). More...
 
enum class  pf1550::ChargerMode : uint8_t { pf1550::ChargerMode::Off = 0 , pf1550::ChargerMode::LinearOnly = 1 , pf1550::ChargerMode::Charge = 2 }
 Charger operating mode (CHG_OPER, Table 156). More...
 
enum class  pf1550::FastChargeTimer : uint8_t {
  pf1550::FastChargeTimer::Disabled = 0 , pf1550::FastChargeTimer::Hours2 = 1 , pf1550::FastChargeTimer::Hours4 = 2 , pf1550::FastChargeTimer::Hours6 = 3 ,
  pf1550::FastChargeTimer::Hours8 = 4 , pf1550::FastChargeTimer::Hours10 = 5 , pf1550::FastChargeTimer::Hours12 = 6 , pf1550::FastChargeTimer::Hours14 = 7
}
 Fast-charge timer (FCHGTIME, Table 157). More...
 
enum class  pf1550::EocTimer : uint8_t {
  pf1550::EocTimer::Debounce16s = 0 , pf1550::EocTimer::Min10 = 1 , pf1550::EocTimer::Min20 = 2 , pf1550::EocTimer::Min30 = 3 ,
  pf1550::EocTimer::Min40 = 4 , pf1550::EocTimer::Min50 = 5 , pf1550::EocTimer::Min60 = 6 , pf1550::EocTimer::Min70 = 7
}
 End-of-charge timer (EOCTIME, Table 157): 0 is a 16 s debounce, then 10 min steps. More...
 
enum class  pf1550::PrechargeTimer : uint8_t { pf1550::PrechargeTimer::Min30 = 0 , pf1550::PrechargeTimer::Min45 = 1 }
 Precharge timer (TPRECHG, Table 157). More...
 
enum class  pf1550::Restart : uint8_t { pf1550::Restart::Mv100 = 0 , pf1550::Restart::Mv150 = 1 , pf1550::Restart::Mv200 = 2 , pf1550::Restart::Disabled = 3 }
 Charge restart threshold below CHGCV (CHG_RESTART, Table 158). More...
 
enum class  pf1550::SystemMin : uint8_t { pf1550::SystemMin::Mv3500 = 0 , pf1550::SystemMin::Mv3700 = 1 , pf1550::SystemMin::Mv4300 = 2 }
 Minimum system voltage (VSYSMIN, Table 160). More...
 
enum class  pf1550::Thermistor : uint8_t { pf1550::Thermistor::Ignore = 0 , pf1550::Thermistor::Suspend = 1 , pf1550::Thermistor::Jeita1 = 2 , pf1550::Thermistor::Jeita2 = 3 }
 Thermistor behaviour (THM_CNFG, Table 162). More...
 
enum class  pf1550::ThermalRegTemp : uint8_t { pf1550::ThermalRegTemp::C80 = 0 , pf1550::ThermalRegTemp::C95 = 1 , pf1550::ThermalRegTemp::C110 = 2 }
 Junction temperature where charge current folds back (REGTEMP, Table 162). More...
 
enum class  pf1550::WatchdogTime : uint8_t { pf1550::WatchdogTime::S80 = 0 , pf1550::WatchdogTime::S32 = 1 }
 Charger watchdog period (WD_TIME, Table 161; the table prints 0 twice, ambiguity C8). More...
 
enum class  pf1550::BatfetOc : uint8_t { pf1550::BatfetOc::Disabled = 0 , pf1550::BatfetOc::A2p2 = 1 , pf1550::BatfetOc::A2p8 = 2 , pf1550::BatfetOc::A3p2 = 3 }
 Battery discharge overcurrent threshold (BATFET_OC, Table 161). More...
 
enum class  pf1550::Cold : uint8_t { C0 = 0 , CMinus10 = 1 }
 Cold threshold (THM_COLD).
 
enum class  pf1550::Hot : uint8_t { C60 = 0 , C55 = 1 }
 Hot threshold (THM_HOT).
 
enum class  pf1550::Cool : uint8_t { C15 = 0 , C10 = 1 }
 Cool threshold (THM_COOL).
 
enum class  pf1550::Warm : uint8_t { C45 = 0 , C50 = 1 }
 Warm threshold (THM_WARM).
 
enum class  pf1550::CvAdjust : uint8_t { Mv60 = 0 , Mv100 = 1 , Mv160 = 2 , Mv200 = 3 }
 JEITA charge voltage reduction (CV_ADJ, Table 168).
 
enum class  pf1550::CcAdjust : uint8_t { Pct25 = 0 , Pct50 = 1 , Pct75 = 2 , Pct100 = 3 }
 JEITA charge current as a share of IFC (CC_ADJ, Table 168).
 
enum class  pf1550::DpmVoltage : uint8_t {
  pf1550::DpmVoltage::Mv3900 = 0 , pf1550::DpmVoltage::Mv4000 = 1 , pf1550::DpmVoltage::Mv4100 = 2 , pf1550::DpmVoltage::Mv4200 = 3 ,
  pf1550::DpmVoltage::Mv4300 = 4 , pf1550::DpmVoltage::Mv4400 = 5 , pf1550::DpmVoltage::Mv4500 = 6 , pf1550::DpmVoltage::Mv4600 = 7
}
 VBUS input regulation (DPM) voltage (VBUS_DPM_REG, Table 164): 3.9 V + 100 mV x code. More...
 
enum class  pf1550::DpmStop : uint8_t { Mv200 = 0 , Mv250 = 1 }
 DPM panic stop threshold (VIN_DPM_STOP).
 
enum class  pf1550::ShortDebounce : uint8_t { pf1550::ShortDebounce::Us100 = 0 , pf1550::ShortDebounce::Ms1 = 1 , pf1550::ShortDebounce::Ms10 = 2 }
 Short debounce times (VBUS_OV_TDB, VBUS2SYS_TDB; code 0 is reserved and not offered). More...
 
enum class  pf1550::WakeupDelay : uint8_t { Ms8 = 0 , Ms16 = 1 , Ms32 = 2 , Ms100 = 3 }
 System wake-up delay (SYS_WKUP_DLY, Table 166).
 
enum class  pf1550::Vbus2SysThreshold : uint8_t { Mv50 = 0 , Mv175 = 1 }
 VBUS to VSYS comparator threshold (VBUS2SYS_THRSH).
 
enum class  pf1550::UsbPhyVoltage : uint8_t { V3p3 = 0 , V4p9 = 1 }
 USBPHY LDO voltage (USBPHY, Table 165).
 
enum class  pf1550::LedFrequency : uint8_t { Hz1 = 0 , Hz0p5 = 1 , Hz256 = 2 , Hz8 = 3 }
 LED PWM frequency (LED_FREQ, Table 172).
 
enum class  pf1550::LedMode : uint8_t { pf1550::LedMode::OnWhileCharging = 0 , pf1550::LedMode::FlashWhileCharging = 1 }
 LED mode (LED_CFG). More...
 
enum class  pf1550::StandbyDelay : uint8_t { None = 0 , Cycles1 = 1 , Cycles2 = 2 , Cycles3 = 3 }
 STANDBY pin delay in 32 kHz cycles (STANDBYDLY, Table 135).
 
enum class  pf1550::Debounce : uint8_t { pf1550::Debounce::Ms31 = 0 , pf1550::Debounce::Ms125 = 1 , pf1550::Debounce::Ms750 = 2 }
 Button debounce (PWRONDBNC, ONKEYDBNC; codes 00 and 01 are equal, ambiguity C41). More...
 
enum class  pf1550::GlobalReset : uint8_t { S4 = 0 , S8 = 1 , S12 = 2 , S16 = 3 }
 ONKEY hold time for a global reset (TGRESET, Table 135).
 
enum class  pf1550::Uvdet : uint8_t { Mv2650 = 0 , Mv2800 = 1 , Mv3000 = 2 , Mv3100 = 3 }
 VSYS undervoltage detect, rising threshold (UVDET, Table 137).
 
enum class  pf1550::LowSysWarn : uint8_t { Mv3300 = 0 , Mv3500 = 1 , Mv3700 = 2 , Mv3900 = 3 }
 Low system voltage warning, rising threshold (LOW_SYS_WARN, Table 137).
 
enum class  pf1550::AsFoundPolicy : uint8_t { pf1550::AsFoundPolicy::Report = 0 , pf1550::AsFoundPolicy::MakeSafe = 1 }
 What to do when the charger is found on and unsafe at start-up. More...
 
enum class  pf1550::ChargerState : uint8_t {
  pf1550::ChargerState::Precharge = 0 , pf1550::ChargerState::FastChargeCc = 1 , pf1550::ChargerState::FastChargeCv = 2 , pf1550::ChargerState::EndOfCharge = 3 ,
  pf1550::ChargerState::Done = 4 , pf1550::ChargerState::TimerFault = 6 , pf1550::ChargerState::ThermistorSuspend = 7 , pf1550::ChargerState::Off = 8 ,
  pf1550::ChargerState::BatteryOvervoltage = 9 , pf1550::ChargerState::ThermalShutdown = 10 , pf1550::ChargerState::LinearOnly = 12 , pf1550::ChargerState::Unknown = 255
}
 Charger state (CHG_SNS[3:0], Table 154). More...
 
enum class  pf1550::BatteryState : uint8_t {
  pf1550::BatteryState::NoValidVbus = 0 , pf1550::BatteryState::BelowPrecharge = 1 , pf1550::BatteryState::CannotChargePastPrecharge = 2 , pf1550::BatteryState::AbovePrecharge = 4 ,
  pf1550::BatteryState::Overvoltage = 5 , pf1550::BatteryState::NotDetected = 6 , pf1550::BatteryState::Unknown = 255
}
 Battery state (BATT_SNS[2:0], Table 155). More...
 
enum class  pf1550::Fault : uint8_t {
  pf1550::Fault::None = 0 , pf1550::Fault::TimerFault = 1 , pf1550::Fault::ThermistorSuspend = 2 , pf1550::Fault::ThermalShutdown = 3 ,
  pf1550::Fault::BatteryOvervoltage = 4 , pf1550::Fault::BatteryOvercurrent = 5 , pf1550::Fault::WatchdogExpired = 6 , pf1550::Fault::BatteryMissing = 7 ,
  pf1550::Fault::UnknownState = 8
}
 The fault the charger reports, classified from the state and flag registers. More...
 
enum class  pf1550::IrqGroup : uint8_t {
  pf1550::IrqGroup::Charger = 0 , pf1550::IrqGroup::SwLowSide = 1 , pf1550::IrqGroup::SwHighSide = 2 , pf1550::IrqGroup::SwDvs = 3 ,
  pf1550::IrqGroup::Ldo = 4 , pf1550::IrqGroup::Temp = 5 , pf1550::IrqGroup::Onkey = 6 , pf1550::IrqGroup::Misc = 7
}
 Interrupt groups, one status/mask/sense register triple each. More...
 
enum class  pf1550::IrqSource : uint8_t {
  pf1550::IrqSource::ChgSupplement = 0 , pf1550::IrqSource::ChgBat2Soc , pf1550::IrqSource::ChgBattery , pf1550::IrqSource::ChgCharger ,
  pf1550::IrqSource::ChgVbus , pf1550::IrqSource::ChgVbusDpm , pf1550::IrqSource::ChgThermistor , pf1550::IrqSource::Sw1LowSideLimit ,
  pf1550::IrqSource::Sw2LowSideLimit , pf1550::IrqSource::Sw3LowSideLimit , pf1550::IrqSource::Sw1HighSideLimit , pf1550::IrqSource::Sw2HighSideLimit ,
  pf1550::IrqSource::Sw3HighSideLimit , pf1550::IrqSource::Sw1DvsDone , pf1550::IrqSource::Sw2DvsDone , pf1550::IrqSource::Ldo1Fault ,
  pf1550::IrqSource::Ldo2Fault , pf1550::IrqSource::Ldo3Fault , pf1550::IrqSource::Temp110 , pf1550::IrqSource::Temp125 ,
  pf1550::IrqSource::OnkeyPush , pf1550::IrqSource::Onkey1s , pf1550::IrqSource::Onkey2s , pf1550::IrqSource::Onkey3s ,
  pf1550::IrqSource::Onkey4s , pf1550::IrqSource::Onkey8s , pf1550::IrqSource::PowerUp , pf1550::IrqSource::PowerDown ,
  pf1550::IrqSource::PwronChange , pf1550::IrqSource::LowSysWarning , pf1550::IrqSource::SysOvervoltage
}
 Every interrupt source of Tables 90 to 110 and 150 (31 sources). More...
 

Functions

constexpr const char * pf1550::ToString (Error error) noexcept
 The name of an error, for logs.
 
constexpr Microvolts pf1550::FromMillivolts (uint32_t mv) noexcept
 Microvolts from millivolts.
 
constexpr const char * pf1550::GetDriverVersion () noexcept
 
constexpr uint32_t pf1550::GetDriverVersionMajor () noexcept
 
constexpr uint32_t pf1550::GetDriverVersionMinor () noexcept
 
constexpr uint32_t pf1550::GetDriverVersionPatch () noexcept
 

Variables

constexpr uint8_t pf1550::kDefaultAddress = 0x08
 Default 7-bit I2C address (section 9.7.1); OTP selects 0x08 to 0x0F.
 
constexpr uint32_t pf1550::kDvsWaitMaxUs = 256
 The longest the driver waits for one DVS step sequence, in microseconds (64 steps x 4 us).
 
constexpr uint32_t pf1550::kWatchdogServiceMaxS = 16
 
constexpr std::size_t pf1550::kIrqGroups = 8
 Number of interrupt groups.
 
constexpr std::size_t pf1550::kRailCount = 7
 Number of rails.
 
constexpr std::size_t pf1550::kIrqSourceCount = 31
 Number of interrupt sources.
 

Detailed Description

Errors, results, enumerations, status and interrupt types.

Enumeration Type Documentation

◆ AsFoundPolicy

enum class pf1550::AsFoundPolicy : uint8_t
strong

What to do when the charger is found on and unsafe at start-up.

Enumerator
Report 

Return the error and write nothing (default).

MakeSafe 

Write CHG_OPER = linear only, then verify.

◆ BatfetOc

enum class pf1550::BatfetOc : uint8_t
strong

Battery discharge overcurrent threshold (BATFET_OC, Table 161).

Enumerator
Disabled 

No protection: needs the acknowledgement allow_batfet_oc_off.

A2p2 

2.2 A typical.

A2p8 

2.8 A typical.

A3p2 

3.2 A typical (reset value).

◆ BatteryState

enum class pf1550::BatteryState : uint8_t
strong

Battery state (BATT_SNS[2:0], Table 155).

Enumerator
NoValidVbus 

No valid input.

BelowPrecharge 

VBATT below VPRECHG.LB.

CannotChargePastPrecharge 

Timer fault in precharge.

AbovePrecharge 

Above the precharge threshold.

Overvoltage 

Battery overvoltage with a valid input.

NotDetected 

No battery with a valid input after wake-up.

Unknown 

A reserved code.

◆ ChargerMode

enum class pf1550::ChargerMode : uint8_t
strong

Charger operating mode (CHG_OPER, Table 156).

Enumerator
Off 

Charger and linear regulator off.

LinearOnly 

Linear regulator on, no battery charging (reset value).

Charge 

Charging.

◆ ChargerState

enum class pf1550::ChargerState : uint8_t
strong

Charger state (CHG_SNS[3:0], Table 154).

Enumerator
Precharge 

Battery below VPRECHG.LB.

FastChargeCc 

Constant current.

FastChargeCv 

Constant voltage.

EndOfCharge 

Current below IEOC, tEOC running.

Done 

Charge complete.

TimerFault 

Timer fault: only off then on exits it.

ThermistorSuspend 

Battery temperature outside the window.

Off 

Input invalid or charger disabled.

BatteryOvervoltage 

Battery overvoltage.

ThermalShutdown 

Junction above TSHDN.

LinearOnly 

Linear regulator only, not charging.

Unknown 

A reserved code: reported as a fault, never as charging.

◆ Debounce

enum class pf1550::Debounce : uint8_t
strong

Button debounce (PWRONDBNC, ONKEYDBNC; codes 00 and 01 are equal, ambiguity C41).

Enumerator
Ms31 

31.25 ms falling, 31.25 ms rising (register code 0).

Ms125 

125 ms falling (register code 2).

Ms750 

750 ms falling (register code 3).

◆ DpmVoltage

enum class pf1550::DpmVoltage : uint8_t
strong

VBUS input regulation (DPM) voltage (VBUS_DPM_REG, Table 164): 3.9 V + 100 mV x code.

Enumerator
Mv3900 

3.9 V (reset value).

Mv4000 

4.0 V.

Mv4100 

4.1 V.

Mv4200 

4.2 V.

Mv4300 

4.3 V.

Mv4400 

4.4 V.

Mv4500 

4.5 V.

Mv4600 

4.6 V.

◆ Dvs

enum class pf1550::Dvs : uint8_t
strong

Whether the OTP configured a buck for dynamic voltage scaling (OTP_SWx_DVS_SEL).

Enumerator
Disabled 

Non-DVS: the voltage registers are read only and hold the fixed table.

Enabled 

DVS: voltage is 0.6 V + 12.5 mV x code.

◆ DvsSpeed

enum class pf1550::DvsSpeed : uint8_t
strong

DVS slew rate (SWx_DVSSPEED).

Enumerator
Us2 

12.5 mV every 2 us.

Us4 

12.5 mV every 4 us.

◆ EocTimer

enum class pf1550::EocTimer : uint8_t
strong

End-of-charge timer (EOCTIME, Table 157): 0 is a 16 s debounce, then 10 min steps.

Enumerator
Debounce16s 

16 s.

Min10 

10 min (reset value).

Min20 

20 min.

Min30 

30 min.

Min40 

40 min.

Min50 

50 min.

Min60 

60 min.

Min70 

70 min.

◆ Error

enum class pf1550::Error : uint8_t
strong

Why a call failed. Every call of the driver returns one of these in its Result.

Values 0 to 9 are the shared base set; chip-specific values start at 16. [[nodiscard]] on the type: a function that returns a bare Error cannot have it ignored either (KB-CPP20-037).

Enumerator
Ok 

The call succeeded.

NotInitialized 

EnsureInitialized() has not succeeded yet.

InvalidArgument 

A value is not on the data sheet grid, is reserved or not an enumerator; nothing was sent.

Bus 

A port hook returned false.

Timeout 

A wait for the chip (a DVS step) did not end in the allowed time.

DeviceIdMismatch 

DEVICE_ID did not read 0x7C: wrong chip, no chip or a wiring fault.

Crc 

Not returned by this driver (I2C transfers carry no CRC).

Busy 

Not returned by this driver (the chip has no busy state).

DeviceFault 

Not returned by this driver (faults are reported as ChargerFault).

Unsupported 

The optional port hook this call needs is absent.

OutOfLimits 

A valid value outside the caller's Limits; nothing was sent.

ReadOnlyRail 

SW3, or SW1 or SW2 not declared in DVS mode: its voltage is not written.

Unsafe 

A safety downgrade without its acknowledgement; nothing was sent.

Refused 

A precondition of a dangerous call is not met (state, VBUS, ONKEY).

ChargerFault 

The charger reports a fault state; charging is not enabled.

VerifyFailed 

A register read back differently from what was just written.

NoDevice 

Nothing acknowledged the address: no chip, or it is unpowered.

DeviceReset 

The chip reset itself (a register the driver changed is back at its start-up value): run EnsureInitialized() and Configure().

◆ FastChargeTimer

enum class pf1550::FastChargeTimer : uint8_t
strong

Fast-charge timer (FCHGTIME, Table 157).

Enumerator
Disabled 

No timer: needs the acknowledgement allow_untimed_charge.

Hours2 

2 hours.

Hours4 

4 hours (reset value).

Hours6 

6 hours.

Hours8 

8 hours.

Hours10 

10 hours.

Hours12 

12 hours.

Hours14 

14 hours.

◆ Fault

enum class pf1550::Fault : uint8_t
strong

The fault the charger reports, classified from the state and flag registers.

Enumerator
None 

No fault.

TimerFault 

CHG_SNS 6.

ThermistorSuspend 

CHG_SNS 7.

ThermalShutdown 

CHG_SNS 10.

BatteryOvervoltage 

CHG_SNS 9 or BATT_SNS 5.

BatteryOvercurrent 

BATTOC_SNS.

WatchdogExpired 

WDT_SNS.

BatteryMissing 

BATT_SNS 6.

UnknownState 

A reserved CHG_SNS or BATT_SNS code.

◆ IrqGroup

enum class pf1550::IrqGroup : uint8_t
strong

Interrupt groups, one status/mask/sense register triple each.

Enumerator
Charger 

CHG_INT (0x80).

SwLowSide 

SW_INT_STAT0.

SwHighSide 

SW_INT_STAT1.

SwDvs 

SW_INT_STAT2.

Ldo 

LDO_INT_STAT0.

Temp 

TEMP_INT_STAT0.

Onkey 

ONKEY_INT_STAT0.

Misc 

MISC_INT_STAT0.

◆ IrqSource

enum class pf1550::IrqSource : uint8_t
strong

Every interrupt source of Tables 90 to 110 and 150 (31 sources).

Enumerator
ChgSupplement 

SUP_I.

ChgBat2Soc 

BAT2SOC_I.

ChgBattery 

BAT_I.

ChgCharger 

CHG_I.

ChgVbus 

VBUS_I.

ChgVbusDpm 

VBUS_DPM_I.

ChgThermistor 

THM_I.

Sw1LowSideLimit 

SW1_LS_I.

Sw2LowSideLimit 

SW2_LS_I.

Sw3LowSideLimit 

SW3_LS_I.

Sw1HighSideLimit 

SW1_HS_I.

Sw2HighSideLimit 

SW2_HS_I.

Sw3HighSideLimit 

SW3_HS_I.

Sw1DvsDone 

SW1_DVS_DONE_I.

Sw2DvsDone 

SW2_DVS_DONE_I.

Ldo1Fault 

LDO1_FAULTI.

Ldo2Fault 

LDO2_FAULTI.

Ldo3Fault 

LDO3_FAULTI.

Temp110 

THERM110I.

Temp125 

THERM125I.

OnkeyPush 

PUSHI.

Onkey1s 

1SI.

Onkey2s 

2SI.

Onkey3s 

3SI.

Onkey4s 

4SI.

Onkey8s 

8SI.

PowerUp 

PWRUP_I.

PowerDown 

PWRDN_I.

PwronChange 

PWRON_I.

LowSysWarning 

LOW_SYS_WARN_I.

SysOvervoltage 

SYS_OVLO_I.

◆ LedMode

enum class pf1550::LedMode : uint8_t
strong

LED mode (LED_CFG).

Enumerator
OnWhileCharging 

On while charging, flashing on a fault, off when done.

FlashWhileCharging 

Flashing while charging, on on a fault, off when done.

◆ LogLevel

enum class pf1550::LogLevel : uint8_t
strong

Severity passed to the optional Log() hook.

Enumerator
Error 

A call failed.

Warning 

Something unexpected that the driver recovered from.

Info 

Lifecycle events.

Debug 

Detail for bring-up.

◆ Option

enum class pf1550::Option : uint8_t
strong

The start-up option of the part (OTP_FLAVOR, Table 87; ordering codes A0 to A9).

Enumerator
A0 

Not programmed: internal validation only; nothing is assumed about it.

A1 

Default option.

A2 

Option A2.

A3 

Option A3.

A4 

Option A4.

A5 

Option A5.

A6 

Option A6.

A7 

Option A7.

A8 

Option A8 (edge-sensitive PWRON).

A9 

Option A9.

Unknown 

A flavour byte the data sheet does not list (ambiguity C10).

◆ PowerState

enum class pf1550::PowerState : uint8_t
strong

STATE_INFO decoded (Table 146).

Enumerator
Wait 

000000.

Run 

001100.

Standby 

001101.

Sleep 

001110.

RegsDisable 

101011.

Unknown 

Any other code.

◆ PrechargeTimer

enum class pf1550::PrechargeTimer : uint8_t
strong

Precharge timer (TPRECHG, Table 157).

Enumerator
Min30 

30 minutes.

Min45 

45 minutes.

◆ Rail

enum class pf1550::Rail : uint8_t
strong

The power rails the driver configures.

Enumerator
Sw1 

Buck 1, 1.0 A, DVS.

Sw2 

Buck 2, 1.0 A, DVS.

Sw3 

Buck 3, 1.0 A, voltage read only.

Ldo1 

LDO1, 300 mA, load switch capable.

Ldo2 

LDO2, 400 mA.

Ldo3 

LDO3, 300 mA, load switch capable.

VrefDdr 

DDR reference, 10 mA, fixed voltage.

◆ Restart

enum class pf1550::Restart : uint8_t
strong

Charge restart threshold below CHGCV (CHG_RESTART, Table 158).

Enumerator
Mv100 

100 mV.

Mv150 

150 mV (reset value).

Mv200 

200 mV.

Disabled 

No restart.

◆ ShortDebounce

enum class pf1550::ShortDebounce : uint8_t
strong

Short debounce times (VBUS_OV_TDB, VBUS2SYS_TDB; code 0 is reserved and not offered).

Enumerator
Us100 

100 us (register code 1).

Ms1 

1 ms (register code 2).

Ms10 

10 ms (register code 3).

◆ SwCurrentLimit

enum class pf1550::SwCurrentLimit : uint8_t
strong

Buck current limit, typical (SWx_ILIM, Tables 116, 121, 126).

Enumerator
A1p0 

1.0 A.

A1p2 

1.2 A.

A1p5 

1.5 A.

A2p0 

2.0 A.

◆ SystemMin

enum class pf1550::SystemMin : uint8_t
strong

Minimum system voltage (VSYSMIN, Table 160).

Enumerator
Mv3500 

3.5 V (reset value).

Mv3700 

3.7 V.

Mv4300 

4.3 V (recommended, section 8.1).

◆ ThermalRegTemp

enum class pf1550::ThermalRegTemp : uint8_t
strong

Junction temperature where charge current folds back (REGTEMP, Table 162).

Enumerator
C80 

80 degC.

C95 

95 degC (reset value).

C110 

110 degC.

◆ Thermistor

enum class pf1550::Thermistor : uint8_t
strong

Thermistor behaviour (THM_CNFG, Table 162).

Enumerator
Ignore 

Not in control: needs the acknowledgement battery_has_own_ntc_protection.

Suspend 

Charging stops outside cold and hot (reset value).

Jeita1 

Current and voltage reduced in cool and warm.

Jeita2 

Current reduced in cool and warm.

◆ WatchdogTime

enum class pf1550::WatchdogTime : uint8_t
strong

Charger watchdog period (WD_TIME, Table 161; the table prints 0 twice, ambiguity C8).

Enumerator
S80 

80 s (reset value).

S32 

32 s.

Function Documentation

◆ FromMillivolts()

constexpr Microvolts pf1550::FromMillivolts ( uint32_t  mv)
constexprnoexcept

Microvolts from millivolts.

Parameters
mvMillivolts.
Returns
The voltage.

◆ GetDriverVersion()

constexpr const char * pf1550::GetDriverVersion ( )
constexprnoexcept
Returns
The driver version, e.g. "0.1.0", from the generated pf1550_version.h. No I/O.

◆ GetDriverVersionMajor()

constexpr uint32_t pf1550::GetDriverVersionMajor ( )
constexprnoexcept
Returns
The major version. No I/O.

◆ GetDriverVersionMinor()

constexpr uint32_t pf1550::GetDriverVersionMinor ( )
constexprnoexcept
Returns
The minor version. No I/O.

◆ GetDriverVersionPatch()

constexpr uint32_t pf1550::GetDriverVersionPatch ( )
constexprnoexcept
Returns
The patch version. No I/O.

◆ ToString()

constexpr const char * pf1550::ToString ( Error  error)
constexprnoexcept

The name of an error, for logs.

Parameters
errorThe error.
Returns
A static string such as "Timeout"; "Unknown" for a value that is not an enumerator.

Variable Documentation

◆ kWatchdogServiceMaxS

constexpr uint32_t pf1550::kWatchdogServiceMaxS = 16
inlineconstexpr

The longest the application may leave the charger watchdog unserviced when it is on, in seconds (the data sheet gives 80 s, +/-20 %, or 32 s: 16 s covers every reading, ambiguity C8).