BMS Driver
The BMS driver is a firmware module responsible for low-level battery management system control. It provides a universal API for BMS applications.
The BMS driver is split into several functional modules:
- Switch Driver — Core logic for switching charge and discharge ports ON/OFF according to battery and load state. Implements failure detection, protection mechanisms (overload, short circuits, over/undervoltage), and the state machine.
- Balancer Driver — Communication with the balancer IC, which measures cell voltages and temperatures, and performs cell balancing.
- Temperature — Temperature measurement from external NTC sensors, on-board PTC sensors, and internal MCU sensors, with configurable limitation.
- Port Management — Configuration and protection for the charge and discharge ports.
- Current Limitation — Pack-level and port-level current limiting with CAN-based soft limiting.
- Sleep Management — Low-power sleep mode with configurable wake sources.
- Diagnostic — Runtime diagnostic logging, error tracking, and the
wtfcommand.