LTC3351
index
LTC3351.py

# -*- coding: utf-8 -*-

 
Modules
       
collections
datetime
serial
sqlite3
time

 
Classes
       
__builtin__.object
logger
ltc_dc590b_interface
_abcoll.Mapping(_abcoll.Sized, _abcoll.Iterable, _abcoll.Container)
LTC3351
exceptions.Exception(exceptions.BaseException)
LTC3351_APIException

 
class LTC3351(_abcoll.Mapping)
    API for the LTC3351 Super Capacitor Backup Controller with HotSwap.
 
Each bit field is read and written as an attribute of the class instance.
Bit fields are changed in place with a read-modify-write algorithm to avoid clearing adjacent data in shared registers.
When multiple bit fields are stored within a single command code, an additional attribute of the class instance exists to allow reads and writes to the full register.
Presets (enumerations) and formats (transformation functions between integers and real-word units) are applied in both directions for interactive use, but can be disabled.
 
 
Method resolution order:
LTC3351
_abcoll.Mapping
_abcoll.Sized
_abcoll.Iterable
_abcoll.Container
__builtin__.object

Methods defined here:
__getitem__(self, key)
__init__(self, read_function, write_function=None, verbose=False)
The user must supply appropriate functions to read from and write to the I²C/SMBus hardware.
read_function should take arguments (addr_7bit, command_code) and return contents of LTC3351 register at command_code.
write_function should take arguments (addr_7bit, command_code, data) and write data to LTC3351 register at command_code.
Set verbose argument to True to enable printing of intermediate results of masking, shifting and data transformation operations.
__iter__(self)
__len__(self)
__repr__(self)
__setattr__(self, name, value)
Override attribute storage mechanism to prevent writes to mis-spelled bit fields.
__setitem__(self, key, value)
__str__(self)
create_format(self, format_name, format_function, unformat_function, signed=False, description=None)
Create a new format definition or modify an existing definition.
 
format_function should take a single argument of integer raw data from the register and return a version of the data scaled to appropriate units.
unformat_function should take a single argument of data in real units and return an integer version of the data scaled to the register LSB weight.
If the data is signed in two's-complement format, set signed=True.
After creating format, use set_active_format method to make the new format active.
disable_binary_read_presets(self)
Disable presets (enumerations) for all single-bit bit fields.
disable_presets_and_formats(self)
Remove all presets and formats.
 
Read and write data will be passed through unmodified, except for masking and shifting.
The dictionary of presets and formats is shared between all instances of the class and any other instances will reflect this change.
This is permanent for the duration of the Python session.
disable_read_presets(self, bf_name, enabled=False)
Disable presets (enumerations) for a single bit field bf_name.
enable_read_presets(self, bf_name, enabled=True)
Enable presets (enumerations) for a single bit field bf_name.
get_active_format(self, bf_name)
Returns string name of format currently active for field bf_name.
get_constant(self, constant)
Gets the constants found in the datasheet used by the formatters to convert from real world values to digital value and back.
get_formats(self, bf_name)
Returns tuple of formats defined for bit field bf_name.
get_status(self)
Returns dictionary containing current value of all readable registers.
list_constants(self)
Returns a dictionary of constants found in the datasheet used by the formatters to convert from real world values to digital value and back.
print_status(self)
Prints current value of all readable registers.
set_active_format(self, bf_name, format_name, force=False)
Changes currently active format for field bf_name to format_name.
If format_name is not in list of allowed_formats, set force argument to True to disable check.
set_constant(self, constant, value)
Sets the constants found in the datasheet used by the formatters to convert from real world values to digital value and back.
set_device_address(self, addr_7bit)
Change I²C/SMBus device address of the LTC3351.
addr_7bit is the right-justified 7-bit address with the R/W̅ bit omitted.

