Qwiic_MAX1704X_Py  2.0.0-1-g99d01a0
Python for SFE Qwiic MAX1704X
Loading...
Searching...
No Matches
qwiic_max1704x.QwiicMAX1704X Class Reference
Inheritance diagram for qwiic_max1704x.QwiicMAX1704X:

Public Member Functions

def __init__ (self, address=None, i2c_driver=None, device_type=kDeviceTypeMAX17043)
 Constructor. More...
 
def is_connected (self)
 Determines if this device is connected. More...
 
def begin (self)
 Initializes this device with default parameters. More...
 
def set_device (self, device_type)
 Set the device type. More...
 
def quick_start (self)
 A quick-start allows the MAX17043 to restart fuel-gauge calculations in the same manner as initial power-up of the IC. More...
 
def get_voltage (self)
 Get the MAX17043's voltage reading. More...
 
def get_soc (self)
 get_soc() - Get the MAX17043's state-of-charge (SOC) reading, as calculated by the IC's "ModelGauge" algorithm. More...
 
def get_version (self)
 Get the MAX17043's version number. More...
 
def get_id (self)
 get_id() - (MAX17048/49) Returns 8-bit OTP bits set at factory. More...
 
def set_reset_voltage_threshold (self, threshold)
 set_reset_voltage_threshold(threshold) - (MAX17048/49) Set the 7-bit VRESET value. More...
 
def set_reset_voltage_volts (self, threshold_volts)
 Helper function to set the reset voltage threshold in volts. More...
 
def enable_comparator (self)
 enable_comparator() - (MAX17048/49) Set bit in VRESET/ID reg Comparator is enabled by default. More...
 
def disable_comparator (self)
 disable_comparator() - (MAX17048/49) Clear bit in VRESET/ID reg Disable the analog comparator, saves 0.5uA in hibernate mode. More...
 
def get_change_rate (self)
 get_change_rate() - (MAX17048/49) Get rate of change per hour in % Output: (signed) Float (that is the 0.208% * CRATE register value) A positive rate is charging, negative is discharge. More...
 
def get_status (self)
 (MAX17048/49) Get the 7 bits of status register More...
 
def clear_status_reg_bits (self, mask)
 clear_status_reg_bits() - (MAX17048/49) Clear the specified mask in the status reg More...
 
def is_reset (self, clear=False)
 is_reset() - (MAX17048/49) Check if the reset bit is set in the status register More...
 
def is_voltage_high (self, clear=False)
 is_voltage_high() - (MAX17048/49) Check if the voltage high bit is set in the status register More...
 
def is_voltage_low (self, clear=False)
 is_voltage_low() - (MAX17048/49) Check if the voltage low bit is set in the status register More...
 
def is_voltage_reset (self, clear=False)
 is_voltage_reset() - (MAX17048/49) Check if the voltage reset bit is set in the status register More...
 
def is_low (self, clear=False)
 is_low() - (MAX17048/49) Check if the low bit is set in the status register More...
 
def is_change (self, clear=False)
 is_change() - (MAX17048/49) Check if the change bit is set in the status register More...
 
def clear_alert (self)
 clearAlert() - Clear the MAX1704X's ALRT alert flag. More...
 
def get_alert (self, clear=False)
 get_alert() - Check if the MAX1704X's ALRT alert interrupt has been triggered. More...
 
def enable_soc_alert (self)
 enable_soc_alert() - (MAX17048/49) Enable the SOC change alert More...
 
def disable_soc_alert (self)
 disable_soc_alert() - (MAX17048/49) Disable the SOC change alert More...
 
def enable_alert (self)
 enable_alert() - Enable the MAX1704X's VRESET Alert More...
 
def disable_alert (self)
 disable_alert() - Disable the MAX1704X's VRESET Alert More...
 
def get_threshold (self)
 get_threshold() - Get the MAX17043's current percentage threshold that will trigger an alert. More...
 
def set_threshold (self, percent=4)
 set_threshold() - Set the MAX17043's percentage threshold that will trigger an alert. More...
 
def sleep (self)
 sleep() - Set the MAX17043 into sleep mode. More...
 
def wake (self)
 wake() - Wake the MAX17043 up from sleep. More...
 
