PMIC (Power Management IC)

Power on configuration reg

This is register REG01. It controls whether charging or OTG (boost) mode is enabled, the minimum system voltage, and the I2C watchdog timer reset bit.

enableCharging()

bool enableCharging(void);

Enables battery charging (CHG_CONFIG = 01, REG01 bits 5:4). This is the default state when a battery is detected.

See also: SystemPowerFeature::DISABLE_CHARGING in the Power Manager API is the recommended way to control charging, since it also persists the setting and reapplies it at every boot. A direct call to enableCharging() only lasts until the Power Manager next re-applies its configuration.

disableCharging()

bool disableCharging(void);

Disables battery charging (CHG_CONFIG = 00, REG01 bits 5:4).

See also: SystemPowerFeature::DISABLE_CHARGING.

isChargingEnabled()

bool isChargingEnabled(void);

Returns true if charging is enabled (CHG_CONFIG = 01).

enableOTG()

bool enableOTG(void);

Enables OTG (On-The-Go) boost mode (CHG_CONFIG = 10/11, REG01 bits 5:4), which uses the battery to boost 5.1V out on the PMID pin. This has no equivalent in the Power Manager API.

Particle devices do not have the necessary external hardware to support USB OTG and you should never enable OTG boost mode in the PMIC.

disableOTG()

bool disableOTG(void);

Disables OTG boost mode.

resetWatchdog()

bool resetWatchdog(void);

Resets (feeds) the I2C watchdog timer (REG01 bit 6). The bq24195 has a watchdog timer, described in more detail under setWatchdog(), below, that resets all PMIC registers to their power-on defaults if it is not fed periodically. If you are changing PMIC settings directly rather than through the Power Manager, and the watchdog timer is enabled (the default is 40 seconds), you must call resetWatchdog() at least that often or your settings will silently revert.

setMinimumSystemVoltage()

bool setMinimumSystemVoltage(uint16_t voltage);

Sets the minimum system voltage (SYS_MIN, REG01 bits 3:1), in millivolts. This is the minimum voltage the PMIC will provide to the system rail (SYS) even when the battery is deeply discharged or removed. Valid values are 3000 to 3700, in 100 mV steps; the default is 3500 mV. This has no equivalent in the Power Manager API.

getMinimumSystemVoltage()

uint16_t getMinimumSystemVoltage();

Returns the currently configured minimum system voltage, in millivolts.

readPowerONRegister()

byte readPowerONRegister(void);

Returns the raw value of REG01.

reset()

void reset();

Resets all PMIC registers to their power-on default values (REG01 bit 7). Since the Power Manager reapplies its SystemPowerConfiguration settings at every boot and whenever System.setPowerConfiguration() is called, calling reset() while the Power Manager is enabled only has a lasting effect on settings that have no Power Manager equivalent.