Data descriptors defined here:
adc_backup_ch_en_reg
adc_backup_dtemp_en
Enables ADC measurement of die temperature while in backup mode. (1 bit, R/W)
adc_backup_gpi_en
Enables ADC measurement of GPI (general purpose input) while in backup mode. (1 bit, R/W)
adc_backup_ichg_en
Enables ADC measurement of charge current while in backup mode. (1 bit, R/W)
adc_backup_iin_en
Enables ADC measurement of input current while in backup mode. (1 bit, R/W)
adc_backup_vcap1_en
Enables ADC measurement of vcap1 while in backup mode. (1 bit, R/W)
adc_backup_vcap2_en
Enables ADC measurement of vcap2 while in backup mode. (1 bit, R/W)
adc_backup_vcap3_en
Enables ADC measurement of vcap3 while in backup mode. (1 bit, R/W)
adc_backup_vcap4_en
Enables ADC measurement of vcap4 while in backup mode. (1 bit, R/W)
adc_backup_vcap_en
Enables ADC measurement of vcap while in backup mode. (1 bit, R/W)
adc_backup_vin_en
Enables ADC measurement of vin while in backup mode. (1 bit, R/W)
adc_backup_vout_en
Enables ADC measurement of vout while in backup mode. (1 bit, R/W)
adc_vin_ch_en_reg
adc_vin_dtemp_en
Enables ADC measurement of die temperature while in charging mode. (1 bit, R/W)
adc_vin_gpi_en
Enables ADC measurement of GPI (general purpose input) while in charging mode. (1 bit, R/W)
adc_vin_ichg_en
Enables ADC measurement of charge current while in charging mode. (1 bit, R/W)
adc_vin_iin_en
Enables ADC measurement of input current while in charging mode. (1 bit, R/W)
adc_vin_vcap1_en
Enables ADC measurement of vcap1 while in charging mode. This bit must be set for capacitance and ESR measurement. (1 bit, R/W)
adc_vin_vcap2_en
Enables ADC measurement of vcap2 while in charging mode. This bit must be set for capacitance and ESR measurement if there are two or more capacitors in the stack. (1 bit, R/W)
adc_vin_vcap3_en
Enables ADC measurement of vcap3 while in charging mode. This bit must be set for capacitance and ESR measurement if there are three or more capacitors in the stack (1 bit, R/W)
adc_vin_vcap4_en
Enables ADC measurement of vcap4 while in charging mode. This bit must be set for capacitance and ESR measurement if there are four capacitors in the stack (1 bit, R/W)
adc_vin_vcap_en
Enables ADC measurement of vcap while in charging mode. (1 bit, R/W)
adc_vin_vin_en
Enables ADC measurement of vin while in charging mode. (1 bit, R/W)
adc_vin_vout_en
Enables ADC measurement of vout while in charging mode. (1 bit, R/W)
adc_wait_backup
Sets the wait time between ADC measurement groups while in backup mode. The LSB of this register has a weight of 400uS. The ADC measures all enabled channels then waits this time before measuring all channels again. 400uS per LSB (16 bits, R/W)
adc_wait_vin
Sets the wait time between ADC measurement groups while in charging mode. The LSB of this register has a weight of 400uS. The ADC measures all enabled channels then waits this time before measuring all channels again. The ADC data is used for balancing and shunting, increasing this time reduces the shunt and balancer update rate and is not typically recommended if shunting or balancing is enabled. If shunting or measuring capacitance/ESR this time may be ignored by the ADC. 400uS per LSB (16 bits, R/W)
alarm_cap_lo
Capacitance low alarm (1 bit, R/W)
alarm_cap_ov
Capacitor Over Voltage alarm (1 bit, R/W)
alarm_cap_uv
Capacitor Under Voltage alarm (1 bit, R/W)
alarm_dtemp_cold
Die temperature cold alarm (1 bit, R/W)
alarm_dtemp_hot
Die temperature hot alarm (1 bit, R/W)
alarm_esr_hi
ESR high alarm (1 bit, R/W)
alarm_gpi_ov
GPI Over Voltage alarm (1 bit, R/W)
alarm_gpi_uv
GPI Under Voltage alarm (1 bit, R/W)
alarm_ichg_uc
Charge undercurrent alarm (1 bit, R/W)
alarm_iin_oc
Input overcurrent alarm (1 bit, R/W)
alarm_mask_reg
Mask Alarms Register: Writing a one to any bit in this register enables a rising edge of its respective bit in alarm_reg to trigger an SMBALERT.
alarm_reg
Alarms Register: A one in any bit in the register indicates its respective alarm has triggered. All bits are active high. Alarms are cleared by clearing (writing 0) the appropriate bit in this register. Setting (writing 1) bits has no effect. For example to clear the alarm_gpi_uv alarm, write 0xFFFD.
alarm_vcap_ov
VCAP Over Voltage alarm (1 bit, R/W)
alarm_vcap_uv
VCAP Under Voltage alarm (1 bit, R/W)
alarm_vin_ov
VIN Over Voltage alarm (1 bit, R/W)
alarm_vin_uv
VIN Under Voltage alarm (1 bit, R/W)
alarm_vout_ov
VOUT Over Voltage alarm (1 bit, R/W)
alarm_vout_uv
VOUT Under Voltage alarm (1 bit, R/W)
boost_en
Indicates the boost is enabled (1 bit, Read Only)
buck_en
Indicates the charger is enabled (1 bit, Read Only)
cap_delta_v_setting
The target delta V for the capacitance test. The scale is 182.8µV per LSB. The default is approximately 100mV. (16 bits, R/W)
cap_i_on_settling
Time to wait after turning the test current on before measuring the first voltage of the capacitance measurement. Each LSB is 1024 switcher periods. (16 bits, R/W)
cap_lo_lvl
Capacitance Low Level: This is an alarm threshold for the measured stack capacitance. If the measured stack capacitance is less than this level it will trigger an alarm and an SMBALERT, if enabled. When ctl_cap_scale is set to 1, capacitance is 3.36µF * RT/RTST per LSB. When ctl_cap_scale is set to 0 it is 336µF * RT/RTST per LSB. (16 bits, R/W)
Format: cap_format     Measured capacitor stack capacitance value. When CTL_CAP_SCALE_VALUE is set to 1, capacitance is 3.36µF * RT/RTST per LSB. When CTL_CAP_SCALE_VALUE is set to 0 it is 336µF * RT/RTST per LSB.
cap_m0_vc1
The voltage change on cap1 due to the capacitance measurement. The relative voltage change on each capacitor during the capacitance measurement and the total capacitance can be used to calculate the capacitance of each individual capacitor. (16 bits, Read Only)
cap_m0_vc2
The voltage change on cap2 due to the capacitance measurement. The relative voltage change on each capacitor during the capacitance measurement and the total capacitance can be used to calculate the capacitance of each individual capacitor. (16 bits, Read Only)
cap_m0_vc3
The voltage change on cap3 due to the capacitance measurement. The relative voltage change on each capacitor during the capacitance measurement and the total capacitance can be used to calculate the capacitance of each individual capacitor. (16 bits, Read Only)
cap_m0_vc4
The voltage change on cap4 due to the capacitance measurement. The relative voltage change on each capacitor during the capacitance measurement and the total capacitance can be used to calculate the capacitance of each individual capacitor. (16 bits, Read Only)
cap_ov_lvl
Capacitor Over Voltage Level: This is an alarm threshold for each individual capacitor in the stack. If enabled, any capacitor voltage rising above this level will trigger an alarm and an SMBALERT. 182.8µV per LSB  (16 bits, R/W)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.
cap_uv_lvl
Capacitor Under Voltage Level: This is an alarm threshold for each individual capacitor voltage in the stack. If enabled, any capacitor voltage falling below this level will trigger an alarm and an SMBALERT. 182.8µV per LSB. (16 bits, R/W)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.
cappg
The capacitor voltage is above power good threshold (1 bit, Read Only)
chrg_ci
Indicates the charger is in constant current mode (1 bit, Read Only)
chrg_cv
The charger is in constant voltage mode (1 bit, Read Only)
chrg_input_ilim
The charger is in input current limit (1 bit, Read Only)
chrg_uvlo
The charger is in under-voltage lockout or has been disabled by ctl_force_charger_off. (1 bit, Read Only)
ctl_cap_scale
Increases capacitor measurement resolution 100 times, this is used when measuring smaller capacitors. (1 bit, R/W)
Preset 'large_cap': 0
Preset 'small_cap': 1
ctl_disable_balancer
Disables the balancer. (1 bit, R/W)
ctl_disable_shunt
Disables the shunt feature. (1 bit, R/W)
ctl_force_boost_off
This bit disables the boost. (1 bit, R/W)
ctl_force_charger_off
This bit disables the charger. (1 bit, R/W)
ctl_force_itst_on
This bit forces the ITST current on. This can be used to discharge the capacitor stack or manually measure capacitance. Note that this only enables the test current, it does not disable the charger. Set ctl_force_charger_off to disable the charger. (1 bit, R/W)
ctl_gpi_buffer_en
A one in this bit location enables the input buffer on the GPI pin. With a zero in this location the GPI pin is measured without the buffer. (1 bit, R/W)
ctl_hotswap_disable
Disables the HotSwap controller. The gate of the hotswap FET is forced low, disconnecting VIN and VOUT and forcing the switcher into backup mode. This can be used to simulate a power failure for testing. (1 bit, R/W)
ctl_reg
Control Register: Several independent control bits are grouped into this register.
ctl_start_cap_esr_meas
Begin a capacitance and ESR measurement when possible; this bit clears itself once a measurement cycle begins or becomes pending. (1 bit, R/W)
Preset 'start_measurement': 1
ctl_stop_cap_esr_meas
Stops an active capacitance/ESR measurement; this bit clears itself once a measurement cycle has been stopped. (1 bit, R/W)
Preset 'stop_measurement': 1
dtemp_cold_lvl
Die Temperature Cold Level: This is an alarm threshold for the die temperature. If enabled, the die temperature falling below this level will trigger an alarm and an SMBALERT. Temperature = 0.0295C per LSB - 274C (16 bits, R/W)
Format: dtemp_format   Measured die temperature.
dtemp_hot_lvl
Die Temperature Hot Level: This is an alarm threshold for the die temperature. If enabled, the die temperature rising above this level will trigger an alarm and an SMBALERT. Temperature = 0.0295C per LSB - 274C (16 bits, R/W)
Format: dtemp_format   Measured die temperature.
esr_hi_lvl
ESR High Level: This is an alarm threshold for the measured stack ESR. If enabled, a measurement of stack ESR exceeding this level will trigger an alarm and an SMBALERT. Rsnsc/64 per LSB. (16 bits, R/W)
Format: esr_format     Measured capacitor stack equivalent series resistance (ESR) value.
esr_i_off_settling
Time to wait after turning the charge current off before measuring the charge voltage and current for ESR. Each LSB is 1024 switcher periods. (16 bits, R/W)
esr_i_on_settling
Time to allow the charging current to settle before measuring the charge voltage and current for ESR. Each LSB is 1024 switcher periods. (16 bits, R/W)
esr_i_override
This value overrides the LTC3351's adaptive test current selection for the ESR test. If this register is non-zero, the lower 8 bits will be used as an 8 bit DAC value to set the charge current during the ESR test. Typically this register will not need to be set. ITEST = 32mV * (esr_i_override[7:0] + 1) / 256 / Rsnsc (16 bits, R/W)
esr_m0_vc1
A measurement of VCAP1 just before turning current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m0_vc2
A measurement of VCAP2 just before turning current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m0_vc3
A measurement of VCAP3 just before turning current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m0_vc4
A measurement of VCAP4 just before turning current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m1_i
The first charge current measurement with charge current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m1_vc1
The first VCAP1 voltage measurement with charge current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m1_vc2
The first VCAP2 voltage measurement with charge current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m1_vc3
The first VCAP3 voltage measurement with charge current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m1_vc4
The first VCAP4 voltage measurement with charge current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m2_i
The second charge current measurement with charge current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m2_vc1
The second VCAP1 voltage measurement with the charge current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m2_vc2
The second VCAP2 voltage measurement with the charge current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m2_vc3
The second VCAP3 voltage measurement with the charge current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m2_vc4
The second VCAP4 voltage measurement with the charge current on for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m3_i
The charge current measurement with charge current off for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m3_vc1
The VCAP1 voltage measurement with charge current off for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m3_vc2
The VCAP2 voltage measurement with charge current off for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m3_vc3
The VCAP3 voltage measurement with charge current off for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
esr_m3_vc4
The VCAP4 voltage measurement with charge current off for the ESR measurement. This value is used by the LTC3351 in the calculation of meas_esr. (16 bits, Read Only)
gpi_ov_lvl
General Purpose Input Over Voltage Level: This is an alarm threshold for the GPI pin. If enabled, the GPI pin voltage rising above this level will trigger an alarm and an SMBALERT. 182.8µV per LSB  (16 bits, R/W)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.
gpi_uv_lvl
General Purpose Input Under Voltage Level: This is an alarm threshold for the GPI pin. If enabled, the GPI pin voltage falling below this level will trigger an alarm and an SMBALERT. 182.8µV per LSB (16 bits, R/W)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.
hi_vcap
The highest measured capacitor voltage from the last measurement set. (16 bits, Read Only)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.
ichg_uc_lvl
Charge Undercurrent Level: This is an alarm threshold for the charge current. If enabled, the charge current falling below this level will trigger an alarm and an SMBALERT. 1.955µV/Rsnsc per LSB (16 bits, R/W)
Format: icharge_format Measured Charge Current.
iin_oc_lvl
Input Overcurrent Level: This is an alarm threshold for the input current. If enabled, the input current rising above this level will trigger an alarm and an SMBALERT. 1.955µV/Rsnsi per LSB (16 bits, R/W)
Format: iin_format     Measured input current.
lo_vcap
The lowest measured capacitor voltage from the last measurement set. (16 bits, Read Only)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.
mask_alarm_cap_lo
Capacitance low alarm mask (1 bit, R/W)
mask_alarm_cap_ov
Capacitor Over Voltage alarm mask (1 bit, R/W)
mask_alarm_cap_uv
Capacitor Under Voltage alarm mask (1 bit, R/W)
mask_alarm_dtemp_cold
Die temperature cold alarm mask (1 bit, R/W)
mask_alarm_dtemp_hot
Die temperature hot alarm mask (1 bit, R/W)
mask_alarm_esr_hi
ESR high alarm mask (1 bit, R/W)
mask_alarm_gpi_ov
GPI Over Voltage alarm mask (1 bit, R/W)
mask_alarm_gpi_uv
GPI Under Voltage alarm mask (1 bit, R/W)
mask_alarm_ichg_uc
Charge undercurrent alarm mask (1 bit, R/W)
mask_alarm_iin_oc
Input overcurrent alarm mask (1 bit, R/W)
mask_alarm_vcap_ov
VCAP Over Voltage alarm mask (1 bit, R/W)
mask_alarm_vcap_uv
VCAP Under Voltage alarm mask (1 bit, R/W)
mask_alarm_vin_ov
VIN Over Voltage alarm mask (1 bit, R/W)
mask_alarm_vin_uv
VIN Under Voltage alarm mask (1 bit, R/W)
mask_alarm_vout_ov
VOUT Over Voltage alarm mask (1 bit, R/W)
mask_alarm_vout_uv
VOUT Under Voltage alarm mask (1 bit, R/W)
mask_mon_balancing
Set the SMBALERT when there is a rising edge on mon_balancing (1 bit, R/W)
mask_mon_cap_done
Set the SMBALERT when there is a rising edge on mon_cap_done (1 bit, R/W)
mask_mon_cap_meas_active
Set the SMBALERT when there is a rising edge on mon_cap_meas_active (1 bit, R/W)
mask_mon_cap_precharge
Set the SMBALERT when there is a rising edge on mon_cap_precharge (1 bit, R/W)
mask_mon_capesr_pending
Set the SMBALERT when there is a rising edge on mon_capesr_pending (1 bit, R/W)
mask_mon_disable_charger
Set the SMBALERT when there is a rising edge on mon_disable_charger (1 bit, R/W)
mask_mon_esr_done
Set the SMBALERT when there is a rising edge on mon_esr_done (1 bit, R/W)
mask_mon_esr_meas_active
Set the SMBALERT when there is a rising edge on mon_esr_meas_active (1 bit, R/W)
mask_mon_meas_active
Set the SMBALERT when there is a rising edge on mon_meas_active (1 bit, R/W)
mask_mon_meas_failed
Set the SMBALERT when there is a rising edge on mon_meas_failed (1 bit, R/W)
mask_mon_power_failed
Set the SMBALERT when there is a rising edge on mon_power_failed (1 bit, R/W)
mask_mon_power_returned
Set the SMBALERT when there is a rising edge on mon_power_returned (1 bit, R/W)
mask_mon_shunting
Set the SMBALERT when there is a rising edge on mon_shunting (1 bit, R/W)
meas_cap
Measured capacitor stack capacitance value. When ctl_cap_scale is set to 1, capacitance is 3.36µF * RT/RTST per LSB. When ctl_cap_scale is set to 0 it is 336µF * RT/RTST per LSB. (16 bits, Read Only)
Format: cap_format     Measured capacitor stack capacitance value. When CTL_CAP_SCALE_VALUE is set to 1, capacitance is 3.36µF * RT/RTST per LSB. When CTL_CAP_SCALE_VALUE is set to 0 it is 336µF * RT/RTST per LSB.
Format: cap_zs_format  Unmodified capacitor data
meas_dtemp
Measured die temperature. Temperature = 0.0295°C per LSB - 274°C. (16 bits, Read Only)
Format: dtemp_format   Measured die temperature.
meas_esr
Measured capacitor stack equivalent series resistance (ESR) value. Rsnsc/64 per LSB (16 bits, Read Only)
Format: esr_format     Measured capacitor stack equivalent series resistance (ESR) value.
meas_gpi
Measurement of GPI pin voltage. 182.8µV per LSB (16 bits, Read Only)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.
meas_ichg
Measured Charge Current. 1.955µV/Rsnsc per LSB (16 bits, Read Only)
Format: icharge_format Measured Charge Current.
meas_iin
Measured Input Current. 1.955µV/Rsnsi per LSB (16 bits, Read Only)
Format: iin_format     Measured input current.
meas_vcap
Measured Capacitor Stack Voltage. 1.46mV per LSB. (16 bits, Read Only)
Format: vcap_format    Measured capacitor stack voltage.
meas_vcap1
Measured voltage between the CAP1 and CAPRTN pins. 182.8µV per LSB (16 bits, Read Only)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.
meas_vcap2
Measured voltage between the CAP2 and CAP1 pins. 182.8µV per LSB (16 bits, Read Only)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.
meas_vcap3
Measured voltage between the CAP3 and CAP2 pins. 182.8µV per LSB (16 bits, Read Only)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.
meas_vcap4
Measured voltage between the CAP4 and CAP3 pins. 182.8µV per LSB. When the ITST current is on, either due to ctl_force_itst_on or during a capacitance measurement, this voltage measurement will temporarily be low due to the ITST current flowing in the shunt resistor.  (16 bits, Read Only)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.
meas_vin
Measured Input Voltage. 2.19mV per LSB (16 bits, Read Only)
Format: vin_format     Measured input voltage.
meas_vout
Measured Output Voltage. 2.19mV per LSB. (16 bits, Read Only)
Format: vout_format    Measured output voltage
min_boost_cap_voltage
If this register is non-zero, it sets the minimum capacitor voltage the boost will operate at. If any capacitor voltage falls below this value in boost mode the boost will be forced off, the boost will not turn back on even if the capacitor voltage rises above this voltage. Only after input power returns will the boost be re-enabled. This prevents the boost from cycling on and off many times once the capacitors' voltage has discharged to the point it can no longer support the system load through the boost. To use this feature vcap[1:num_caps+1] measurements must be enabled in backup mode, see adc_backup_ch_en_reg. Also the capacitor voltages are only measured as often as set by adc_wait_backup. (16 bits, R/W)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.
min_vout_hs_disable
If this register is non-zero, it sets the minimum voltage VOUT is allowed to reach while the HotSwap is disabled. If the voltage falls below this level the ctl_hotswap_disable bit will be cleared, re-enabling the HotSwap controller.  To use this feature the VOUT measurement must be enabled in boost mode, see adc_backup_ch_en_reg. Also the VOUT voltage is only measured as often as set by adc_wait_backup.  (16 bits, R/W)
Format: vout_format    Measured output voltage
mon_balancing
Indicates the LTC3351 is balancing the capacitor voltage. (1 bit, Read Only)
mon_boost_shutdown
This bit is set in boost mode when any capacitor falls below min_boost_cap_voltage_reg. It is cleared when power returns. (1 bit, Read Only)
mon_cap_done
Indicates that the capacitance measurement has completed (1 bit, Read Only)
mon_cap_meas_active
Indicates the capacitance and ESR measurement system is measuring capacitance. (1 bit, Read Only)
mon_cap_precharge
Indicates the capacitor stack is being precharged for a capacitance measurement. (1 bit, Read Only)
mon_capesr_pending
Indicates that the LTC3351 is waiting for satisfactory conditions to begin a capacitance/ESR measurement (1 bit, Read Only)
mon_capesr_scheduled
Indicates that the LTC3351 is waiting programmed time to begin a capacitance/ESR measurement (1 bit, Read Only)
mon_disable_charger
Indicates the capacitance and ESR measurement system has temporarily disabled the charger. (1 bit, Read Only)
mon_esr_done
Indicates that the ESR Measurement has completed (1 bit, Read Only)
mon_esr_meas_active
Indicates the capacitance and ESR measurement system is measuring ESR. (1 bit, Read Only)
mon_meas_active
Capacitance/ESR measurement is active. This bit becomes one at the begining of a capacitance/ESR measurement and remains 1 after the measurement has completed until the capacitors have been discharged back to their regulation voltage. (1 bit, Read Only)
mon_meas_failed
Indicates the last attempted capacitance and ESR measurement was unable to complete (1 bit, Read Only)
mon_power_failed
This bit is set when VIN is outside the UV/OV range or the HotSwap controller is disabled by setting the ctl_hotswap_disable. It is cleared only when mon_power_returned is set. (1 bit, Read Only)
mon_power_returned
This bit is set when the output is powered by the input and the charger is able to charge. It is cleared only when mon_power_failed is set. (1 bit, Read Only)
mon_reset
This bit is set during a power on reset. It is cleared on any I2C/SMBus write. It can be used to determine if the chip has reset during a power loss followed by a power return. (1 bit, Read Only)
mon_shunting
Indicates a capacitor voltage is approaching vshunt and a shunt is turned on. (1 bit, Read Only)
monitor_status_mask_reg
Mask Monitor Status Register: Writing a one to any bit in this register enables a rising edge of its respective bit in monitor_status_reg to trigger an SMBALERT.
monitor_status_reg
Monitor Status: This register provides real time status information about the state of the monitoring system. Each bit is active high.
next_esr_i
The 8 bit DAC setting for the charge current that the LTC3351 has calculated for the next ESR measurement based on the previous ESR measurement. The first ESR measurement will use a setting of 32. If esr_i_override is non-zero, this register will be calculated but esr_i_override will be used instead. If non-zero ITEST = 32mV * (next_esr_i[7:0] + 1) / 256 / Rsnsc (8 bits, Read Only)
next_ichrg_control_test_current
num_caps
Number of Capacitors. This register shows the state of the CAP_SLCT1, CAP_SLCT0 pins. The value read in this register is the number of capacitors programmed minus one. (2 bits, Read Only)
num_caps_reg
rev_code
The LTC3351 revision code. (16 bits, Read Only)
stepdown_mode
The synchronous controller is in step-down mode (charging) (1 bit, Read Only)
stepup_mode
The synchronous controller is in step-up mode (backup) (1 bit, Read Only)
sys_status
System Status Register: This register provides real time status information about the instantaneous state of the system. Each bit is active high.
vcap_ov_lvl
VCAP Over Voltage Level: This is an alarm threshold for the capacitor stack voltage. If enabled, the VCAP pin voltage rising above this level will trigger an alarm and an SMBALERT. 1.46mV per LSB (16 bits, R/W)
Format: vcap_format    Measured capacitor stack voltage.
vcap_uv_lvl
VCAP Under Voltage Level: This is an alarm threshold for the capacitor stack voltage. If enabled, the VCAP pin voltage falling below this level will trigger an alarm and an SMBALERT. 1.46mV per LSB  (16 bits, R/W)
Format: vcap_format    Measured capacitor stack voltage.
vcapfb_dac
VCAP Regulation Reference: This register is used to program the capacitor voltage feedback loop's reference voltage. Only bits 3:0 are active. VCAPFB_DAC = 37.5mV * vcapfb_dac + 637.5mV (4 bits, R/W)
Format: vcapfb_dac_format      This is used to program the capacitor voltage feedback loop's reference voltage. Only bits 3:0 are active. CAPFBREF = 37.5mV * vcapfb_dac + 637.5mV.
vcapfb_dac_reg
vin_ov_lvl
VIN Over Voltage Level: This is an alarm threshold for the input voltage. If enabled, the input pin voltage rising above this level will trigger an alarm and an SMBALERT. 2.19mV per LSB  (16 bits, R/W)
Format: vin_format     Measured input voltage.
vin_uv_lvl
VIN Under Voltage Level: This is an alarm threshold for the input voltage. If enabled, the input pin voltage falling below this level will trigger an alarm and an SMBALERT. 2.19mV per LSB  (16 bits, R/W)
Format: vin_format     Measured input voltage.
vingd
Indicates the input voltage is inside the UV/OV range. (1 bit, Read Only)
vout_ov_lvl
VOUT Over Voltage Level: This is an alarm threshold for the output voltage. If enabled, the VOUT pin voltage rising above this level will trigger an alarm and an SMBALERT. 2.19mV per LSB (16 bits, R/W)
Format: vout_format    Measured output voltage
vout_uv_lvl
VOUT Under Voltage Level: This is an alarm threshold for the output voltage. If enabled, the VOUT pin voltage falling below this level will trigger an alarm and an SMBALERT. 2.19mV per LSB  (16 bits, R/W)
Format: vout_format    Measured output voltage
vshunt
Shunt Voltage Register: This register programs the shunt voltage for each capacitor in the stack. When set below 3.6V, the charger will limit current and the active shunts will shunt current to prevent this voltage from being exceeded. As a capacitor voltage nears this level, the charge current will be reduced. Current will be shunted when the capacitor voltage is within 25mV of vshunt. Vshunt should be programmed at least 50mV higher than the intended final balanced individual capacitor voltage. When programmed above 3.6V no current will be shunted, however the charge current will be reduced as described. 182.8µV per LSB. (16 bits, R/W)
Format: cell_format    Measured voltage between CAP pins or CAP1 and CAPRTN.

