BERGSONNE

Power.L.1N

Power.L.1N tile driver — Nordic nPM1300 PMIC.

Battery charger + 2 buck regulators + system supply (VSYS) + 3 indicator LEDs. Platform-agnostic: all bus access goes through tiles_pal_t.

The bucks come up at fixed boot voltages chosen by the tile's VSET pulldown resistors (no I2C needed): VSET1 = 47 kΩ → VOUT1 = 1.8 V, VSET2 = 330 kΩ → VOUT2 = 3.3 V. buck_set_mv() switches a buck to software control to override its VSET default at runtime.

Tile LEDs (physical colours, per the tile schematic): LED0 = GREEN → driven in HOST mode (firmware "ready"/status) LED1 = YELLOW → driven in CHARGING mode (auto, on while charging) LED2 = RED → driven in ERROR mode (auto, on for charger faults)

Examples

Quick start

  #include "core_tiles.h"

  tile_t pmic;
  tile_power_l_1n_init(core_tiles_pal(&core_i2c1), 0, &pmic, NULL);
  if (tile_is_ready(&pmic)) {
      tile_power_l_1n_set_charge_current_ma(&pmic, 200);
      tile_power_l_1n_charger_enable(&pmic, 1);
      uint16_t vbat = tile_power_l_1n_get_vbat_mv(&pmic);
      (void)vbat;
  }

API reference

Initialization

tile_power_l_1n_find

uint8_t tile_power_l_1n_find(tiles_pal_t* hal, uint8_t instance)

Check whether an nPM1300 is present on the I2C bus.

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

Returns 1 if the device ACKs, 0 otherwise

tile_power_l_1n_init

void tile_power_l_1n_init(tiles_pal_t* hal, uint8_t instance, tile_t* tile, const power_l_1n_cfg_t* cfg)

Sets the indicator LED modes (LED0=HOST, LED1=CHARGING, LED2=ERROR), disables NTC monitoring (no thermistor on this tile), and applies the charger settings. The buck regulators are left at their boot voltages (1.8 V / 3.3 V, fixed by the VSET resistors) — they are already up. Pass cfg=NULL for defaults (100 mA, 4.20 V, charging enabled).

hal
Platform HAL handle
instance
Instance index (0 = default, see mapping table)
tile
Pointer to tile handle (populated by this function)
cfg
Optional config, or NULL for defaults

Runtime

tile_power_l_1n_get_charge_status

Studio
uint8_t tile_power_l_1n_get_charge_status(tile_t* tile)

Read the raw charge-status register.

Returns BCHGCHARGESTATUS bits (NPM1300_CHG_* mask).

tile_power_l_1n_get_charge_error

Studio
uint8_t tile_power_l_1n_get_charge_error(tile_t* tile)

Read the charger error-reason register.

Returns BCHGERRREASON bits (0 = no error).

tile_power_l_1n_is_charging

Studio
uint8_t tile_power_l_1n_is_charging(tile_t* tile)

Whether the charger is actively charging (trickle / CC / CV).

Returns 1 if charging, 0 otherwise.

tile_power_l_1n_is_charge_complete

Studio
uint8_t tile_power_l_1n_is_charge_complete(tile_t* tile)

Whether charging has completed (battery full).

Returns 1 if charge complete, 0 otherwise.

tile_power_l_1n_battery_present

Studio
uint8_t tile_power_l_1n_battery_present(tile_t* tile)

Whether a battery is detected.

Returns 1 if a battery is present, 0 otherwise.

tile_power_l_1n_get_vbat_mv

Studio
uint16_t tile_power_l_1n_get_vbat_mv(tile_t* tile)

Measure the battery voltage.

Returns VBAT in millivolts (0-5000).

tile_power_l_1n_get_vsys_mv

Studio
uint16_t tile_power_l_1n_get_vsys_mv(tile_t* tile)

Measure the system (VSYS) voltage.

Returns VSYS in millivolts (0-6375).

tile_power_l_1n_get_die_temp_c

Studio
int16_t tile_power_l_1n_get_die_temp_c(tile_t* tile)

Measure the PMIC die temperature.

Returns Die temperature in degrees Celsius.

tile_power_l_1n_led_set