def reset (self)
 Issue a Power-on-reset command to the MAX17043. More...
 
def get_compensation (self)
 get_compensation() - Get the ModelGauge compensation value - an obscure 8-bit value set to 0x97 by default. More...
 
def set_compensation (self, newCompensation)
 set_compensation(newCompensation) - Set the 8-bit compensation value. More...
 
def set_valrt_max (self, threshold=0xFF)
 Set the MAX17048/49 VALRT Maximum threshold. More...
 
def set_valrt_max_volts (self, threshold_volts=5.1)
 Helper function to set the MAX17048/49 VALRT Maximum threshold in volts. More...
 
def get_valrt_max (self)
 Get the MAX17048/49 VALRT Maximum threshold LSb = 20mV. More...
 
def set_valrt_min (self, threshold=0x00)
 Set the MAX17048/49 VALRT Minimum threshold. More...
 
def set_valrt_min_volts (self, threshold_volts=0.0)
 Helper function to set the MAX17048/49 VALRT Minimum threshold in volts. More...
 
def get_valrt_min (self)
 Get the MAX17048/49 VALRT Minimum threshold LSb = 20mV. More...
 
def is_hibernating (self)
 is_hibernating() - (MAX17048/49) Check if the IC is in hibernate mode More...
 
def get_hibrt_act_thr (self)
 get_hibrt_act_thr() - (MAX17048/49) Read and return the MAX17048/49 HIBRT Active Threshold LSb = 1.25mV More...
 
def set_hibrt_act_thr (self, threshold)
 Set the MAX17048/49 HIBRT Active Threshold LSb = 1.25mV. More...
 
def get_hibrt_act_thr_volts (self, threshold_volts)
 Helper function to set the MAX17048/49 HIBRT ACT Threshold in volts. More...
 
def get_hibrt_hib_thr (self)
 get_hibrt_hib_thr() - (MAX17048/49) Read and return the MAX17048/49 HIBRT Hibernate Threshold LSb = 1.25mV More...
 
def set_hibrt_hib_thr (self, threshold)
 Set the MAX17048/49 HIBRT Hibernate Threshold LSb = 1.25mV. More...
 
def get_hibrt_hib_thr_percent (self, threshold_percent)
 Helper function to set the MAX17048/49 HIBRT Hibernate Threshold in percent LSb = 0.208%/hr. More...
 
def enable_hibernate (self)
 enable_hibernate() - (MAX17048/49) Enable hibernate mode More...
 
def disable_hibernate (self)
 disable_hibernate() - (MAX17048/49) Disable hibernate mode More...
 
def write16 (self, address, register, data)
 Write 16-bit data to a register (big-endian) More...
 
def read16 (self, address, register)
 Read 16-bit data from a register (big-endian) More...
 

Public Attributes

 address
 

Static Public Attributes

 device_name = _DEFAULT_NAME
 
 available_addresses = _AVAILABLE_I2C_ADDRESS
 
int kDeviceTypeMAX17043 = 0
 
int kDeviceTypeMAX17044 = 1
 
int kDeviceTypeMAX17048 = 2
 
int kDeviceTypeMAX17049 = 3
 
int kRegVcell = 0x02
 
int kRegSoc = 0x04
 
int kRegMode = 0x06
 
int kRegVersion = 0x08
 
int kRegHibRt = 0x0A
 
int kRegConfig = 0x0C
 
int kRegCValrt = 0x14
 
int kRegCRate = 0x16
 
int kRegVResetId = 0x18
 
int kRegStatus = 0x1A
 
int kRegCommand = 0xFE
 
int kModeQuickStart = 0x4000
 
int kModeEnSleep = 0x2000
 
int kModeHibStat = 0x1000
 
int kVResetIdVResetShift = 9
 
int kVResetIdVResetMask = 0x7F << kVResetIdVResetShift
 
int kVResetIdComparatorDisShift = 8
 
int kVResetIdComparatorDisMask = 0x01 << kVResetIdComparatorDisShift
 
int kStatusShift = 8
 
int kStatusMask = 0x7F << kStatusShift
 
int kStatusRiShift = 8
 
int kStatusRiMask = 0x01 << kStatusRiShift
 
int kStatusVhShift = 9
 
int kStatusVhMask = 0x01 << kStatusVhShift
 
