|
@@ -443,6 +443,18 @@ class CC1101:
|
|
|
frend0 |= setting_index
|
|
|
self._write_burst(ConfigurationRegisterAddress.FREND0, [setting_index])
|
|
|
|
|
|
+ def _configure_defaults(self) -> None:
|
|
|
+
|
|
|
+ self._set_modulation_format(ModulationFormat.ASK_OOK)
|
|
|
+ self._set_power_amplifier_setting_index(1)
|
|
|
+ self._disable_data_whitening()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ self._write_burst(ConfigurationRegisterAddress.MCSM0, [0b010100])
|
|
|
+
|
|
|
def __enter__(self) -> "CC1101":
|
|
|
|
|
|
try:
|
|
@@ -471,16 +483,7 @@ class CC1101:
|
|
|
version, self._SUPPORTED_VERSION
|
|
|
)
|
|
|
)
|
|
|
-
|
|
|
- self._set_modulation_format(ModulationFormat.ASK_OOK)
|
|
|
- self._set_power_amplifier_setting_index(1)
|
|
|
- self._disable_data_whitening()
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- self._write_burst(ConfigurationRegisterAddress.MCSM0, [0b010100])
|
|
|
+ self._configure_defaults()
|
|
|
marcstate = self.get_main_radio_control_state_machine_state()
|
|
|
if marcstate != MainRadioControlStateMachineState.IDLE:
|
|
|
raise ValueError("expected marcstate idle (actual: {})".format(marcstate))
|