Maxim Integrated / MAX14720

Dependents:   HSP_PMIC_Demo HSP_SpO2 HSP_ECG HSP_ECG_LeadOFF_Detection

Fork of MAX14720 by Greg Steiert

Embed: (wiki syntax)

« Back to documentation index

MAX14720 Class Reference

MAX14720 Class Reference

MAX14720 Power-Management Solution Driver. More...

#include <MAX14720.h>

Public Types

enum  registers_t {
  REG_CHIP_ID = 0x00, REG_CHIP_REV = 0x01, REG_BOOST_CDIV = 0x03, REG_BOOST_ISET = 0x04,
  REG_BOOST_VSET = 0x05, REG_BOOST_CFG = 0x06, REG_BUCK_VSET = 0x07, REG_BUCK_CFG = 0x08,
  REG_BUCK_ISET = 0x09, REG_LDO_VSET = 0x0A, REG_LDO_CFG = 0x0B, REG_SWITCH_CFG = 0x0C,
  REG_BAT_TIME = 0x0D, REG_BAT_CFG = 0x0E, REG_BAT_BCV = 0x0F, REG_BAT_OCV = 0x10,
  REG_BAT_LCV = 0x11, REG_MON_CFG = 0x19, REG_BOOT_CFG = 0x1A, REG_PIN_STAT = 0x1B,
  REG_BBB_EXTRA = 0x1C, REG_HANDSHK = 0x1D, REG_UVLO_CFG = 0x1E, REG_PWR_OFF = 0x1F
}
 

Register Addresses.

More...
enum  boostISet_t {
  BOOST_ISET_MIN, BOOST_ISET_50mA, BOOST_ISET_100mA, BOOST_ISET_150mA,
  BOOST_ISET_200mA, BOOST_ISET_250mA, BOOST_ISET_300mA, BOOST_ISET_350mA
}
 

Boost Peak Current Settings.

More...
enum  boostEn_t { BOOST_DISABLED, BOOST_ENABLED, BOOST_EN_MPC }
 

Boost Enable Mode.

More...
enum  buckMd_t { BUCK_BURST, BUCK_FPWM, BUCK_MPC_FPWM }
 

Buck Operating Modes.

More...
enum  buckISet_t {
  BUCK_ISET_50mA, BUCK_ISET_100mA, BUCK_ISET_150mA, BUCK_ISET_200mA,
  BUCK_ISET_250mA, BUCK_ISET_300mA, BUCK_ISET_350mA, BUCK_ISET_400mA
}
 

Buck Peak Current Settings.

More...
enum  monCfg_t {
  MON_PULLDOWN = 0x00, MON_HI_Z = 0x08, MON_SWIN = 0x80, MON_SWOUT = 0x81,
  MON_BIN = 0x82, MON_BOUT = 0x83, MON_HVIN = 0x84, MON_HVOUT = 0x85,
  MON_LIN = 0x86, MON_LOUT = 0x87
}
 

Monitor Configurations.

More...
enum  uvloIn_t { LIN_UVLO, BIN_UVLO }
 

Under-Voltage Lock Out Input.

More...

Public Member Functions

 MAX14720 (PinName sda, PinName scl, int slaveAddress)
 MAX14720 constructor.
 MAX14720 (I2C *i2c, int slaveAddress)
 MAX14720 constructor.
 ~MAX14720 ()
 MAX14720 destructor.
int init ()
 Initialize MAX14720.
int boostSetVoltage (int mV)
 Set the Boost Voltage.
int boostSetMode (boostEn_t mode)
 Set Boost Enable Mode.
int monSet (monCfg_t monCfg)
 Configure Mon Pin.
int shutdown ()
 Shutdown.
int writeReg (registers_t reg, char value)
 Write Register.
int readReg (registers_t reg, char *value)
 Read Register.

Data Fields

bool clkDivEn
 Boost Clock Divider Enable: default 0 - Disabled, 1 - Enabled.
int clkDivSet
 Boost Clock Divider Setting: default 0, The clock is divided by this value +10 when enabled.
boostISet_t boostISet
 Boost Peak Current Setting: default BOOST_ISET_100mA.
int boostMillivolts
 Boost Voltage in millivolts: default 3300.
boostEn_t boostEn
 Boost Enable Mode: default BOOST_DISABLED.
bool boostEMI
 Boost EMI Setting: default 0 - EMI damping active (lower noise), 1 - Damping disabled (more efficient)
bool boostInd
 Boost Inductor Setting: default 0 - 4.7uH, 1 - 3.3uH.
bool boostHysOff
 Boost Hysteresis Off: default 0 - Hysteresis enabled (more efficient), 1 - Hysteresis off (lower voltage ripple)