int kStatusVlShift = 10
 
int kStatusVlMask = 0x01 << kStatusVlShift
 
int kStatusVrShift = 11
 
int kStatusVrMask = 0x01 << kStatusVrShift
 
int kStatusHdShift = 12
 
int kStatusHdMask = 0x01 << kStatusHdShift
 
int kStatusScShift = 13
 
int kStatusScMask = 0x01 << kStatusScShift
 
int kStatusEnVrShift = 14
 
int kStatusEnVrMask = 0x01 << kStatusEnVrShift
 
int kConfigAlertShift = 5
 
int kConfigAlertMask = 0x01 << kConfigAlertShift
 
int kConfigSocAlertShift = 6
 
int kConfigSocAlertMask = 0x01 << kConfigSocAlertShift
 
int kConfigSleepShift = 7
 
int kConfigSleepMask = 0x01 << kConfigSleepShift
 
int kConfigThresholdShift = 0
 
int kConfigThresholdMask = 0x1F << kConfigThresholdShift
 
int kConfigCompShift = 8
 
int kConfigCompMask = 0xFF << kConfigCompShift
 
int kMax17048HibRtEnHib = 0xFFFF
 
int kMax17048HibRtDisHib = 0x0000
 

Properties

 connected = property(is_connected)
 

Constructor & Destructor Documentation

◆ __init__()

def qwiic_max1704x.QwiicMAX1704X.__init__ (   self,
  address = None,
  i2c_driver = None,
  device_type = kDeviceTypeMAX17043 
)

Constructor.

Parameters
int,optionaladdress: The I2C address to use for the device If not provided, the default address is used
I2CDriver,optionali2c_driver: An existing i2c driver object If not provided, a driver object is created

Member Function Documentation

◆ begin()

def qwiic_max1704x.QwiicMAX1704X.begin (   self)

Initializes this device with default parameters.

Returns
bool Returns True if successful, otherwise False

◆ clear_alert()

def qwiic_max1704x.QwiicMAX1704X.clear_alert (   self)

clearAlert() - Clear the MAX1704X's ALRT alert flag.

◆ clear_status_reg_bits()

def qwiic_max1704x.QwiicMAX1704X.clear_status_reg_bits (   self,
  mask 
)

clear_status_reg_bits() - (MAX17048/49) Clear the specified mask in the status reg

Parameters
intmask: The mask to clear

◆ disable_alert()

def qwiic_max1704x.QwiicMAX1704X.disable_alert (   self)

disable_alert() - Disable the MAX1704X's VRESET Alert

EnVr (enable voltage reset alert) when set to 1 asserts the ALRT pin when a voltage-reset event occurs under the conditions described by the VRESET/ ID register.

◆ disable_comparator()

def qwiic_max1704x.QwiicMAX1704X.disable_comparator (   self)

disable_comparator() - (MAX17048/49) Clear bit in VRESET/ID reg Disable the analog comparator, saves 0.5uA in hibernate mode.

Returns
bool True if successful, otherwise False

◆ disable_hibernate()

def qwiic_max1704x.QwiicMAX1704X.disable_hibernate (   self)

disable_hibernate() - (MAX17048/49) Disable hibernate mode

Returns
bool True if successful, otherwise False

◆ disable_soc_alert()

def qwiic_max1704x.QwiicMAX1704X.disable_soc_alert (   self)

disable_soc_alert() - (MAX17048/49) Disable the SOC change alert

Returns
bool True if successful, otherwise False

◆ enable_alert()

def qwiic_max1704x.QwiicMAX1704X.enable_alert (   self)

enable_alert() - Enable the MAX1704X's VRESET Alert

EnVr (enable voltage reset alert) when set to 1 asserts the ALRT pin when a voltage-reset event occurs under the conditions described by the VRESET/ ID register.

◆ enable_comparator()

def qwiic_max1704x.QwiicMAX1704X.enable_comparator (   self)

enable_comparator() - (MAX17048/49) Set bit in VRESET/ID reg Comparator is enabled by default.

(Re)enable the analog comparator, uses 0.5uA.

Returns
bool True if successful, otherwise False

◆ enable_hibernate()

def qwiic_max1704x.QwiicMAX1704X.enable_hibernate (   self)

