PF1550 Driver
API reference
Loading...
Searching...
No Matches
Namespaces | Functions
pf1550_voltage_tables.hpp File Reference

PF1550 SW / LDO voltage-code ↔ millivolt conversion helpers. More...

#include <cstdint>
#include "pf1550_registers.hpp"
Include dependency graph for pf1550_voltage_tables.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  pf1550
 

Functions

constexpr uint16_t pf1550::SwCodeToMillivolts (uint8_t code) noexcept
 SW1 / SW2 output voltage, DVS disabled (OTP_SWx_DVS_SEL = 1).
 
constexpr uint16_t pf1550::SwDvsCodeToMillivolts (uint8_t code) noexcept
 SW1 / SW2 output voltage, DVS enabled (OTP_SWx_DVS_SEL = 0): 0.6000 V + 12.5 mV × code (Table 31, left column), rounded to mV.
 
constexpr uint8_t pf1550::SwDvsMillivoltsToCode (uint16_t mv) noexcept
 Encode a DVS-enabled SW1 / SW2 voltage (Table 31, left column).
 
constexpr uint16_t pf1550::Sw3CodeToMillivolts (uint8_t code) noexcept
 SW3 output voltage (Table 37): 1.80 V + 100 mV × SW3_VOLT[3:0].
 
constexpr uint8_t pf1550::SwMillivoltsToCode (uint16_t mv) noexcept
 Build a 6-bit SW voltage code from millivolts (Portenta-verified codes).
 
constexpr uint16_t pf1550::LdoCodeToMillivolts (uint8_t code, bool is_ldo2) noexcept
 Decode a 5-bit LDO voltage register field to millivolts.
 
constexpr uint16_t pf1550::VbusLimitRegToMilliamps (uint8_t reg_value) noexcept
 Decode VBUS_IN_LIM_CNFG (absolute address 0x94) register byte to mA.
 
constexpr uint8_t pf1550::VbusLimitMilliampsToReg (uint16_t mA) noexcept
 Encode mA → VBUS_IN_LIM_CNFG (0x94) register byte (bits 7:3).
 
constexpr uint16_t pf1550::SwCurrentLimitCodeToMilliamps (uint8_t code) noexcept
 Decode the SW3_CTRL1[1:0] (or SW1/SW2_CTRL1) current limit field.
 
constexpr PmicState pf1550::DecodeStateInfo (uint8_t reg) noexcept
 Convert STATE_INFO (0x67) full byte into a typed PmicState.
 
constexpr ChargerState pf1550::DecodeChargerSense (uint8_t reg) noexcept
 Convert CHG_SNS (0x87) into a typed ChargerState.
 

Detailed Description

PF1550 SW / LDO voltage-code ↔ millivolt conversion helpers.

Encodings come from the PF1550 datasheet (Rev. 7) Tables 31 (SW1/2/3) and 41 (LDO1/2/3). All conversions are constexpr and table-free where possible so they can be used in driver self-test paths and static_assert.

Notation
  • "code" — 6-bit (SW) or 5-bit (LDO) voltage register field.
  • "mV" — output voltage in millivolts (integer).
Validity
The PF1550 only programs voltages within a discrete grid; codes outside the documented range return 0 for mV and Invalid for code-construction helpers. Callers must use these helpers — never static_cast arbitrary integers into pf1550::SwVoltageCode / pf1550::LdoVoltageCode.