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. Three discrete 0201 parts (Power-L1-N-a BOM), not an RGB package: U3 = APG015SURKKC-TT 631 nm red U4 = APG015SEKKC-TT 605 nm ORANGE (previously documented as "yellow") U5 = APG015CGKKC-TT 571 nm green

Driver mode assignment made by init(): LED0 → HOST mode (firmware "ready"/status) LED1 → CHARGING mode (auto, on while charging) LED2 → 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)

BATTERYDETECTED in BCHGCHARGESTATUS, a charger-domain bit: the datasheet states "CHARGER waits until a battery is detected before charging", i.e. detection runs as part of the charge cycle. With the charger disabled the bit reads 0 whether or not a cell is fitted — measured on the bench with a battery physically attached (0 before enable, 1 after). Do NOT gate a charge-enable decision on this; that deadlocks. Enable charging first, poll this for a second or two, and disable again if nothing appears. Note also that get_vbat_mv() cannot substitute: an open battery terminal reads a plausible ~3 V once charger current has pushed the VBAT decoupling cap up.

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 · 6

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.
advancedVBUS input current limit (ILIM)Driver-deferred. The nPM1300 boots with a 100 mA VBUS input limit, and VBUSINILIM0 (VBUSIN base 0x0200, offset 0x1) plus the TASKUPDATEILIMSW commit are not exposed, so it cannot be raised for a 500 mA USB or a 1500 mA USB-C supply. This is not cosmetic: measured on the bench, enabling a 100 mA charge collapsed VSYS from 5.15 V to ~3.65 V as input current hit the limit (datasheet Fig. 6). Both bucks stayed in regulation — VSYSMIN is 2.7 V — but headroom on a 3.3 V VOUT2 drops to ~350 mV, and a load with a startup surge can brown the rail out entirely (see the Sense.CAM.P bring-up).

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_PATCH1
NPM1300_I2C_ADDR0x6B