PF1550 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Functions | Variables
Register codecs

Voltage and current grids (datasheet Tables 31, 37, 41, 43, 111, 158 to 160, 163). More...

Functions

constexpr Result< uint8_t > pf1550::ChargeVoltageCode (uint32_t mv) noexcept
 CHGCV code for a charge voltage.
 
constexpr uint32_t pf1550::ChargeVoltageMv (uint32_t code) noexcept
 The charge voltage a CHGCV code stands for.
 
constexpr Result< uint8_t > pf1550::ChargeCurrentCode (uint32_t ma) noexcept
 CHG_CC code for a charge current.
 
constexpr Result< uint32_t > pf1550::ChargeCurrentMa (uint32_t code) noexcept
 The current of a CHG_CC code.
 
constexpr Result< uint8_t > pf1550::TerminationCode (uint32_t ma) noexcept
 IEOC code for a termination current.
 
constexpr Result< uint32_t > pf1550::TerminationMa (uint32_t code) noexcept
 The termination current of an IEOC code.
 
constexpr Result< uint8_t > pf1550::InputLimitCode (uint32_t ma) noexcept
 VBUS_LIN_ILIM code for an input current limit.
 
constexpr Result< uint32_t > pf1550::InputLimitMa (uint32_t code) noexcept
 The limit of a VBUS_LIN_ILIM code.
 
constexpr Result< uint8_t > pf1550::BuckDvsCode (uint32_t uv) noexcept
 DVS-mode buck code for a voltage (SW1, SW2: 0.6 V + 12.5 mV x code).
 
constexpr uint32_t pf1550::BuckDvsUv (uint32_t code) noexcept
 The voltage of a DVS-mode buck code.
 
constexpr uint32_t pf1550::BuckFixedUvOf (uint32_t code) noexcept
 The voltage of a buck code in the non-DVS table (Table 31): codes 0 to 6, 3.3 V above.
 
constexpr uint32_t pf1550::Sw3Uv (uint32_t code) noexcept
 The voltage of an SW3 code (1.80 V + 100 mV x code, Table 37).
 
constexpr Result< uint8_t > pf1550::LdoCode (Rail rail, uint32_t uv) noexcept
 LDO voltage code.
 
constexpr uint32_t pf1550::LdoUv (Rail rail, uint32_t code) noexcept
 The voltage of an LDO code.
 
constexpr Result< uint8_t > pf1550::CoinVoltageCode (uint32_t mv) noexcept
 VCOIN code for a coin cell charge voltage (1.8 V + 100 mV x code, ambiguity C40).
 
constexpr PowerState pf1550::DecodePowerState (uint32_t code) noexcept
 The 4-bit power-state code of STATE_INFO (Table 146) as a PowerState.
 