enable_hibernate() - (MAX17048/49) Enable hibernate mode

Returns
bool True if successful, otherwise False

◆ enable_soc_alert()

def qwiic_max1704x.QwiicMAX1704X.enable_soc_alert (   self)

enable_soc_alert() - (MAX17048/49) Enable the SOC change alert

Returns
bool True if successful, otherwise False

◆ get_alert()

def qwiic_max1704x.QwiicMAX1704X.get_alert (   self,
  clear = False 
)

get_alert() - Check if the MAX1704X's ALRT alert interrupt has been triggered.

Parameters
boolclear: If True, the alert flag will be cleared if it was set
Returns
True if the alert interrupt is/was triggered, otherwise False

◆ get_change_rate()

def qwiic_max1704x.QwiicMAX1704X.get_change_rate (   self)

get_change_rate() - (MAX17048/49) Get rate of change per hour in % Output: (signed) Float (that is the 0.208% * CRATE register value) A positive rate is charging, negative is discharge.

◆ get_compensation()

def qwiic_max1704x.QwiicMAX1704X.get_compensation (   self)

get_compensation() - Get the ModelGauge compensation value - an obscure 8-bit value set to 0x97 by default.

Returns
int The compensation value

◆ get_hibrt_act_thr()

def qwiic_max1704x.QwiicMAX1704X.get_hibrt_act_thr (   self)

get_hibrt_act_thr() - (MAX17048/49) Read and return the MAX17048/49 HIBRT Active Threshold LSb = 1.25mV

Returns
int The hibernate threshold

◆ get_hibrt_act_thr_volts()

def qwiic_max1704x.QwiicMAX1704X.get_hibrt_act_thr_volts (   self,
  threshold_volts 
)

Helper function to set the MAX17048/49 HIBRT ACT Threshold in volts.

Parameters
floatthreshold_volts: The threshold voltage to set
Returns
bool True if successful, otherwise False

◆ get_hibrt_hib_thr()

def qwiic_max1704x.QwiicMAX1704X.get_hibrt_hib_thr (   self)

get_hibrt_hib_thr() - (MAX17048/49) Read and return the MAX17048/49 HIBRT Hibernate Threshold LSb = 1.25mV

Returns
int The hibernate threshold

◆ get_hibrt_hib_thr_percent()

def qwiic_max1704x.QwiicMAX1704X.get_hibrt_hib_thr_percent (   self,
  threshold_percent 
)

Helper function to set the MAX17048/49 HIBRT Hibernate Threshold in percent LSb = 0.208%/hr.

Parameters
floatthreshold_percent: The threshold percentage to set
Returns
bool True if successful, otherwise False

◆ get_id()

def qwiic_max1704x.QwiicMAX1704X.get_id (   self)

get_id() - (MAX17048/49) Returns 8-bit OTP bits set at factory.

Can be used to 'to distinguish multiple cell types in production'.

Writes to these bits are ignored.

◆ get_soc()

def qwiic_max1704x.QwiicMAX1704X.get_soc (   self)

get_soc() - Get the MAX17043's state-of-charge (SOC) reading, as calculated by the IC's "ModelGauge" algorithm.

The first update is available approximately 1s after POR of the IC. Output: floating point value between 0-100, representing a percentage of full charge.

Returns
float The state of charge as a percentage

◆ get_status()

def qwiic_max1704x.QwiicMAX1704X.get_status (   self)

(MAX17048/49) Get the 7 bits of status register

Returns
int 7-bit value indicating various alerts

◆ get_threshold()

def qwiic_max1704x.QwiicMAX1704X.get_threshold (   self)

get_threshold() - Get the MAX17043's current percentage threshold that will trigger an alert.

Returns
int An integer value between 1 and 32, representing a % that will trigger an alert interrupt.

◆ get_valrt_max()

def qwiic_max1704x.QwiicMAX1704X.get_valrt_max (   self)

Get the MAX17048/49 VALRT Maximum threshold LSb = 20mV.

Returns
int The threshold value

◆ get_valrt_min()

def qwiic_max1704x.QwiicMAX1704X.get_valrt_min (   self)

Get the MAX17048/49 VALRT Minimum threshold LSb = 20mV.

Returns
int The threshold value

