@@ -286,7 +286,7 @@ def __init__(
286
286
i2c (I2C): The I2C bus to which the INA3221 is connected.
287
287
address (int, optional): The I2C address of the INA3221. Defaults to DEFAULT_ADDRESS.
288
288
enable(List[int], optional): channels to initialize at start (default: all)
289
- probe (bool, optiona ): Probe for the device upon object creation, default is true
289
+ probe (bool, optional ): Probe for the device upon object creation, default is true
290
290
"""
291
291
self .i2c_dev = I2CDevice (i2c , address , probe = probe )
292
292
self .reset ()
@@ -417,7 +417,7 @@ def flags(self) -> int:
417
417
int: The current flag indicators from the Mask/Enable register,
418
418
masked for relevant flag bits.
419
419
"""
420
- return self ._read_register_bits (MASK_ENABLE , 0 , 10 )
420
+ return self ._get_register_bits (MASK_ENABLE , 0 , 10 )
421
421
422
422
@property
423
423
def power_valid_limits (self ) -> tuple :
@@ -427,9 +427,9 @@ def power_valid_limits(self) -> tuple:
427
427
tuple: A tuple containing the lower and upper voltage limits
428
428
in volts as (lower_limit, upper_limit).
429
429
"""
430
- raw_value = self ._device . _get_register_bits (POWERVALID_LOWERLIMIT , 0 , 16 )
430
+ raw_value = self ._get_register_bits (POWERVALID_LOWERLIMIT , 0 , 16 )
431
431
lower_limit = _to_signed (raw_value , 3 , 16 ) * 8e-3
432
- raw_value = self ._device . _get_register_bits (POWERVALID_UPPERLIMIT , 0 , 16 )
432
+ raw_value = self ._get_register_bits (POWERVALID_UPPERLIMIT , 0 , 16 )
433
433
upper_limit = _to_signed (raw_value , 3 , 16 ) * 8e-3
434
434
return lower_limit , upper_limit
435
435
@@ -440,8 +440,8 @@ def power_valid_limits(self, limits: tuple) -> None:
440
440
# convert to mV and twos-complement
441
441
lower_limit = _to_2comp (int (limits [0 ] * 1000 ), 3 , 16 )
442
442
upper_limit = _to_2comp (int (limits [1 ] * 1000 ), 3 , 16 )
443
- self ._device . _set_register_bits (POWERVALID_LOWERLIMIT , 0 , 16 , lower_limit )
444
- self ._device . _set_register_bits (POWERVALID_UPPERLIMIT , 0 , 16 , upper_limit )
443
+ self ._set_register_bits (POWERVALID_LOWERLIMIT , 0 , 16 , lower_limit )
444
+ self ._set_register_bits (POWERVALID_UPPERLIMIT , 0 , 16 , upper_limit )
445
445
446
446
def _get_register_bits (self , reg , offset , len ):
447
447
"""return given bits from register"""
0 commit comments