bool boostPasDsc
 Boost Passive Discharge: default 0 - Disabled, 1 - Enabled when boost disabled.
bool boostActDsc
 Boost Active Discharge: default 0 - Disabled, 1 - Enabled when boost disabled.
buckMd_t buckMd
 Buck Operating Mode: default BUCK_BURST.
bool buckFst
 Buck Fast Start: default 0 - Normal startup current limit, 1 - Double startup current for fast start.
buckISet_t buckISet
 Buck Peak Current Setting: default BUCK_ISET_300mA.
bool buckCfg
 Buck Configuration: default 0 - For burst mode, 1 - For FPWM mode.
bool buckInd
 Buck Inductor Setting: default 0 - 2.2uH, 1 - 4.7uH.
bool buckHysOff
 Buck Hysteresis Off: default 0 - Hysteresis enabled (more efficient), 1 - Hysteresis off (lower voltage ripple)
bool buckMinOT
 Buck Minimum On Time: default 1 - Disable deglitch delay (lower voltage ripple), 0 - Enable deglitch dealy (more efficient)
bool buckInteg
 Buck Integrate: default 1 - Better load regulation at higher current (recommended for output capacitance >6uF), 0 - More stable operation with smaller output capacitor.
bool buckPasDsc
 Buck Passive Discharge: default 0 - Disabled, 1 - Enabled when buck disabled.
bool buckActDsc
 Buck Active Discharge: default 0 - Disabled, 1 - Enabled when buck disabled.
bool buckFScl
 Buck Fet Scaling: default 0 - Full buck FET after soft start (more efficient for larger loads), 1 - Reduced buck FET while active (lower quiescent current for light loads)

Detailed Description

MAX14720 Power-Management Solution Driver.

The MAX14720/MAX14750 are compact power-management solutions for space-constrained, battery-powered applications where size and efficiency are critical. Both devices integrate a power switch, a linear regulator, a buck regulator, and a buck-boost regulator.
https://www.maximintegrated.com/en/products/power/battery-management/MAX14720.html

 #include "mbed.h"
 #include "MAX14720.h"

 // I2C Master 2
 I2C i2c2(I2C2_SDA, I2C2_SCL);

 #define  I2C_ADDR_PMIC   (0x54)
 MAX14720 max14720(&i2c2, I2C_ADDR_PMIC);

 DigitalOut led(LED1, 0);
 InterruptIn button(SW1);

 void turnOff()
 {
     max14720.shutdown();
 }

 int main()
 {
     button.fall(&turnOff);

     max14720.boostEn = MAX14720::BOOST_ENABLED;
     if (max14720.init() == MAX14720_ERROR) {
         printf("Error initializing MAX14720");
     }

     wait(1);

     while(1) {
         max14720.boostSetMode(MAX14720::BOOST_DISABLED);
         max14720.boostEn = MAX14720::BOOST_ENABLED;
         wait(0.5);
         max14720.boostSetVoltage(2500);
         wait(0.5);
         max14720.boostSetVoltage(5000);
         wait(0.5);
     }
 }

Definition at line 96 of file MAX14720.h.


Member Enumeration Documentation

enum boostEn_t

Boost Enable Mode.

Enumerated enable modes for boost regulator

Enumerator:
BOOST_DISABLED 

Boost Disabled.

BOOST_ENABLED 

Boost Enabled.

BOOST_EN_MPC 

Boost Enabled by MPC pin.

Definition at line 150 of file MAX14720.h.

Boost Peak Current Settings.

Enumerated peak current settings for boost regulator

Enumerator:
BOOST_ISET_MIN 

Minimum On-Time.

BOOST_ISET_50mA 

50mA Peak Current

BOOST_ISET_100mA 

100mA Peak Current

BOOST_ISET_150mA 

150mA Peak Current

BOOST_ISET_200mA 

200mA Peak Current

BOOST_ISET_250mA 

250mA Peak Current

BOOST_ISET_300mA 

300mA Peak Current

BOOST_ISET_350mA 

350mA Peak Current

Definition at line 135 of file MAX14720.h.

enum buckISet_t

Buck Peak Current Settings.

Enumerated peak current settings for buck regulator

Enumerator:
BUCK_ISET_50mA 

50mA Peak Current

BUCK_ISET_100mA 

100mA Peak Current

BUCK_ISET_150mA 

150mA Peak Current

BUCK_ISET_200mA 

200mA Peak Current

BUCK_ISET_250mA 

250mA Peak Current

BUCK_ISET_300mA 

300mA Peak Current

BUCK_ISET_350mA 

350mA Peak Current

BUCK_ISET_400mA 

400mA Peak Current

