adafruit-circuitpython-mlx90393 2.3.4__py3-none-any.whl → 2.3.6__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.
- {adafruit_circuitpython_mlx90393-2.3.4.dist-info → adafruit_circuitpython_mlx90393-2.3.6.dist-info}/METADATA +6 -5
- adafruit_circuitpython_mlx90393-2.3.6.dist-info/RECORD +6 -0
- {adafruit_circuitpython_mlx90393-2.3.4.dist-info → adafruit_circuitpython_mlx90393-2.3.6.dist-info}/WHEEL +1 -1
- adafruit_mlx90393.py +11 -14
- adafruit_circuitpython_mlx90393-2.3.4.dist-info/RECORD +0 -6
- {adafruit_circuitpython_mlx90393-2.3.4.dist-info → adafruit_circuitpython_mlx90393-2.3.6.dist-info/licenses}/LICENSE +0 -0
- {adafruit_circuitpython_mlx90393-2.3.4.dist-info → adafruit_circuitpython_mlx90393-2.3.6.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: adafruit-circuitpython-mlx90393
|
3
|
-
Version: 2.3.
|
3
|
+
Version: 2.3.6
|
4
4
|
Summary: CircuitPython driver for the MLX90393 3-axis magnetometer.
|
5
5
|
Author-email: Adafruit Industries <circuitpython@adafruit.com>
|
6
6
|
License: MIT
|
@@ -18,6 +18,7 @@ Requires-Dist: Adafruit-Blinka>=7.0.0
|
|
18
18
|
Requires-Dist: adafruit-circuitpython-busdevice
|
19
19
|
Requires-Dist: adafruit-circuitpython-typing
|
20
20
|
Provides-Extra: optional
|
21
|
+
Dynamic: license-file
|
21
22
|
|
22
23
|
Introduction
|
23
24
|
============
|
@@ -34,9 +35,9 @@ Introduction
|
|
34
35
|
:target: https://github.com/adafruit/Adafruit_CircuitPython_MLX90393/actions/
|
35
36
|
:alt: Build Status
|
36
37
|
|
37
|
-
.. image:: https://img.shields.io/badge/
|
38
|
-
:target: https://github.com/
|
39
|
-
:alt: Code Style:
|
38
|
+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
39
|
+
:target: https://github.com/astral-sh/ruff
|
40
|
+
:alt: Code Style: Ruff
|
40
41
|
|
41
42
|
Adafruit CircuitPython driver for the MLX90393 3-axis magnetometer.
|
42
43
|
|
@@ -0,0 +1,6 @@
|
|
1
|
+
adafruit_mlx90393.py,sha256=JZds1hLQ2PGAeGSZf9-D9TgXfUAizDwW3gneuue8-UI,21393
|
2
|
+
adafruit_circuitpython_mlx90393-2.3.6.dist-info/licenses/LICENSE,sha256=WeIXVkYWpdba3Boxrax8dB0s5qWg9GTxl7c5uTZQDUI,1105
|
3
|
+
adafruit_circuitpython_mlx90393-2.3.6.dist-info/METADATA,sha256=x02cqGjOf-IiF4W4ZdAlwjjS0zZB2k3FXocGvjztLfc,4162
|
4
|
+
adafruit_circuitpython_mlx90393-2.3.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
5
|
+
adafruit_circuitpython_mlx90393-2.3.6.dist-info/top_level.txt,sha256=5RT_YbHfXFo2Y6zVvz8MXsZLIHm1OxrjFJrzRaCTdNY,18
|
6
|
+
adafruit_circuitpython_mlx90393-2.3.6.dist-info/RECORD,,
|
adafruit_mlx90393.py
CHANGED
@@ -43,7 +43,7 @@ try:
|
|
43
43
|
except ImportError:
|
44
44
|
pass
|
45
45
|
|
46
|
-
__version__ = "2.3.
|
46
|
+
__version__ = "2.3.6"
|
47
47
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MLX90393.git"
|
48
48
|
|
49
49
|
_CMD_SB = const(0b00010000) # Start burst mode
|
@@ -168,7 +168,7 @@ _TCONV_LOOKUP = (
|
|
168
168
|
)
|
169
169
|
|
170
170
|
|
171
|
-
class MLX90393:
|
171
|
+
class MLX90393:
|
172
172
|
"""
|
173
173
|
Driver for the MLX90393 magnetometer.
|
174
174
|
|
@@ -206,7 +206,7 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
206
206
|
|
207
207
|
"""
|
208
208
|
|
209
|
-
def __init__(
|
209
|
+
def __init__(
|
210
210
|
self,
|
211
211
|
i2c_bus: I2C,
|
212
212
|
address: int = 0x0C,
|
@@ -287,7 +287,7 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
287
287
|
self._status_last = data[0]
|
288
288
|
# Unpack data (status byte, big-endian 16-bit register value)
|
289
289
|
if self._debug:
|
290
|
-
print("\t[{
|
290
|
+
print(f"\t[{time.monotonic()}]")
|
291
291
|
print("\t Writing :", [hex(b) for b in payload])
|
292
292
|
print("\tResponse :", [hex(b) for b in data])
|
293
293
|
print("\t Status :", hex(data[0]))
|
@@ -312,7 +312,7 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
312
312
|
if value > GAIN_1X or value < GAIN_5X:
|
313
313
|
raise ValueError("Invalid GAIN setting")
|
314
314
|
if self._debug:
|
315
|
-
print("\tSetting gain: {}"
|
315
|
+
print(f"\tSetting gain: {value}")
|
316
316
|
self._gain_current = value
|
317
317
|
self._transceive(
|
318
318
|
bytes(
|
@@ -356,12 +356,12 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
356
356
|
self._res_z = resolution
|
357
357
|
|
358
358
|
def _set_resolution(self, axis: int, resolution: int) -> None:
|
359
|
-
if resolution not in
|
359
|
+
if resolution not in {
|
360
360
|
RESOLUTION_16,
|
361
361
|
RESOLUTION_17,
|
362
362
|
RESOLUTION_18,
|
363
363
|
RESOLUTION_19,
|
364
|
-
|
364
|
+
}:
|
365
365
|
raise ValueError("Incorrect resolution setting.")
|
366
366
|
shift = (5, 7, 9)[axis]
|
367
367
|
mask = (0xFF9F, 0xFE7F, 0xF9FF)[axis]
|
@@ -464,7 +464,7 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
464
464
|
avail = 0
|
465
465
|
if self._status_last & 0b11 > 0:
|
466
466
|
avail = 2 * (self._status_last & 0b11) + 2
|
467
|
-
print("STATUS register = 0x{
|
467
|
+
print(f"STATUS register = 0x{self._status_last:02X}")
|
468
468
|
print("BURST Mode :", (self._status_last & (1 << 7)) > 0)
|
469
469
|
print("WOC Mode :", (self._status_last & (1 << 6)) > 0)
|
470
470
|
print("SM Mode :", (self._status_last & (1 << 5)) > 0)
|
@@ -488,7 +488,7 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
488
488
|
# Unpack data (status byte, big-endian 16-bit register value)
|
489
489
|
self._status_last, val = struct.unpack(">BH", data)
|
490
490
|
if self._debug:
|
491
|
-
print("\t[{
|
491
|
+
print(f"\t[{time.monotonic()}]")
|
492
492
|
print("\t Writing :", [hex(b) for b in payload])
|
493
493
|
print("\tResponse :", [hex(b) for b in data])
|
494
494
|
print("\t Status :", hex(data[0]))
|
@@ -525,7 +525,7 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
525
525
|
# Read the temperature reference from register 0x24
|
526
526
|
self._tref = self.read_reg(0x24)
|
527
527
|
if self._debug:
|
528
|
-
print("Tref = {
|
528
|
+
print(f"Tref = {hex(self._tref)}")
|
529
529
|
|
530
530
|
# burn a read post reset
|
531
531
|
try:
|
@@ -542,9 +542,7 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
542
542
|
|
543
543
|
resolutions = {self.resolution_x, self.resolution_y, self.resolution_z}
|
544
544
|
valid_tcomp_resolutions = {RESOLUTION_16, RESOLUTION_17}
|
545
|
-
if self._temperature_compensation and not resolutions.issubset(
|
546
|
-
valid_tcomp_resolutions
|
547
|
-
):
|
545
|
+
if self._temperature_compensation and not resolutions.issubset(valid_tcomp_resolutions):
|
548
546
|
resolutions_output = f"""Current Resolutions:
|
549
547
|
\tresolution_x: {self.resolution_x}
|
550
548
|
\tresolution_y: {self.resolution_y}
|
@@ -577,7 +575,6 @@ class MLX90393: # pylint: disable=too-many-instance-attributes
|
|
577
575
|
# Return the raw int values if requested
|
578
576
|
return m_x, m_y, m_z
|
579
577
|
|
580
|
-
# pylint: disable=no-self-use
|
581
578
|
def _unpack_axis_data(self, resolution: int, data: ReadableBuffer) -> int:
|
582
579
|
# see datasheet
|
583
580
|
if resolution == RESOLUTION_19:
|
@@ -1,6 +0,0 @@
|
|
1
|
-
adafruit_mlx90393.py,sha256=QjMZELrI4JVe-gbleWzl2YgBBoT7TkYP_BBZeBYLXO0,21576
|
2
|
-
adafruit_circuitpython_mlx90393-2.3.4.dist-info/LICENSE,sha256=WeIXVkYWpdba3Boxrax8dB0s5qWg9GTxl7c5uTZQDUI,1105
|
3
|
-
adafruit_circuitpython_mlx90393-2.3.4.dist-info/METADATA,sha256=_uMogqd6HkOYJbOT-V5cb8RRbzWVOuZJrinNj3rIV9k,4084
|
4
|
-
adafruit_circuitpython_mlx90393-2.3.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
5
|
-
adafruit_circuitpython_mlx90393-2.3.4.dist-info/top_level.txt,sha256=5RT_YbHfXFo2Y6zVvz8MXsZLIHm1OxrjFJrzRaCTdNY,18
|
6
|
-
adafruit_circuitpython_mlx90393-2.3.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|