adafruit-circuitpython-si5351 1.4.2__tar.gz → 1.4.6__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/.readthedocs.yaml +3 -0
  2. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/PKG-INFO +2 -2
  3. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/adafruit_circuitpython_si5351.egg-info/PKG-INFO +2 -2
  4. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/adafruit_si5351.py +33 -31
  5. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/docs/conf.py +0 -1
  6. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/docs/requirements.txt +2 -1
  7. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/pyproject.toml +1 -1
  8. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md +0 -0
  9. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/.github/workflows/build.yml +0 -0
  10. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/.github/workflows/failure-help-text.yml +0 -0
  11. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/.github/workflows/release_gh.yml +0 -0
  12. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/.github/workflows/release_pypi.yml +0 -0
  13. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/.gitignore +0 -0
  14. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/.pre-commit-config.yaml +0 -0
  15. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/.pylintrc +0 -0
  16. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/CODE_OF_CONDUCT.md +0 -0
  17. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/LICENSE +0 -0
  18. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/LICENSES/CC-BY-4.0.txt +0 -0
  19. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/LICENSES/MIT.txt +0 -0
  20. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/LICENSES/Unlicense.txt +0 -0
  21. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/README.rst +0 -0
  22. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/README.rst.license +0 -0
  23. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/adafruit_circuitpython_si5351.egg-info/SOURCES.txt +0 -0
  24. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/adafruit_circuitpython_si5351.egg-info/dependency_links.txt +0 -0
  25. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/adafruit_circuitpython_si5351.egg-info/requires.txt +0 -0
  26. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/adafruit_circuitpython_si5351.egg-info/top_level.txt +0 -0
  27. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/docs/_static/favicon.ico +0 -0
  28. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/docs/_static/favicon.ico.license +0 -0
  29. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/docs/api.rst +0 -0
  30. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/docs/api.rst.license +0 -0
  31. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/docs/examples.rst +0 -0
  32. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/docs/examples.rst.license +0 -0
  33. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/docs/index.rst +0 -0
  34. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/docs/index.rst.license +0 -0
  35. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/examples/si5351_simpletest.py +0 -0
  36. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/optional_requirements.txt +0 -0
  37. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/requirements.txt +0 -0
  38. {adafruit-circuitpython-si5351-1.4.2 → adafruit_circuitpython_si5351-1.4.6}/setup.cfg +0 -0
@@ -8,6 +8,9 @@
8
8
  # Required
9
9
  version: 2
10
10
 
11
+ sphinx:
12
+ configuration: docs/conf.py
13
+
11
14
  build:
12
15
  os: ubuntu-20.04
13
16
  tools:
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: adafruit-circuitpython-si5351
3
- Version: 1.4.2
3
+ Version: 1.4.6
4
4
  Summary: CircuitPython library for SI5351 clock generator module.
5
5
  Author-email: Adafruit Industries <circuitpython@adafruit.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: adafruit-circuitpython-si5351
3
- Version: 1.4.2
3
+ Version: 1.4.6
4
4
  Summary: CircuitPython library for SI5351 clock generator module.
5
5
  Author-email: Adafruit Industries <circuitpython@adafruit.com>
6
6
  License: MIT
@@ -24,7 +24,7 @@ try:
24
24
  except ImportError:
25
25
  pass
26
26
 
27
- __version__ = "1.4.2"
27
+ __version__ = "1.4.6"
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
- # The datasheet is a nightmare of typos and inconsistencies here!
165
- self._si5351._write_u8(self._base, (p3 & 0x0000FF00) >> 8)
166
- self._si5351._write_u8(self._base + 1, (p3 & 0x000000FF))
167
- self._si5351._write_u8(self._base + 2, (p1 & 0x00030000) >> 16)
168
- self._si5351._write_u8(self._base + 3, (p1 & 0x0000FF00) >> 8)
169
- self._si5351._write_u8(self._base + 4, (p1 & 0x000000FF))
170
- self._si5351._write_u8(
171
- self._base + 5, ((p3 & 0x000F0000) >> 12) | ((p2 & 0x000F0000) >> 16)
172
- )
173
- self._si5351._write_u8(self._base + 6, (p2 & 0x0000FF00) >> 8)
174
- self._si5351._write_u8(self._base + 7, (p2 & 0x000000FF))
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._write_u8(self._base, (p3 & 0x0000FF00) >> 8)
315
- self._si5351._write_u8(self._base + 1, (p3 & 0x000000FF))
316
- self._si5351._write_u8(self._base + 2, (p1 & 0x00030000) >> 16)
317
- self._si5351._write_u8(self._base + 3, (p1 & 0x0000FF00) >> 8)
318
- self._si5351._write_u8(self._base + 4, (p1 & 0x000000FF))
319
- self._si5351._write_u8(
320
- self._base + 5, ((p3 & 0x000F0000) >> 12) | ((p2 & 0x000F0000) >> 16)
321
- )
322
- self._si5351._write_u8(self._base + 6, (p2 & 0x0000FF00) >> 8)
323
- self._si5351._write_u8(self._base + 7, (p2 & 0x000000FF))
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(2)
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
- self._write_u8(_SI5351_REGISTER_16_CLK0_CONTROL, 0x80)
418
- self._write_u8(_SI5351_REGISTER_17_CLK1_CONTROL, 0x80)
419
- self._write_u8(_SI5351_REGISTER_18_CLK2_CONTROL, 0x80)
420
- self._write_u8(_SI5351_REGISTER_19_CLK3_CONTROL, 0x80)
421
- self._write_u8(_SI5351_REGISTER_20_CLK4_CONTROL, 0x80)
422
- self._write_u8(_SI5351_REGISTER_21_CLK5_CONTROL, 0x80)
423
- self._write_u8(_SI5351_REGISTER_22_CLK6_CONTROL, 0x80)
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))
@@ -104,7 +104,6 @@ todo_emit_warnings = True
104
104
  import sphinx_rtd_theme
105
105
 
106
106
  html_theme = "sphinx_rtd_theme"
107
- html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
108
107
 
109
108
  # Add any paths that contain custom static files (such as style sheets) here,
110
109
  # relative to this directory. They are copied after the builtin static files,
@@ -2,5 +2,6 @@
2
2
  #
3
3
  # SPDX-License-Identifier: Unlicense
4
4
 
5
- sphinx>=4.0.0
5
+ sphinx
6
6
  sphinxcontrib-jquery
7
+ sphinx-rtd-theme
@@ -12,7 +12,7 @@ requires = [
12
12
  [project]
13
13
  name = "adafruit-circuitpython-si5351"
14
14
  description = "CircuitPython library for SI5351 clock generator module."
15
- version = "1.4.2"
15
+ version = "1.4.6"
16
16
  readme = "README.rst"
17
17
  authors = [
18
18
  {name = "Adafruit Industries", email = "circuitpython@adafruit.com"}