◆ get_version()

def qwiic_max1704x.QwiicMAX1704X.get_version (   self)

Get the MAX17043's version number.

Output: 16-bit value representing the version number.

Returns
int The version number

◆ get_voltage()

def qwiic_max1704x.QwiicMAX1704X.get_voltage (   self)

Get the MAX17043's voltage reading.

Output: floating point value between 0-5V in 1.25mV increments.

Returns
float The voltage as a floating point value

◆ is_change()

def qwiic_max1704x.QwiicMAX1704X.is_change (   self,
  clear = False 
)

is_change() - (MAX17048/49) Check if the change bit is set in the status register

Parameters
boolclear: If True, the change bit is cleared
Returns
bool True if the change bit is set, otherwise False

◆ is_connected()

def qwiic_max1704x.QwiicMAX1704X.is_connected (   self)

Determines if this device is connected.

Returns
bool True if connected, otherwise False

◆ is_hibernating()

def qwiic_max1704x.QwiicMAX1704X.is_hibernating (   self)

is_hibernating() - (MAX17048/49) Check if the IC is in hibernate mode

Returns
bool True if the IC is in hibernate mode, otherwise False

◆ is_low()

def qwiic_max1704x.QwiicMAX1704X.is_low (   self,
  clear = False 
)

is_low() - (MAX17048/49) Check if the low bit is set in the status register

Parameters
boolclear: If True, the low bit is cleared
Returns
bool True if the low bit is set, otherwise False

◆ is_reset()

def qwiic_max1704x.QwiicMAX1704X.is_reset (   self,
  clear = False 
)

is_reset() - (MAX17048/49) Check if the reset bit is set in the status register

Parameters
boolclear: If True, the reset bit is cleared
Returns
bool True if the reset bit is set, otherwise False

◆ is_voltage_high()

def qwiic_max1704x.QwiicMAX1704X.is_voltage_high (   self,
  clear = False 
)

is_voltage_high() - (MAX17048/49) Check if the voltage high bit is set in the status register

Parameters
boolclear: If True, the voltage high bit is cleared
Returns
bool True if the voltage high bit is set, otherwise False

◆ is_voltage_low()

def qwiic_max1704x.QwiicMAX1704X.is_voltage_low (   self,
  clear = False 
)

is_voltage_low() - (MAX17048/49) Check if the voltage low bit is set in the status register

Parameters
boolclear: If True, the voltage low bit is cleared
Returns
bool True if the voltage low bit is set, otherwise False

◆ is_voltage_reset()

def qwiic_max1704x.QwiicMAX1704X.is_voltage_reset (   self,
  clear = False 
)

is_voltage_reset() - (MAX17048/49) Check if the voltage reset bit is set in the status register

Parameters
boolclear: If True, the voltage reset bit is cleared
Returns
bool True if the voltage reset bit is set, otherwise False

◆ quick_start()

def qwiic_max1704x.QwiicMAX1704X.quick_start (   self)

A quick-start allows the MAX17043 to restart fuel-gauge calculations in the same manner as initial power-up of the IC.

If an application's power-up sequence is exceedingly noisy such that excess error is introduced into the IC's "first guess" of SOC, the host can issue a quick-start to reduce the error. A quick-start is initiated by a rising edge on the QSTRT pin, or through software by writing 4000h to MODE register.

Note: on the MAX17048/49 this will also clear / disable EnSleep bit

◆ read16()

def qwiic_max1704x.QwiicMAX1704X.read16 (   self,
  address,
  register 
)

Read 16-bit data from a register (big-endian)

Parameters
intregister: The register to read from
Returns
int The data read

◆ reset()

def qwiic_max1704x.QwiicMAX1704X.reset (   self)

Issue a Power-on-reset command to the MAX17043.

This function will reset every register in the MAX17043 to its default value.

◆ set_compensation()

def qwiic_max1704x.QwiicMAX1704X.set_compensation (   self,
  newCompensation 
)

set_compensation(newCompensation) - Set the 8-bit compensation value.

This is an obscure 8-bit value that has some effect on Maxim's ModelGauge algorithm. The POR value of RCOMP is 0x97.

