Skip to content

Fixes issues #4, #6 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions adafruit_si5351.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def configure_fractional(self, multiplier, numerator, denominator):
susceptible to jitter but allows a larger range of PLL frequencies.
"""
assert 14 < multiplier < 91
assert 0 < denominator < 0xFFFFF # Prevent divide by zero.
assert 0 < denominator <= 0xFFFFF # Prevent divide by zero.
assert 0 <= numerator < 0xFFFFF
multiplier = int(multiplier)
numerator = int(numerator)
Expand Down Expand Up @@ -295,7 +295,7 @@ def r_divider(self):

@r_divider.setter
def r_divider(self, divider):
assert 0 <= divider <= 6
assert 0 <= divider <= 7
reg_value = self._si5351._read_u8(self._r)
reg_value &= 0x0F
divider &= 0x07
Expand Down Expand Up @@ -347,7 +347,7 @@ def configure_fractional(self, pll, divider, numerator, denominator):
accurate but has a wider range of output frequencies.
"""
assert 3 < divider < 901
assert 0 < denominator < 0xFFFFF # Prevent divide by zero.
assert 0 < denominator <= 0xFFFFF # Prevent divide by zero.
assert 0 <= numerator < 0xFFFFF
divider = int(divider)
numerator = int(numerator)
Expand Down