options.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # python-cc1101 - Python Library to Transmit RF Signals via CC1101 Transceivers
  2. #
  3. # Copyright (C) 2020 Fabian Peter Hammerle <fabian@hammerle.me>
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. import enum
  18. class GDOSignalSelection(enum.IntEnum):
  19. """
  20. GDO{0,1,2}_CFG
  21. Table 41: GDOx Signal Selection (x = 0, 1, or 2)
  22. """
  23. # > Associated to the RX FIFO:
  24. # > Asserts when RX FIFO is filled at or above the RX FIFO threshold
  25. # > or the end of packet is reached. De-asserts when the RX FIFO is empty.
  26. RX_FIFO_AT_OR_ABOVE_THRESHOLD_OR_PACKET_END_REACHED = 0x01
  27. class PacketLengthMode(enum.IntEnum):
  28. """
  29. PKTCTRL0.LENGTH_CONFIG
  30. """
  31. FIXED = 0b00
  32. VARIABLE = 0b01
  33. # INFINITE = 0b10
  34. class ModulationFormat(enum.IntEnum):
  35. """
  36. MDMCFG2.MOD_FORMAT
  37. """
  38. FSK2 = 0b000
  39. GFSK = 0b001
  40. ASK_OOK = 0b011
  41. FSK4 = 0b100
  42. MSK = 0b111
  43. class SyncMode(enum.IntEnum):
  44. """
  45. MDMCFG2.SYNC_MODE
  46. see "14.3 Byte Synchronization"
  47. """
  48. NO_PREAMBLE_AND_SYNC_WORD = 0b00
  49. TRANSMIT_16_MATCH_15_BITS = 0b01
  50. TRANSMIT_16_MATCH_16_BITS = 0b10
  51. TRANSMIT_32_MATCH_30_BITS = 0b11