From the datasheet: "Contact Maxim for instructions for optimization." For best performance, the host microcontroller must measure battery temperature periodically, and compensate the RCOMP ModelGauge parameter accordingly, at least once per minute. Each custom model defines constants RCOMP0 (default is 0x97), TempCoUp (default is -0.5), and TempCoDown (default is -5.0). To calculate the new value of CONFIG.RCOMP:

// T is battery temperature (degrees Celsius) if (T > 20) { RCOMP = RCOMP0 + (T - 20) x TempCoUp;} else { RCOMP = RCOMP0 + (T - 20) x TempCoDown; }

: param newCompensation: The new compensation value to set : type newCompensation: int

: return: True if successful, otherwise False : rtype: bool

◆ set_device()

def qwiic_max1704x.QwiicMAX1704X.set_device (   self,
  device_type 
)

Set the device type.

Do this after instantiation but before .begin()

Parameters
intdevice_type: The device type to set

◆ set_hibrt_act_thr()

def qwiic_max1704x.QwiicMAX1704X.set_hibrt_act_thr (   self,
  threshold 
)

Set the MAX17048/49 HIBRT Active Threshold LSb = 1.25mV.

◆ set_hibrt_hib_thr()

def qwiic_max1704x.QwiicMAX1704X.set_hibrt_hib_thr (   self,
  threshold 
)

Set the MAX17048/49 HIBRT Hibernate Threshold LSb = 1.25mV.

◆ set_reset_voltage_threshold()

def qwiic_max1704x.QwiicMAX1704X.set_reset_voltage_threshold (   self,
  threshold 
)

set_reset_voltage_threshold(threshold) - (MAX17048/49) Set the 7-bit VRESET value.

A 7-bit value that controls the comparator for detecting when a battery is detached and re-connected. 40mV per bit. Default is 3.0V. For captive batteries, set to 2.5V. For removable batteries, set to at least 300mV below the application's empty voltage, according to the desired reset threshold for your application. Input: [threshold] - Should be a value between 0-127. Output: 0 on success, positive integer on fail.

Parameters
intthreshold: The threshold value to set
Returns
True if successful, otherwise False

◆ set_reset_voltage_volts()

def qwiic_max1704x.QwiicMAX1704X.set_reset_voltage_volts (   self,
  threshold_volts 
)

Helper function to set the reset voltage threshold in volts.

Parameters
floatthreshold_volts: The threshold voltage to set
Returns
bool True if successful, otherwise False

◆ set_threshold()

def qwiic_max1704x.QwiicMAX1704X.set_threshold (   self,
  percent = 4 
)

set_threshold() - Set the MAX17043's percentage threshold that will trigger an alert.

Parameters
intpercent: The percentage value that will trigger an alert interrupt. Any value between 1 and 32 is valid. Default value is 0x1C == 4%

◆ set_valrt_max()

def qwiic_max1704x.QwiicMAX1704X.set_valrt_max (   self,
  threshold = 0xFF 
)

Set the MAX17048/49 VALRT Maximum threshold.

This register is divided into two thresholds: Voltage alert maximum (VALRT.MAX) and minimum (VALRT. MIN). Both registers have 1 LSb = 20mV. The IC alerts while VCELL > VALRT.MAX or VCELL < VALRT.MIN

Parameters
intthreshold: The threshold value to set

◆ set_valrt_max_volts()

def qwiic_max1704x.QwiicMAX1704X.set_valrt_max_volts (   self,
  threshold_volts = 5.1 
)

Helper function to set the MAX17048/49 VALRT Maximum threshold in volts.

Parameters
floatthreshold_volts: The threshold voltage to set
Returns
bool True if successful, otherwise False

◆ set_valrt_min()

def qwiic_max1704x.QwiicMAX1704X.set_valrt_min (   self,
  threshold = 0x00 
)

Set the MAX17048/49 VALRT Minimum threshold.

This register is divided into two thresholds: Voltage alert maximum (VALRT.MAX) and minimum (VALRT. MIN). Both registers have 1 LSb = 20mV. The IC alerts while VCELL > VALRT.MAX or VCELL < VALRT.MIN

Parameters
intthreshold: The threshold value to set

◆ set_valrt_min_volts()

def qwiic_max1704x.QwiicMAX1704X.set_valrt_min_volts (   self,
  threshold_volts = 0.0 
)