Data and other attributes defined here:
__abstractmethods__ = frozenset([])

Methods inherited from _abcoll.Mapping:
__contains__(self, key)
__eq__(self, other)
__ne__(self, other)
get(self, key, default=None)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
items(self)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(self)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(self)
D.iterkeys() -> an iterator over the keys of D
itervalues(self)
D.itervalues() -> an iterator over the values of D
keys(self)
D.keys() -> list of D's keys
values(self)
D.values() -> list of D's values

Data and other attributes inherited from _abcoll.Mapping:
__hash__ = None

Class methods inherited from _abcoll.Sized:
__subclasshook__(cls, C) from abc.ABCMeta

Data descriptors inherited from _abcoll.Sized:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _abcoll.Sized:
__metaclass__ = <class 'abc.ABCMeta'>
Metaclass for defining Abstract Base Classes (ABCs).
 
Use this metaclass to create an ABC.  An ABC can be subclassed
directly, and then acts as a mix-in class.  You can also register
unrelated concrete classes (even built-in classes) and unrelated
ABCs as 'virtual subclasses' -- these and their descendants will
be considered subclasses of the registering ABC by the built-in
issubclass() function, but the registering ABC won't show up in
their MRO (Method Resolution Order) nor will method
implementations defined by the registering ABC be callable (not
even via super()).

 
class LTC3351_APIException(exceptions.Exception)
    Bad data passed to instance of LTC3351 will raise LTC3351_APIException
 
 
