adafruit-circuitpython-mlx90393 2.1.3__py3-none-any.whl → 2.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: adafruit-circuitpython-mlx90393
3
- Version: 2.1.3
3
+ Version: 2.1.5
4
4
  Summary: CircuitPython driver for the MLX90393 3-axis magnetometer.
5
5
  Author-email: Adafruit Industries <circuitpython@adafruit.com>
6
6
  License: MIT
@@ -0,0 +1,6 @@
1
+ adafruit_mlx90393.py,sha256=94HFAZMsbNy57SV6Qqu8HqYeUofThg6hT1_PmbHrpzE,18326
2
+ adafruit_circuitpython_mlx90393-2.1.5.dist-info/LICENSE,sha256=WeIXVkYWpdba3Boxrax8dB0s5qWg9GTxl7c5uTZQDUI,1105
3
+ adafruit_circuitpython_mlx90393-2.1.5.dist-info/METADATA,sha256=2nUZH8DTMICjwDfcj6eP-8cg3Pd6fpHpMP9aljAU4Qk,4085
4
+ adafruit_circuitpython_mlx90393-2.1.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
5
+ adafruit_circuitpython_mlx90393-2.1.5.dist-info/top_level.txt,sha256=5RT_YbHfXFo2Y6zVvz8MXsZLIHm1OxrjFJrzRaCTdNY,18
6
+ adafruit_circuitpython_mlx90393-2.1.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
adafruit_mlx90393.py CHANGED
@@ -28,6 +28,7 @@ Implementation Notes
28
28
  https://github.com/adafruit/Adafruit_CircuitPython_Register
29
29
 
30
30
  """
31
+
31
32
  import struct
32
33
  import time
33
34
 
@@ -36,12 +37,13 @@ from micropython import const
36
37
 
37
38
  try:
38
39
  from typing import Tuple
39
- from circuitpython_typing import ReadableBuffer
40
+
40
41
  from busio import I2C
42
+ from circuitpython_typing import ReadableBuffer
41
43
  except ImportError:
42
44
  pass
43
45
 
44
- __version__ = "2.1.3"
46
+ __version__ = "2.1.5"
45
47
  __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MLX90393.git"
46
48
 
47
49
  _CMD_SB = const(0b00010000) # Start burst mode
@@ -406,15 +408,12 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
406
408
 
407
409
  :param int reg: The register to read
408
410
  """
409
- # Write 'value' to the specified register
411
+ # Read register
410
412
  payload = bytes([_CMD_RR, reg << 2])
411
- with self.i2c_device as i2c:
412
- i2c.write(payload)
413
-
414
- # Read the response (+1 to account for the mandatory status byte!)
415
413
  data = bytearray(3)
416
414
  with self.i2c_device as i2c:
417
- i2c.readinto(data)
415
+ i2c.write_then_readinto(payload, data)
416
+
418
417
  # Unpack data (status byte, big-endian 16-bit register value)
419
418
  self._status_last, val = struct.unpack(">BH", data)
420
419
  if self._debug:
@@ -446,6 +445,7 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
446
445
  """
447
446
  Performs a software reset of the sensor.
448
447
  """
448
+ self._transceive(bytes([_CMD_EX]))
449
449
  if self._debug:
450
450
  print("Resetting sensor")
451
451
  time.sleep(2)
@@ -1,6 +0,0 @@
1
- adafruit_mlx90393.py,sha256=hXPJ-VXZMig5jPGBhv2OpfiL7sspWOE1SI-8l3uZQcM,18430
2
- adafruit_circuitpython_mlx90393-2.1.3.dist-info/LICENSE,sha256=WeIXVkYWpdba3Boxrax8dB0s5qWg9GTxl7c5uTZQDUI,1105
3
- adafruit_circuitpython_mlx90393-2.1.3.dist-info/METADATA,sha256=uDj53jv1VlKQuUTfpmgXm6bVL91rLdUXyheDdZ5NtfM,4085
4
- adafruit_circuitpython_mlx90393-2.1.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
5
- adafruit_circuitpython_mlx90393-2.1.3.dist-info/top_level.txt,sha256=5RT_YbHfXFo2Y6zVvz8MXsZLIHm1OxrjFJrzRaCTdNY,18
6
- adafruit_circuitpython_mlx90393-2.1.3.dist-info/RECORD,,