Python LT8900 via SPI

Check-in [772747db6a]
Login
Overview
Comment:Increase delay and log initialization error
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 772747db6aa7c97087d00da75de5c2f43063f169a0c5502f20056249112dc8b2
User & Date: rkeene on 2021-01-26 22:14:03
Other Links: manifest | tags
Context
2023-09-10
16:44
lt8900_spi v2.6 Leaf check-in: bda28aae66 user: rkeene tags: 2.6, trunk
2021-01-26
22:14
Increase delay and log initialization error check-in: 772747db6a user: rkeene tags: trunk
2020-08-27
17:07
Power setting improvements check-in: b3c15d5abe user: rkeene tags: trunk
Changes

Modified lt8900_spi/__init__.py from [d0dcbf6c9f] to [403f6b57bc].

367
368
369
370
371
372
373



374
375
376
377
378
379
380
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383







+
+
+








	def _check_radio(self):
		value1 = self.get_register(0);
		value2 = self.get_register(1);

		if value1 == 0x6fe0 and value2 == 0x5681:
			return True

		self._debug(f'Expected 0x6fe0, 0x5681 and got 0x{value1:04x}, 0x{value2:04x}')

		return False

	def _get_default_register_value(self, register):
		return self._default_register_values.get(register, {})

	def _set_default_register_values(self):
		self._last_format_config = {}
669
670
671
672
673
674
675
676
677


678
679
680
681
682
683
684
672
673
674
675
676
677
678


679
680
681
682
683
684
685
686
687







-
-
+
+








		return sent_packet

	def multi_transmit(self, message, channels, retries = 3, delay = 0.1, syncword = None, submit_queue = '__DEFAULT__', format_config = None):
		if len(channels) == 0 or retries == 0:
			self._error("Asked to send the message {} a total of zero times ({} channels, {} retries)".format(message, channels, retries))

		# Wait at-least 350 microseconds between frames
		min_delay = 350.0 / 1000000.0
		# Wait at-least 650 microseconds between frames
		min_delay = 650.0 / 1000000.0
		post_delay = min_delay
		final_delay = delay

		for channel_idx in range(len(channels)):
			if channel_idx == (len(channels) - 1):
				retries -= 1
			channel = channels[channel_idx]