|
@@ -24,3 +24,19 @@ def test__frequency_control_word_to_hertz(control_word, hertz):
|
|
|
)
|
|
|
def test__hertz_to_frequency_control_word(control_word, hertz):
|
|
|
assert cc1101.CC1101._hertz_to_frequency_control_word(hertz) == control_word
|
|
|
+
|
|
|
+
|
|
|
+@pytest.mark.parametrize(
|
|
|
+ ("mantissa", "exponent", "real"),
|
|
|
+ [
|
|
|
+
|
|
|
+
|
|
|
+ (34, 12, 115051),
|
|
|
+ (34, 12 + 1, 115051 * 2),
|
|
|
+ (34, 12 - 1, 115051 / 2),
|
|
|
+ ],
|
|
|
+)
|
|
|
+def test__symbol_rate_floating_point_to_real(mantissa, exponent, real):
|
|
|
+ assert cc1101.CC1101._symbol_rate_floating_point_to_real(
|
|
|
+ mantissa=mantissa, exponent=exponent
|
|
|
+ ) == pytest.approx(real, rel=1e-5)
|