Helper function to set the MAX17048/49 VALRT Minimum threshold in volts.

Parameters
floatthreshold_volts: The threshold voltage to set
Returns
bool True if successful, otherwise False

◆ sleep()

def qwiic_max1704x.QwiicMAX1704X.sleep (   self)

sleep() - Set the MAX17043 into sleep mode.

In sleep mode, the IC halts all operations, reducing current consumption to below 1uA. After exiting sleep mode, the IC continues normal operation. In sleep mode, the IC does not detect self-discharge. If the battery changes state while the IC sleeps, the IC cannot detect it, causing SOC error. Wake up the IC before charging or discharging.

Returns
bool True if successful, otherwise False

◆ wake()

def qwiic_max1704x.QwiicMAX1704X.wake (   self)

wake() - Wake the MAX17043 up from sleep.

Returns
bool True if successful, otherwise False

◆ write16()

def qwiic_max1704x.QwiicMAX1704X.write16 (   self,
  address,
  register,
  data 
)

Write 16-bit data to a register (big-endian)

Parameters
intregister: The register to write to
intdata: The data to write

Member Data Documentation

◆ address

qwiic_max1704x.QwiicMAX1704X.address

◆ available_addresses

qwiic_max1704x.QwiicMAX1704X.available_addresses = _AVAILABLE_I2C_ADDRESS
static

◆ device_name

qwiic_max1704x.QwiicMAX1704X.device_name = _DEFAULT_NAME
static

◆ kConfigAlertMask

int qwiic_max1704x.QwiicMAX1704X.kConfigAlertMask = 0x01 << kConfigAlertShift
static

◆ kConfigAlertShift

int qwiic_max1704x.QwiicMAX1704X.kConfigAlertShift = 5
static

◆ kConfigCompMask

int qwiic_max1704x.QwiicMAX1704X.kConfigCompMask = 0xFF << kConfigCompShift
static

◆ kConfigCompShift

int qwiic_max1704x.QwiicMAX1704X.kConfigCompShift = 8
static

◆ kConfigSleepMask

int qwiic_max1704x.QwiicMAX1704X.kConfigSleepMask = 0x01 << kConfigSleepShift
static

◆ kConfigSleepShift

int qwiic_max1704x.QwiicMAX1704X.kConfigSleepShift = 7
static

◆ kConfigSocAlertMask

int qwiic_max1704x.QwiicMAX1704X.kConfigSocAlertMask = 0x01 << kConfigSocAlertShift
static

◆ kConfigSocAlertShift

int qwiic_max1704x.QwiicMAX1704X.kConfigSocAlertShift = 6
static

◆ kConfigThresholdMask

int qwiic_max1704x.QwiicMAX1704X.kConfigThresholdMask = 0x1F << kConfigThresholdShift
static

◆ kConfigThresholdShift

int qwiic_max1704x.QwiicMAX1704X.kConfigThresholdShift = 0
static

◆ kDeviceTypeMAX17043

int qwiic_max1704x.QwiicMAX1704X.kDeviceTypeMAX17043 = 0
static

◆ kDeviceTypeMAX17044

int qwiic_max1704x.QwiicMAX1704X.kDeviceTypeMAX17044 = 1
static

◆ kDeviceTypeMAX17048

int qwiic_max1704x.QwiicMAX1704X.kDeviceTypeMAX17048 = 2
static

◆ kDeviceTypeMAX17049

int qwiic_max1704x.QwiicMAX1704X.kDeviceTypeMAX17049 = 3
static

◆ kMax17048HibRtDisHib

int qwiic_max1704x.QwiicMAX1704X.kMax17048HibRtDisHib = 0x0000
static

◆ kMax17048HibRtEnHib

int qwiic_max1704x.QwiicMAX1704X.kMax17048HibRtEnHib = 0xFFFF
static

◆ kModeEnSleep

int qwiic_max1704x.QwiicMAX1704X.kModeEnSleep = 0x2000
static

◆ kModeHibStat

int qwiic_max1704x.QwiicMAX1704X.kModeHibStat = 0x1000
static

◆ kModeQuickStart

int qwiic_max1704x.QwiicMAX1704X.kModeQuickStart = 0x4000
static

◆ kRegCommand