Definition at line 170 of file MAX14720.h.

enum buckMd_t

Buck Operating Modes.

Enumerated operating modes for buck regulator

Enumerator:
BUCK_BURST 

Burst Mode Operation.

BUCK_FPWM 

Forced PWM Operation.

BUCK_MPC_FPWM 

MPC activated Forced PWM.

Definition at line 160 of file MAX14720.h.

enum monCfg_t

Monitor Configurations.

Enumerated configuration modes for monitor multiplexer

Enumerator:
MON_PULLDOWN 

Pulled down by 100k Ohm.

MON_HI_Z 

High Impedance.

MON_SWIN 

SWIN Selected.

MON_SWOUT 

SWOUT Selected.

MON_BIN 

BIN Selected.

MON_BOUT 

BOUT Selected.

MON_HVIN 

HVIN Selected.

MON_HVOUT 

HVOUT Selected.

MON_LIN 

LIN Selected.

MON_LOUT 

LOUT Selected.

Definition at line 185 of file MAX14720.h.

Register Addresses.

Enumerated MAX14720 register addresses

Enumerator:
REG_CHIP_ID 

Chip ID.

REG_CHIP_REV 

Chip Revision.

REG_BOOST_CDIV 

Boost Clock Divider.

REG_BOOST_ISET 

Boost Peak Current.

REG_BOOST_VSET 

Boost Voltage Setting.

REG_BOOST_CFG 

Boost Configuration.

REG_BUCK_VSET 

Buck Voltage Setting.

REG_BUCK_CFG 

Buck Configuration.

REG_BUCK_ISET 

Buck Peak Current and Settings.

REG_LDO_VSET 

LDO Voltage Setting.

REG_LDO_CFG 

LDO Configuration.

REG_SWITCH_CFG 

Switch Configuration.

REG_BAT_TIME 

Battery Impedance Timing.

REG_BAT_CFG 

Battery Impedance Configuration.

REG_BAT_BCV 

Battery Cell Voltage.

REG_BAT_OCV 

Open Cell Voltage.

REG_BAT_LCV 

Loaded Cell Voltage.

REG_MON_CFG 

Monitor Multiplexer Configuration.

REG_BOOT_CFG 

Boot Configuration.

REG_PIN_STAT 

Pin Status.

REG_BBB_EXTRA 

Buck/Buck-Boost Extra.

REG_HANDSHK 

Power-On Handshake.

REG_UVLO_CFG 

Under-Voltage Lock Out.

REG_PWR_OFF 

Power Off Command.

Definition at line 104 of file MAX14720.h.

enum uvloIn_t

Under-Voltage Lock Out Input.

Enumerated input selection options for UVLO

Enumerator:
LIN_UVLO 

LIN used to determine UVLO condition.

BIN_UVLO 

BIN used to determine UVLO condition.

Definition at line 202 of file MAX14720.h.


Constructor & Destructor Documentation

MAX14720 ( PinName  sda,
PinName  scl,
int  slaveAddress 
)

MAX14720 constructor.

Parameters:
sdambed pin to use for SDA line of I2C interface.
sclmbed pin to use for SCL line of I2C interface.
slaveAddressSlave Address of the device.

Definition at line 37 of file MAX14720.cpp.

MAX14720 ( I2C *  i2c,
int  slaveAddress 
)

MAX14720 constructor.

Parameters:
i2cI2C object to use.
slaveAddressSlave Address of the device.

Definition at line 65 of file MAX14720.cpp.

~MAX14720 (  )

MAX14720 destructor.

Definition at line 94 of file MAX14720.cpp.


Member Function Documentation

int boostSetMode ( boostEn_t  mode )

Set Boost Enable Mode.

Sets the enable mode for the boost regulator

Parameters:
modeThe enable mode for the boost regulator
Returns:
0 if no errors, -1 if error.

Definition at line 102 of file MAX14720.cpp.

int boostSetVoltage ( int  mV )

Set the Boost Voltage.

Sets the voltage for the boost regulator. The voltage is specified in millivolts. The MAX14720 cannot update the voltage when enabled. This function checks the local boostEn variable and if the regualtor is enabled it will send the disable command before sending the new voltage and re-enable the boost regulator after the new voltage is written.

Parameters:
mVvoltage for boost regualtor in millivolts
Returns:
0 if no errors, -1 if error.

Definition at line 112 of file MAX14720.cpp.

int init (  )

Initialize MAX14720.

Applies settings to MAX14720. Settings are stored in public variables. The variables are pre-loaded with the most common configuation. Assign new values to the public variables before calling init. This will update all the settings including the boost voltage from boostMillivolts and the boost enable mode from boostEn.

