Browse Source

added method to enable manchester encoding & decoding

Fabian Peter Hammerle 3 years ago
parent
commit
dfccbf86ea
1 changed files with 10 additions and 0 deletions
  1. 10 0
      cc1101/__init__.py

+ 10 - 0
cc1101/__init__.py

@@ -227,6 +227,16 @@ class CC1101:
         mdmcfg2 |= modulation_format << 4
         self._write_burst(ConfigurationRegisterAddress.MDMCFG2, [mdmcfg2])
 
+    def enable_manchester_code(self) -> None:
+        """
+        MDMCFG2.MANCHESTER_EN
+
+        Enable manchester encoding & decoding.
+        """
+        mdmcfg2 = self._read_single_byte(ConfigurationRegisterAddress.MDMCFG2)
+        mdmcfg2 |= 0b1000
+        self._write_burst(ConfigurationRegisterAddress.MDMCFG2, [mdmcfg2])
+
     def _set_power_amplifier_setting_index(self, setting_index: int) -> None:
         """
         FREND0.PA_POWER