int qwiic_max1704x.QwiicMAX1704X.kRegCommand = 0xFE
static

◆ kRegConfig

int qwiic_max1704x.QwiicMAX1704X.kRegConfig = 0x0C
static

◆ kRegCRate

int qwiic_max1704x.QwiicMAX1704X.kRegCRate = 0x16
static

◆ kRegCValrt

int qwiic_max1704x.QwiicMAX1704X.kRegCValrt = 0x14
static

◆ kRegHibRt

int qwiic_max1704x.QwiicMAX1704X.kRegHibRt = 0x0A
static

◆ kRegMode

int qwiic_max1704x.QwiicMAX1704X.kRegMode = 0x06
static

◆ kRegSoc

int qwiic_max1704x.QwiicMAX1704X.kRegSoc = 0x04
static

◆ kRegStatus

int qwiic_max1704x.QwiicMAX1704X.kRegStatus = 0x1A
static

◆ kRegVcell

int qwiic_max1704x.QwiicMAX1704X.kRegVcell = 0x02
static

◆ kRegVersion

int qwiic_max1704x.QwiicMAX1704X.kRegVersion = 0x08
static

◆ kRegVResetId

int qwiic_max1704x.QwiicMAX1704X.kRegVResetId = 0x18
static

◆ kStatusEnVrMask

int qwiic_max1704x.QwiicMAX1704X.kStatusEnVrMask = 0x01 << kStatusEnVrShift
static

◆ kStatusEnVrShift

int qwiic_max1704x.QwiicMAX1704X.kStatusEnVrShift = 14
static

◆ kStatusHdMask

int qwiic_max1704x.QwiicMAX1704X.kStatusHdMask = 0x01 << kStatusHdShift
static

◆ kStatusHdShift

int qwiic_max1704x.QwiicMAX1704X.kStatusHdShift = 12
static

◆ kStatusMask

int qwiic_max1704x.QwiicMAX1704X.kStatusMask = 0x7F << kStatusShift
static

◆ kStatusRiMask

int qwiic_max1704x.QwiicMAX1704X.kStatusRiMask = 0x01 << kStatusRiShift
static

◆ kStatusRiShift

int qwiic_max1704x.QwiicMAX1704X.kStatusRiShift = 8
static

◆ kStatusScMask

int qwiic_max1704x.QwiicMAX1704X.kStatusScMask = 0x01 << kStatusScShift
static

◆ kStatusScShift

int qwiic_max1704x.QwiicMAX1704X.kStatusScShift = 13
static

◆ kStatusShift

int qwiic_max1704x.QwiicMAX1704X.kStatusShift = 8
static

◆ kStatusVhMask

int qwiic_max1704x.QwiicMAX1704X.kStatusVhMask = 0x01 << kStatusVhShift
static

◆ kStatusVhShift

int qwiic_max1704x.QwiicMAX1704X.kStatusVhShift = 9
static

◆ kStatusVlMask

int qwiic_max1704x.QwiicMAX1704X.kStatusVlMask = 0x01 << kStatusVlShift
static

◆ kStatusVlShift

int qwiic_max1704x.QwiicMAX1704X.kStatusVlShift = 10
static

◆ kStatusVrMask

int qwiic_max1704x.QwiicMAX1704X.kStatusVrMask = 0x01 << kStatusVrShift
static

◆ kStatusVrShift

int qwiic_max1704x.QwiicMAX1704X.kStatusVrShift = 11
static

◆ kVResetIdComparatorDisMask

int qwiic_max1704x.QwiicMAX1704X.kVResetIdComparatorDisMask = 0x01 << kVResetIdComparatorDisShift
static

◆ kVResetIdComparatorDisShift

int qwiic_max1704x.QwiicMAX1704X.kVResetIdComparatorDisShift = 8
static

◆ kVResetIdVResetMask

int qwiic_max1704x.QwiicMAX1704X.kVResetIdVResetMask = 0x7F << kVResetIdVResetShift
static

◆ kVResetIdVResetShift

int qwiic_max1704x.QwiicMAX1704X.kVResetIdVResetShift = 9
static

Property Documentation

◆ connected

qwiic_max1704x.QwiicMAX1704X.connected = property(is_connected)
static

The documentation for this class was generated from the following file: