adafruit-circuitpython-si5351 1.4.3__py3-none-any.whl → 1.4.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.
- {adafruit_circuitpython_si5351-1.4.3.dist-info → adafruit_circuitpython_si5351-1.4.5.dist-info}/METADATA +1 -1
- adafruit_circuitpython_si5351-1.4.5.dist-info/RECORD +6 -0
- {adafruit_circuitpython_si5351-1.4.3.dist-info → adafruit_circuitpython_si5351-1.4.5.dist-info}/WHEEL +1 -1
- adafruit_si5351.py +33 -31
- adafruit_circuitpython_si5351-1.4.3.dist-info/RECORD +0 -6
- {adafruit_circuitpython_si5351-1.4.3.dist-info → adafruit_circuitpython_si5351-1.4.5.dist-info}/LICENSE +0 -0
- {adafruit_circuitpython_si5351-1.4.3.dist-info → adafruit_circuitpython_si5351-1.4.5.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,6 @@
|
|
1
|
+
adafruit_si5351.py,sha256=jw-6hbBgs5nrDNQIA4wfOhb6E-SQr3aIJrqOR9vwSU4,21269
|
2
|
+
adafruit_circuitpython_si5351-1.4.5.dist-info/LICENSE,sha256=JKh8vHklhmbG1yo3Kb8RoUpvAbiWo-1mN044FsMIsI4,1102
|
3
|
+
adafruit_circuitpython_si5351-1.4.5.dist-info/METADATA,sha256=v9d3jXHMTWzUyNrmBKa1KIxRBLtwp1BBxjzpJMWPWQ4,3407
|
4
|
+
adafruit_circuitpython_si5351-1.4.5.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
5
|
+
adafruit_circuitpython_si5351-1.4.5.dist-info/top_level.txt,sha256=Nz5hRW4kRVOegzoCsdAX1mZCp0tR45819r42dSZu-EY,16
|
6
|
+
adafruit_circuitpython_si5351-1.4.5.dist-info/RECORD,,
|
adafruit_si5351.py
CHANGED
@@ -24,7 +24,7 @@ try:
|
|
24
24
|
except ImportError:
|
25
25
|
pass
|
26
26
|
|
27
|
-
__version__ = "1.4.
|
27
|
+
__version__ = "1.4.5"
|
28
28
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_SI5351.git"
|
29
29
|
|
30
30
|
|
@@ -161,17 +161,18 @@ class SI5351:
|
|
161
161
|
|
162
162
|
def _configure_registers(self, p1: int, p2: int, p3: int) -> None:
|
163
163
|
# Update PLL registers.
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
164
|
+
with self._si5351._device as i2c:
|
165
|
+
buf = self._si5351._BUFFER
|
166
|
+
buf[0] = self._base
|
167
|
+
buf[1] = (p3 & 0x0000FF00) >> 8
|
168
|
+
buf[2] = p3 & 0x000000FF
|
169
|
+
buf[3] = (p1 & 0x00030000) >> 16
|
170
|
+
buf[4] = (p1 & 0x0000FF00) >> 8
|
171
|
+
buf[5] = p1 & 0x000000FF
|
172
|
+
buf[6] = ((p3 & 0x000F0000) >> 12) | ((p2 & 0x000F0000) >> 16)
|
173
|
+
buf[7] = (p2 & 0x0000FF00) >> 8
|
174
|
+
buf[8] = p2 & 0x000000FF
|
175
|
+
i2c.write(buf, end=9)
|
175
176
|
# Reset both PLLs.
|
176
177
|
self._si5351._write_u8(_SI5351_REGISTER_177_PLL_RESET, (1 << 7) | (1 << 5))
|
177
178
|
|
@@ -311,16 +312,18 @@ class SI5351:
|
|
311
312
|
|
312
313
|
def _configure_registers(self, p1: int, p2: int, p3: int) -> None:
|
313
314
|
# Update MSx registers.
|
314
|
-
self._si5351.
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
315
|
+
with self._si5351._device as i2c:
|
316
|
+
buf = self._si5351._BUFFER
|
317
|
+
buf[0] = self._base
|
318
|
+
buf[1] = (p3 & 0x0000FF00) >> 8
|
319
|
+
buf[2] = p3 & 0x000000FF
|
320
|
+
buf[3] = (p1 & 0x00030000) >> 16
|
321
|
+
buf[4] = (p1 & 0x0000FF00) >> 8
|
322
|
+
buf[5] = p1 & 0x000000FF
|
323
|
+
buf[6] = ((p3 & 0x000F0000) >> 12) | ((p2 & 0x000F0000) >> 16)
|
324
|
+
buf[7] = (p2 & 0x0000FF00) >> 8
|
325
|
+
buf[8] = p2 & 0x000000FF
|
326
|
+
i2c.write(buf, end=9)
|
324
327
|
|
325
328
|
def configure_integer(
|
326
329
|
self, pll: "PLL", divider: int, inverted: bool = False
|
@@ -406,7 +409,7 @@ class SI5351:
|
|
406
409
|
|
407
410
|
# Class-level buffer to reduce allocations and heap fragmentation.
|
408
411
|
# This is not thread-safe or re-entrant by design!
|
409
|
-
_BUFFER = bytearray(
|
412
|
+
_BUFFER = bytearray(9)
|
410
413
|
|
411
414
|
def __init__(self, i2c: I2C, *, address: int = _SI5351_ADDRESS) -> None:
|
412
415
|
self._device = i2c_device.I2CDevice(i2c, address)
|
@@ -414,14 +417,13 @@ class SI5351:
|
|
414
417
|
# Disable all outputs setting CLKx_DIS high.
|
415
418
|
self._write_u8(_SI5351_REGISTER_3_OUTPUT_ENABLE_CONTROL, 0xFF)
|
416
419
|
# Power down all output drivers
|
417
|
-
|
418
|
-
|
419
|
-
self.
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
self._write_u8(_SI5351_REGISTER_23_CLK7_CONTROL, 0x80)
|
420
|
+
# Class-level buffer to reduce allocations and heap fragmentation.
|
421
|
+
# This is not thread-safe or re-entrant by design!
|
422
|
+
with self._device as i2c_bus:
|
423
|
+
self._BUFFER[0] = _SI5351_REGISTER_16_CLK0_CONTROL
|
424
|
+
for i in range(1, 9):
|
425
|
+
self._BUFFER[i] = 0x80
|
426
|
+
i2c_bus.write(self._BUFFER, end=9)
|
425
427
|
# Initialize PLL A and B objects.
|
426
428
|
self.pll_a = self._PLL(self, 26, 0)
|
427
429
|
self.pll_b = self._PLL(self, 34, (1 << 5))
|
@@ -1,6 +0,0 @@
|
|
1
|
-
adafruit_si5351.py,sha256=c8R-OuhfBxHEffNAIGKebo45oZ4cw6qWcHLfwZ7gM10,21666
|
2
|
-
adafruit_circuitpython_si5351-1.4.3.dist-info/LICENSE,sha256=JKh8vHklhmbG1yo3Kb8RoUpvAbiWo-1mN044FsMIsI4,1102
|
3
|
-
adafruit_circuitpython_si5351-1.4.3.dist-info/METADATA,sha256=jD0W8JH1NEHbf5xdisVwf2NagDmKjjQb5vlNZXvac1A,3407
|
4
|
-
adafruit_circuitpython_si5351-1.4.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
5
|
-
adafruit_circuitpython_si5351-1.4.3.dist-info/top_level.txt,sha256=Nz5hRW4kRVOegzoCsdAX1mZCp0tR45819r42dSZu-EY,16
|
6
|
-
adafruit_circuitpython_si5351-1.4.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|