|
HardFOC Core
API reference
|
Thread-safe PF1550 PMIC HAL handler. More...
#include <Pf1550Handler.h>
Public Types | |
| using | Pf1550Driver = pf1550::PF1550< HalPf1550Comm > |
| Alias for the templated driver type. | |
Public Member Functions | |
| Pf1550Handler (BaseI2c &i2c, BaseGpio *standby_gpio=nullptr, BaseGpio *usb_vbus_en_gpio=nullptr, BaseGpio *usb_otg_en_gpio=nullptr) noexcept | |
| Construct with required I²C and optional strap pins. | |
| Pf1550Handler (const Pf1550Handler &)=delete | |
| Pf1550Handler & | operator= (const Pf1550Handler &)=delete |
| bool | EnsureInitialized () noexcept |
| Idempotent — verify DEVICE_ID and prime the bus adapter. | |
| bool | IsInitialized () const noexcept |
| Has EnsureInitialized ever succeeded? | |
| bool | ApplyProfile (std::span< const pf1550::profiles::RegisterWrite > profile) noexcept |
| Apply an ordered register-write sequence. | |
| bool | ApplyPortentaH7Profile () noexcept |
| Driver-named Arduino Portenta H7 eval sequence (legacy VFR order). | |
| bool | ApplyPortentaH7CarrierProfile () noexcept |
| Driver-named Portenta-H7-on-carrier eval sequence (SW1-first). | |
| bool | SetPowerMode (pf1550::PowerMode mode) noexcept |
| Drive STANDBY strap to RUN or STANDBY. | |
| bool | SetUsbRails (bool vbus_en, bool otg_en) noexcept |
| Drive USB_VBUS_EN / USB_OTG_EN straps. | |
| bool | ReadPmicStatus (uint8_t &status) noexcept |
| Read STATE_INFO (0x67). | |
| bool | RefreshDiagnosticSnapshot () noexcept |
| Refresh the cached snapshot by re-reading the PMIC. | |
| bool | RefreshStatusSnapshot () noexcept |
Refresh the status part of the cached snapshot only (driver RefreshStatusSnapshot); identity and rail configuration stay from the last full refresh. Falls back to a full read when the cache holds none. | |
| bool | ReadDiagnosticSnapshot (pf1550::DiagnosticSnapshot &out) noexcept |
| Copy the cached snapshot out (zero-copy not provided to keep the API thread-safe). | |
| bool | RunPowerSelfTest (pf1550::SelfTestResult &out) noexcept |
| Run boot-time self-test (uses internal snapshot path). | |
| bool | ClearLatchedFaults () noexcept |
| Clear every RW1C latched fault status register. | |
| bool | HasMcuAffectingFault () noexcept |
Convenience: are any currently-latched faults of severity kCritical or kMcuKill? | |
| Pf1550Driver * | GetDriver () noexcept |
| Expose raw driver (advanced use only — does not lock). | |
| const Pf1550Driver * | GetDriver () const noexcept |
| Expose raw driver (advanced use only — does not lock). | |
Private Member Functions | |
| bool | ensureInitializedLocked () noexcept |
Private Attributes | |
| BaseI2c & | i2c_ |
| BaseGpio * | standby_gpio_ |
| BaseGpio * | usb_vbus_en_gpio_ |
| BaseGpio * | usb_otg_en_gpio_ |
| std::unique_ptr< HalPf1550Comm > | comm_ |
| std::unique_ptr< Pf1550Driver > | driver_ |
| bool | initialized_ |
| pf1550::DiagnosticSnapshot | cached_snapshot_ |
| bool | have_full_snapshot_ {false} |
| cached_snapshot_ holds a successful full read | |
| RtosMutex | handler_mutex_ |
Thread-safe PF1550 PMIC HAL handler.
Owns:
pf1550::PF1550<HalPf1550Comm> driver instance,Lifecycle:
BaseI2c and optional strap BaseGpio* pins.| using Pf1550Handler::Pf1550Driver = pf1550::PF1550<HalPf1550Comm> |
Alias for the templated driver type.
|
noexcept |
Construct with required I²C and optional strap pins.
| i2c | I²C device whose 7-bit address matches the PF1550. |
| standby_gpio | Optional STANDBY strap; nullptr if unused. |
| usb_vbus_en_gpio | Optional USB_VBUS_EN strap; nullptr if unused. |
| usb_otg_en_gpio | Optional USB_OTG_EN strap; nullptr if unused. |
|
delete |
|
noexcept |
Driver-named Portenta-H7-on-carrier eval sequence (SW1-first).
|
noexcept |
Driver-named Arduino Portenta H7 eval sequence (legacy VFR order).
|
noexcept |
Apply an ordered register-write sequence.
| profile | Writes applied in order; each entry may delay after the write. |
|
noexcept |
Clear every RW1C latched fault status register.
|
noexcept |
Idempotent — verify DEVICE_ID and prime the bus adapter.
|
privatenoexcept |
|
noexcept |
Expose raw driver (advanced use only — does not lock).
|
noexcept |
Expose raw driver (advanced use only — does not lock).
|
noexcept |
Convenience: are any currently-latched faults of severity kCritical or kMcuKill?
|
inlinenoexcept |
Has EnsureInitialized ever succeeded?
|
delete |
|
noexcept |
Copy the cached snapshot out (zero-copy not provided to keep the API thread-safe).
|
noexcept |
Read STATE_INFO (0x67).
|
noexcept |
Refresh the cached snapshot by re-reading the PMIC.
Safe to call from any thread; serialised by the handler mutex.
true if all I²C transactions completed.
|
noexcept |
Refresh the status part of the cached snapshot only (driver RefreshStatusSnapshot); identity and rail configuration stay from the last full refresh. Falls back to a full read when the cache holds none.
|
noexcept |
Run boot-time self-test (uses internal snapshot path).
On success out.worst_severity == FaultSeverity::kInfo. Failures are classified into Warning / Critical / McuKill via pf1550::FaultSeverityPortentaH7 (board-profile severity table).
|
noexcept |
Drive STANDBY strap to RUN or STANDBY.
|
noexcept |
Drive USB_VBUS_EN / USB_OTG_EN straps.
|
private |
|
private |
|
private |
|
mutableprivate |
|
private |
cached_snapshot_ holds a successful full read
|
private |
|
private |
|
private |
|
private |
|
private |