PebbleOS
Loading...
Searching...
No Matches
Modules | Functions

Power management IC: power off, charger and supply monitoring. More...

Modules

 nPM1300
 Nordic nPM1300 PMIC configuration and extra operations.
 

Functions

bool pmic_init (void)
 Initialize the PMIC driver.
 
bool pmic_power_off (void)
 Power off the board.
 
bool pmic_enable_battery_measure (void)
 Enable the PMIC battery monitor.
 
bool pmic_disable_battery_measure (void)
 Disable the PMIC battery monitor.
 
bool pmic_set_charger_state (bool enable)
 Enable or disable battery charging.
 
bool pmic_is_charging (void)
 Check whether the battery is being charged.
 
bool pmic_is_usb_connected (void)
 Check whether a USB charger is connected.
 
void pmic_read_chip_info (uint8_t *chip_id, uint8_t *chip_revision, uint8_t *buck1_vset)
 Read chip information for tracking purposes.
 
uint16_t pmic_get_vsys (void)
 Measure VSYS.
 
void set_ldo3_power_state (bool enabled)
 Switch the LDO3 power rail.
 
void set_4V5_power_state (bool enabled)
 Switch the 4.5 V power rail.
 
void set_6V6_power_state (bool enabled)
 Switch the 6.6 V power rail.
 

Detailed Description

Power management IC: power off, charger and supply monitoring.

Functions returning bool report whether the PMIC could be accessed.

Function Documentation

◆ pmic_disable_battery_measure()

bool pmic_disable_battery_measure ( void  )

Disable the PMIC battery monitor.

Returns
true on success.

◆ pmic_enable_battery_measure()

bool pmic_enable_battery_measure ( void  )

Enable the PMIC battery monitor.

Disable it with pmic_disable_battery_measure() when readings are no longer needed.

Returns
true on success.

◆ pmic_get_vsys()

uint16_t pmic_get_vsys ( void  )

Measure VSYS.

Returns
VSYS in millivolts, or 0 on error.

◆ pmic_init()

bool pmic_init ( void  )

Initialize the PMIC driver.

Called once at startup.

Returns
true on success.

◆ pmic_is_charging()

bool pmic_is_charging ( void  )

Check whether the battery is being charged.

Once the battery is full it is no longer charging, even with the charger connected (see pmic_is_usb_connected()).

Returns
true while charging.

◆ pmic_is_usb_connected()

bool pmic_is_usb_connected ( void  )

Check whether a USB charger is connected.

Returns
true if VBUS is present.

◆ pmic_power_off()

bool pmic_power_off ( void  )

Power off the board.

All components lose power except the RTC, and the PMIC wakes the board on a button press. Fails while USB power is connected.

Returns
false if the board did not power off.

◆ pmic_read_chip_info()

void pmic_read_chip_info ( uint8_t *  chip_id,
uint8_t *  chip_revision,
uint8_t *  buck1_vset 
)

Read chip information for tracking purposes.

Parameters
[out]chip_idChip ID.
[out]chip_revisionChip revision.
[out]buck1_vsetBUCK1 voltage setting.

◆ pmic_set_charger_state()

bool pmic_set_charger_state ( bool  enable)

Enable or disable battery charging.

Parameters
enabletrue to enable charging.
Returns
true on success.

◆ set_4V5_power_state()

void set_4V5_power_state ( bool  enabled)

Switch the 4.5 V power rail.

Parameters
enabledtrue to power the rail.

◆ set_6V6_power_state()

void set_6V6_power_state ( bool  enabled)

Switch the 6.6 V power rail.

Parameters
enabledtrue to power the rail.

◆ set_ldo3_power_state()

void set_ldo3_power_state ( bool  enabled)

Switch the LDO3 power rail.

Parameters
enabledtrue to power the rail.