Bergsonne Labs

Power.L.1T

Li-Ion charge controller driver for the Power.L.1T tile (rev a).

Tile Details

Embeds the Texas Instruments BQ25150, a single-cell Li-Ion charge controller with programmable 1.8 V LDO output and 12-bit ADC for battery and system monitoring.

Key specifications:
  - Charge input:     3.4–5.5 V (up to 500 mA)
  - Battery voltage:  3.6–4.6 V (rechargeable Li-Ion)
  - LDO output:       1.8 V, up to 10 mA
  - ADC:              12-bit battery voltage monitoring
  - Charge current:   programmable, up to 500 mA
0x6B

Quick Start

Quick start

tiles_hal_core_cfg_t cfg = { .i2c = &hi2c1, .buses = TILES_BUS_I2C };
tiles_hal_t hal;
tiles_hal_core_init(&hal, &cfg);

tile_t battery;
tile_power_l_1t_init(&hal, 0, &battery);
if (tile_is_ready(&battery)) {
    uint16_t vbat = tile_power_l_1t_get_vbat(&battery);
    uint8_t  pct  = tile_power_l_1t_get_percent(&battery);
}

Initialization

uint8_t tile_power_l_1t_find(tiles_hal_t* hal, uint8_t instance);

Check whether a BQ25150 is present on the I2C bus.

Parameters
hal
Platform HAL handle
instance
Instance index (0 = default, see mapping table)
Returns

1 if device ACKs, 0 otherwise

void tile_power_l_1t_init(tiles_hal_t* hal, uint8_t instance, tile_t* tile);

Initialize the BQ25150 charge controller.

Verifies the device ID and configures charge current, precharge, undervoltage lockout, ADC, and disables ship mode.

Parameters
hal
Platform HAL handle
instance
Instance index (0 = default, see mapping table)
tile
Pointer to tile handle (populated by this function)

Data

uint16_t tile_power_l_1t_get_vbat(tile_t* tile);

Read the raw battery voltage from the ADC.

Parameters
tile
Pointer to tile handle
Returns

16-bit raw ADC value (MSB:LSB)

uint8_t tile_power_l_1t_get_percent(tile_t* tile);

Read the battery charge percentage.

Parameters
tile
Pointer to tile handle
Returns

Battery percentage (0–100)

uint8_t tile_power_l_1t_read_status(tile_t* tile, uint8_t reg);

Read a status register.

Parameters
tile
Pointer to tile handle
reg
Status register address (BQ25150_REG_STAT0/1/2)
Returns

8-bit register value

void tile_power_l_1t_write_reg(tile_t* tile, uint8_t reg, uint8_t value);

Write a raw 8-bit value to any BQ25150 register.

Parameters
tile
Pointer to tile handle
reg
8-bit register address
value
8-bit value to write

Auto-generated from tile_power_l_1t.h v2.0.0 — last synced 3/26/2026