Python LT8900 via SPI

Check-in [76231bcd4f]
Login
Overview
Comment:Destructor and sanity check
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 76231bcd4fedbd9c6e67ad5299029abcf18c65a8215711da5ab5d4d8c9302c36
User & Date: rkeene on 2020-04-27 13:09:23
Other Links: manifest | tags
Context
2020-04-27
13:24
More registers and check packet flag check-in: 5f96d4e6ca user: rkeene tags: trunk
13:09
Destructor and sanity check check-in: 76231bcd4f user: rkeene tags: trunk
05:41
Added a receiver and some more cleanup check-in: e8d876f343 user: rkeene tags: trunk
Changes

Modified __init__.py from [74be7dbad8] to [ab32593f38].

216
217
218
219
220
221
222



223
224
225
226
227
228
229
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232







+
+
+







		self.configure(config)

		if len(self.__register_map) != 53:
			raise ValueError('Inconsistent register map!')

		return None

	def __del__(self):
		self.__spi.close()

	def __debug(self, message):
		print("DEBUG: " + message)
		return None

	def __reset_device(self):
		if self.__config is not None:
			if self.__config['reset_command'] is not None:
383
384
385
386
387
388
389



390
391
392
393
394
395
396
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402







+
+
+







			result[key] = key_value

		# Return the filled in structure
		return result

	def configure(self, config):
		self.__config = config

		if config is None:
			return None

		self.__spi.max_speed_hz = self.__config.get('frequency', 4000000)

		return None

	def initialize(self):
		self.__reset_device()