Studio
void tile_power_l_1n_led_set(tile_t* tile, uint8_t led, uint8_t on)

Only effective when the LED is in HOST mode (see led_set_mode).

led
0, 1 or 2.
on
1 = on, 0 = off.

Config

tile_power_l_1n_charger_enable

Studio
void tile_power_l_1n_charger_enable(tile_t* tile, uint8_t on)

Enable or disable battery charging.

on
1 = enable charging, 0 = disable.

tile_power_l_1n_set_charge_current_ma

Studio
void tile_power_l_1n_set_charge_current_ma(tile_t* tile, uint16_t ma)

Programmable 32-800 mA in 2 mA steps; out-of-range values clamp.

ma
[32..800] Charge current in milliamps.

tile_power_l_1n_set_term_mv

Studio
void tile_power_l_1n_set_term_mv(tile_t* tile, uint16_t mv)

Selectable 3.50-3.65 V or 4.00-4.45 V in 50 mV steps; the 3.70-3.95 V gap is not supported and clamps to 3.65 V.

mv
Termination voltage in millivolts (e.g. 4200).

tile_power_l_1n_buck_enable

Studio
void tile_power_l_1n_buck_enable(tile_t* tile, uint8_t buck, uint8_t on)

Enable or disable a buck regulator.

buck
1 (VOUT1) or 2 (VOUT2).
on
1 = enable, 0 = disable.

tile_power_l_1n_buck_set_mv

Studio
void tile_power_l_1n_buck_set_mv(tile_t* tile, uint8_t buck, uint16_t mv)

Selects software voltage control for that buck (overriding its VSET resistor) and applies the new target.

buck
1 (VOUT1) or 2 (VOUT2).
mv
[1000..3300] Output voltage in mV, 100 mV steps.

tile_power_l_1n_led_set_mode

Studio
void tile_power_l_1n_led_set_mode(tile_t* tile, uint8_t led, power_l_1n_led_mode_t mode)

LED0 is green, LED1 yellow, LED2 red. In auto modes (ERROR/CHARGING) the charger drives the LED directly; HOST mode hands control to led_set().

led
0, 1 or 2.
mode
power_l_1n_led_mode_t.

Advanced

tile_power_l_1n_get_reset_cause

Studio
uint8_t tile_power_l_1n_get_reset_cause(tile_t* tile)

Read the reset-cause register (why the PMIC last reset).

Returns RSTCAUSE bits.

Driver gaps · 5

Chip capabilities this driver doesn’t expose yet.

advancedNTC battery thermistorHardware-gated (not a driver gap). The nPM1300 can sense battery temperature via an NTC thermistor for JEITA charge regulation. NTC is tied to GND on Power-L-1N-a (no thermistor fitted), so the driver disables NTC monitoring (ADCNTCRSEL=0, DISABLENTC). Closing requires a tile hardware revision.
nicheLoad switches / LDOs (LSIN/LSOUT)Hardware-gated (not a driver gap). The nPM1300's two load-switch/LDO outputs are tied off (LSIN1/2, LSOUT1/2 grounded) on this tile, so there's nothing to control.
nicheGPIO0-3Hardware-gated (not a driver gap). The nPM1300 GPIOs aren't routed to tile pads on Power-L-1N-a, so there's no externally useful GPIO function.
advancedShip / hibernate modeDriver-deferred. The chip supports ultra-low-power ship/hibernate modes (battery disconnect for storage). Not yet exposed — the ship-mode task register address needs datasheet confirmation before wiring.
nichePOF warning + buck retention / forced-PWMDriver-deferred. Power-fail early-warning (via GPIO) and buck retention-voltage / forced-PWM modes aren't exposed yet.

Events

charge_complete
charging

Enums

power_l_1n_led_mode_t

LED indicator mode (LEDDRVxMODESEL).

NPM1300_LED_ERROR
auto: on for charger error
NPM1300_LED_CHARGING
auto: on while charging
NPM1300_LED_HOST
software-controlled via led_set()
NPM1300_LED_NOTUSED
disabled

Constants

TILE_POWER_L_1N_VERSION_MAJOR1
TILE_POWER_L_1N_VERSION_MINOR0
TILE_POWER_L_1N_VERSION_PATCH0
NPM1300_I2C_ADDR0x6B