How texasinstruments/ti-pmic-lld works
Project type and purpose
• This is neither a full-stack app nor a web service, but a low-level embedded software library (TI PMIC LLD).
• Purpose: provide a platform- and OS-agnostic C API to configure Texas Instruments power management ICs, in compliance with ISO 26262.
Insights from README
• Abstracts register- and bit-field details via a well-defined API.
• Intended for automotive/industrial; supports multiple device families by branching per device.
• Integration: you clone the branch matching your PMIC family, then include its headers & sources in your embedded project.
a. Main components to show:
• Application Layer (your embedded application or RTOS driver)
• PMIC LLD Core API
• Device-Specific Modules (Leo, Hera)
• HAL Layer (I2C/SPI driver interface)
• Physical Bus (I2C or SPI)
• PMIC Hardware (Leo/Hera devices)
• Optional: Test Harness / CI component
b. Relationships & interactions:
1. The Application Layer calls functions in the PMIC LLD Core API.
2. Core API dispatches to the correct device driver module (leo or hera) based on compile-time configuration.
3. Device module uses HAL APIs to read/write PMIC registers over I2C/SPI.
4. HAL invokes the platform’s bus driver.
5. Bus driver communicates with the PMIC hardware.
c. Architectural patterns/design principles:
• Layered architecture (Application → Core API → Device Module → HAL → Bus → HW)
• Hardware Abstraction (separate HAL allows portability)
• Device Abstraction (branch per PMIC family encapsulates register details)
d. Key technologies/frameworks:
• Language: C, ISO 26262 safety guidelines
• Build system: Make/CMake or TI’s proprietary build scripts
• Bus protocols: I2C, SPI
• Test frameworks: Unity or CUnit (in tests/)