Returns:
0 if no errors, -1 if error.

Definition at line 144 of file MAX14720.cpp.

int monSet ( monCfg_t  monCfg )

Configure Mon Pin.

Configures the operating mode of the monitor multiplexer

Parameters:
monCfgThe configuration mode for the monitor pin
Returns:
0 if no errors, -1 if error.

Definition at line 189 of file MAX14720.cpp.

int readReg ( registers_t  reg,
char *  value 
)

Read Register.

Reads from the specified register

Parameters:
regThe register to be read
valuePointer for where to store the data
Returns:
0 if no errors, -1 if error.

Definition at line 214 of file MAX14720.cpp.

int shutdown (  )

Shutdown.

Sends the command to turn off all supplies and put the part in battery saving shelf mode.

Returns:
0 if no errors, -1 if error.

Definition at line 195 of file MAX14720.cpp.

int writeReg ( registers_t  reg,
char  value 
)

Write Register.

Writes the given value to the specified register. Note, this function provides direct access to the registers without any awareness or effect on the settings stored in the public variables. This is used by the other functions to set the values inside the MAX14720. Calling this outside of the other functions can break the synchronization of the variables to the state of the MAX14720.

Parameters:
regThe register to be written
valueThe data to be written
Returns:
0 if no errors, -1 if error.

Definition at line 202 of file MAX14720.cpp.


Field Documentation

Boost Active Discharge: default 0 - Disabled, 1 - Enabled when boost disabled.

Definition at line 322 of file MAX14720.h.

bool boostEMI

Boost EMI Setting: default 0 - EMI damping active (lower noise), 1 - Damping disabled (more efficient)

Definition at line 314 of file MAX14720.h.

Boost Enable Mode: default BOOST_DISABLED.

Definition at line 312 of file MAX14720.h.

Boost Hysteresis Off: default 0 - Hysteresis enabled (more efficient), 1 - Hysteresis off (lower voltage ripple)

Definition at line 318 of file MAX14720.h.

bool boostInd

Boost Inductor Setting: default 0 - 4.7uH, 1 - 3.3uH.

Definition at line 316 of file MAX14720.h.

Boost Peak Current Setting: default BOOST_ISET_100mA.

Definition at line 308 of file MAX14720.h.

Boost Voltage in millivolts: default 3300.

Definition at line 310 of file MAX14720.h.

Boost Passive Discharge: default 0 - Disabled, 1 - Enabled when boost disabled.

Definition at line 320 of file MAX14720.h.

bool buckActDsc

Buck Active Discharge: default 0 - Disabled, 1 - Enabled when buck disabled.

Definition at line 342 of file MAX14720.h.

bool buckCfg

Buck Configuration: default 0 - For burst mode, 1 - For FPWM mode.

Definition at line 330 of file MAX14720.h.

bool buckFScl

Buck Fet Scaling: default 0 - Full buck FET after soft start (more efficient for larger loads), 1 - Reduced buck FET while active (lower quiescent current for light loads)

Definition at line 344 of file MAX14720.h.

bool buckFst

Buck Fast Start: default 0 - Normal startup current limit, 1 - Double startup current for fast start.

Definition at line 326 of file MAX14720.h.

bool buckHysOff

Buck Hysteresis Off: default 0 - Hysteresis enabled (more efficient), 1 - Hysteresis off (lower voltage ripple)

Definition at line 334 of file MAX14720.h.

bool buckInd

Buck Inductor Setting: default 0 - 2.2uH, 1 - 4.7uH.

Definition at line 332 of file MAX14720.h.

bool buckInteg

Buck Integrate: default 1 - Better load regulation at higher current (recommended for output capacitance >6uF), 0 - More stable operation with smaller output capacitor.

Definition at line 338 of file MAX14720.h.

Buck Peak Current Setting: default BUCK_ISET_300mA.

Definition at line 328 of file MAX14720.h.

Buck Operating Mode: default BUCK_BURST.

Definition at line 324 of file MAX14720.h.

bool buckMinOT

Buck Minimum On Time: default 1 - Disable deglitch delay (lower voltage ripple), 0 - Enable deglitch dealy (more efficient)

Definition at line 336 of file MAX14720.h.

bool buckPasDsc

Buck Passive Discharge: default 0 - Disabled, 1 - Enabled when buck disabled.

Definition at line 340 of file MAX14720.h.

bool clkDivEn

Boost Clock Divider Enable: default 0 - Disabled, 1 - Enabled.

Definition at line 304 of file MAX14720.h.

int clkDivSet

Boost Clock Divider Setting: default 0, The clock is divided by this value +10 when enabled.

Definition at line 306 of file MAX14720.h.