constexpr Option pf1550::DecodeOption (uint32_t flavor) noexcept
 The option an OTP_FLAVOR byte names (Table 87 lists 0 to 3 and then "continues": a larger byte is Unknown, ambiguity C10, and the part's Table 85 profile is not assumed for it).
 

Variables

constexpr uint32_t pf1550::kChargeVoltageMinMv = 3500
 Lowest charge voltage (CHGCV code 8), mV (Table 160).
 
constexpr uint32_t pf1550::kChargeVoltageMaxMv = 4440
 Highest charge voltage (CHGCV code 55), mV.
 
constexpr uint32_t pf1550::kChargeCurrentMinMa = 100
 Charge current range, mA (Table 159: codes 0 to 18).
 
constexpr uint32_t pf1550::kChargeCurrentMaxMa = 1000
 Highest charge current, mA.
 
constexpr uint32_t pf1550::kBuckDvsMinUv = 600000
 DVS buck lowest voltage, uV (Table 31).
 
constexpr uint32_t pf1550::kBuckDvsStepUv = 12500
 DVS buck step, uV.
 
constexpr std::size_t pf1550::kInputLimitCodes = 21
 Number of VBUS_LIN_ILIM codes the data sheet defines (Table 163).
 
constexpr std::array< uint16_t, kInputLimitCodes > pf1550::kInputLimitMa
 The VBUS_LIN_ILIM table, mA, indexed by code (Table 163, Table 58).
 
constexpr std::array< uint32_t, 7 > pf1550::kBuckFixedUv
 The fixed (DVS disabled) buck table, uV, codes 0 to 6; every code above is 3.3 V (Table 31).
 

Detailed Description

Voltage and current grids (datasheet Tables 31, 37, 41, 43, 111, 158 to 160, 163).

Function Documentation

◆ BuckDvsCode()

constexpr Result< uint8_t > pf1550::BuckDvsCode ( uint32_t  uv)
constexprnoexcept

DVS-mode buck code for a voltage (SW1, SW2: 0.6 V + 12.5 mV x code).

Parameters
uv600000 to 1387500 uV on the 12.5 mV grid.
Returns
The code 0 to 63, or InvalidArgument.

◆ BuckDvsUv()

constexpr uint32_t pf1550::BuckDvsUv ( uint32_t  code)
constexprnoexcept

The voltage of a DVS-mode buck code.

Parameters
code0 to 63.
Returns
uV.

◆ BuckFixedUvOf()

constexpr uint32_t pf1550::BuckFixedUvOf ( uint32_t  code)
constexprnoexcept

The voltage of a buck code in the non-DVS table (Table 31): codes 0 to 6, 3.3 V above.

Parameters
code0 to 63.
Returns
uV.

◆ ChargeCurrentCode()

constexpr Result< uint8_t > pf1550::ChargeCurrentCode ( uint32_t  ma)
constexprnoexcept

CHG_CC code for a charge current.

Parameters
ma100 to 1000 in 50 mA steps.
Returns
The code 0 to 18, or InvalidArgument.

◆ ChargeCurrentMa()

constexpr Result< uint32_t > pf1550::ChargeCurrentMa ( uint32_t  code)
constexprnoexcept

The current of a CHG_CC code.

Parameters
code0 to 18 (19 to 31 are Reserved).
Returns
mA, or InvalidArgument for a reserved code.

◆ ChargeVoltageCode()

constexpr Result< uint8_t > pf1550::ChargeVoltageCode ( uint32_t  mv)
constexprnoexcept

CHGCV code for a charge voltage.

Parameters
mvMillivolts, 3500 to 4440 in 20 mV steps.
Returns
The code 8 to 55, or InvalidArgument.

◆ ChargeVoltageMv()

constexpr uint32_t pf1550::ChargeVoltageMv ( uint32_t  code)
constexprnoexcept

The charge voltage a CHGCV code stands for.

Parameters
code0 to 63: 0 to 8 are 3.50 V, 56 to 63 are 4.44 V.
Returns
Millivolts.

◆ CoinVoltageCode()

constexpr Result< uint8_t > pf1550::CoinVoltageCode ( uint32_t  mv)
constexprnoexcept

VCOIN code for a coin cell charge voltage (1.8 V + 100 mV x code, ambiguity C40).

Parameters
mv1800 to 3300 in 100 mV steps.
Returns
The code 0 to 15, or InvalidArgument.

◆ DecodeOption()

constexpr Option pf1550::DecodeOption ( uint32_t  flavor)
constexprnoexcept

The option an OTP_FLAVOR byte names (Table 87 lists 0 to 3 and then "continues": a larger byte is Unknown, ambiguity C10, and the part's Table 85 profile is not assumed for it).

Parameters
flavorOTP_FLAVOR.
Returns
The option, or Unknown.

◆ DecodePowerState()

constexpr PowerState pf1550::DecodePowerState ( uint32_t  code)
constexprnoexcept

The 4-bit power-state code of STATE_INFO (Table 146) as a PowerState.

Parameters
codeSTATE_INFO[5:0].
Returns
The state; Unknown for any other code.

◆ InputLimitCode()

constexpr Result< uint8_t > pf1550::InputLimitCode ( uint32_t  ma)
constexprnoexcept

VBUS_LIN_ILIM code for an input current limit.

Parameters
maOne of the 21 values of kInputLimitMa.
Returns
The code 0 to 20, or InvalidArgument.

◆ InputLimitMa()

constexpr Result< uint32_t > pf1550::InputLimitMa ( uint32_t  code)
constexprnoexcept

The limit of a VBUS_LIN_ILIM code.

Parameters
code0 to 20 (21 to 31 are reserved).
Returns
mA, or InvalidArgument.

◆ LdoCode()

constexpr Result< uint8_t > pf1550::LdoCode ( Rail  rail,
uint32_t  uv 
)
constexprnoexcept

LDO voltage code.

Parameters
railRail::Ldo1, Rail::Ldo3 (5-bit table, Table 41) or Rail::Ldo2 (4-bit, Table 43).
uvMicrovolts on the table's grid.
Returns
The code, or InvalidArgument.

◆ LdoUv()

constexpr uint32_t pf1550::LdoUv ( Rail  rail,
uint32_t  code 
)
constexprnoexcept

The voltage of an LDO code.

Parameters
railThe LDO.
codeThe register code (5 bits for LDO1 and LDO3, 4 bits for LDO2).
Returns
uV; 0 for a rail that is not an LDO.

◆ Sw3Uv()

constexpr uint32_t pf1550::Sw3Uv ( uint32_t  code)
constexprnoexcept

The voltage of an SW3 code (1.80 V + 100 mV x code, Table 37).

Parameters
code0 to 15.
Returns
uV.

◆ TerminationCode()

constexpr Result< uint8_t > pf1550::TerminationCode ( uint32_t  ma)
constexprnoexcept

IEOC code for a termination current.

Parameters
ma5, 10, 20, 30 or 50.
Returns
The code 0 to 4, or InvalidArgument.

◆ TerminationMa()

constexpr Result< uint32_t > pf1550::TerminationMa ( uint32_t  code)
constexprnoexcept

The termination current of an IEOC code.

Parameters
code0 to 4 (5 to 7 are reserved).
Returns
mA, or InvalidArgument.

Variable Documentation

◆ kBuckFixedUv

constexpr std::array<uint32_t, 7> pf1550::kBuckFixedUv
inlineconstexpr
Initial value:
= {1100000, 1200000, 1350000, 1500000,
1800000, 2500000, 3000000}

The fixed (DVS disabled) buck table, uV, codes 0 to 6; every code above is 3.3 V (Table 31).

◆ kInputLimitMa

constexpr std::array<uint16_t, kInputLimitCodes> pf1550::kInputLimitMa
inlineconstexpr
Initial value:
= {
10, 15, 20, 25, 30, 35, 40, 45, 50, 100, 150,
200, 300, 400, 500, 600, 700, 800, 900, 1000, 1500}

The VBUS_LIN_ILIM table, mA, indexed by code (Table 163, Table 58).