Method resolution order:
LTC3351_APIException
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class logger(__builtin__.object)
     Methods defined here:
__init__(self, chip, db_filename='data_log.sqlite')
Data logger stores memory dump(s) of the LTC3351 to a SQLite database file.
chip is an instance of the LTC3351 class.
A new database table will be automatically created with the current timestamp.
interval_log(self, interval_seconds, max_rows=None)
Repeatedly store dump of the LTC3351 memory to the database.
Memory will be recorded once per interval_seconds.
Data will be recorded max_rows times.  If set to None, recording will continue indefinitely.
log(self)
Store single dump of the LTC3351 memory to the database.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class ltc_dc590b_interface(__builtin__.object)
    Python Communication Interface for DC590B / Linduino.
Provides the following SMBus protocols with optional PEC (Packet Error Checking) CRC:
    ReadWord
    WriteWord
    ReadByte
    WriteByte
    ReceiveByte
    SendByte
    AlertResponse
Requires PySerial.
 
  Methods defined here:
__init__(self, serial_port, PEC=False, **kwargs)
Provide serial port of attached Linear Technology DC590 I²C interface board or DC2026B Linduno board programmed with DC590 emulator sketch.  kwargs will be passed to PySerial init unless serial_port is already configured.
alert_response(self)
SMBus Send Byte Protocol.
Packet Error Checking controlled by class init.
Slave device address specified in 7-bit format.
Returns None if no response to ARA, otherwise the responding device address placed in the 7 most significant bits of the byte.
The returned LSB (R/W̅ bit) will be zero in this implementation (i.e. write address).
read_byte(self, addr_7bit, command_code)
SMBus Read Byte Protocol.
Packet Error Checking controlled by class init.
Slave device address specified in 7-bit format.
Returns 8-bit data from slave.
read_word(self, addr_7bit, command_code)
SMBus Read Word Protocol.
Packet Error Checking controlled by class init.
Slave device address specified in 7-bit format.
Returns 16-bit data from slave.
receive_byte(self, addr_7bit)
SMBus Receive Byte Protocol.
Packet Error Checking controlled by class init.
Slave device address specified in 7-bit format.
Returns 8-bit data from slave.
send_byte(self, addr_7bit, data8)
SMBus Send Byte Protocol.
Packet Error Checking controlled by class init.
Slave device address specified in 7-bit format.
Returns None.
set_pec(self, PEC)
write_byte(self, addr_7bit, command_code, data8)
SMBus Write Byte Protocol.
Packet Error Checking controlled by class init.
Slave device address specified in 7-bit format.
Returns None.
write_word(self, addr_7bit, command_code, data16)
SMBus Write Word Protocol.
Packet Error Checking controlled by class init.
Slave device address specified in 7-bit format.
Returns None.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)