jlclab/tg28-esp

0.1.0

Latest
uploaded 9 hours ago
TG28-ESP power-management IC driver for ESP-IDF

Readme

# TG28-ESP

An ESP-IDF 6.2 I²C driver with 6.1 compatibility for TG28-ESP power management. It exposes supply and charge telemetry, regulator settings, charging configuration, interrupt handling, and power sequencing. The component has no dependency on the Candis BSP and can be used directly in another ESP-IDF application.

## Use in an application

Add a dependency on `components/tg28-esp` and include [`tg28_esp.h`](include/tg28_esp.h). Create the I²C master bus first. The standalone [`tg28` example](../../examples/tg28) is built without `candis`.

```c
#include "tg28_esp.h"

esp_err_t open_power_monitor(tg28_esp_t *pmu, i2c_master_bus_handle_t bus)
{
    const tg28_esp_config_t config = TG28_ESP_CONFIG_DEFAULT();
    return tg28_esp_open(pmu, bus, &config);
}
```

Pass a zero-initialized device object. Opening registers the I²C device and preserves OTP and reset settings. Check the device with `tg28_esp_check_chip_id()`, read its configuration, and call `tg28_esp_close()` before removing the bus.

Serialize each operation to the same PMU from task context. Match supply limits, charge settings, and rail sequencing to the board and battery. Protection changes and reset-capable operations require an explicit open option. Validate actual voltage, battery current, and temperature on the assembled system.

[Driver guide](https://github.com/jlclab-io/candis-bsp/blob/main/docs/en/tg28-esp-coverage.md) · [Read-only monitor](https://github.com/jlclab-io/candis-bsp/blob/main/examples/tg28/README.md) · [Changelog](CHANGELOG.md) · [Apache-2.0](LICENSE)

Links

Supports all targets

Tags

To add this component to your project, run:

idf.py add-dependency "jlclab/tg28-esp^0.1.0"

download archive

Stats

  • Archive size
    Archive size ~ 21.79 KB
  • Downloaded in total
    Downloaded in total 0 times
  • Downloaded this version
    This version: 0 times

Badge

jlclab/tg28-esp version: 0.1.0
|