216
217
218
219
220
221
222
223
224
225
226
227
228
229
| self.configure(config)
if len(self.__register_map) != 53:
raise ValueError('Inconsistent register map!')
return None
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:
|
>
>
>
| 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
| result[key] = key_value
# Return the filled in structure
return result
def configure(self, config):
self.__config = config
self.__spi.max_speed_hz = self.__config.get('frequency', 4000000)
return None
def initialize(self):
self.__reset_device()
|
>
>
>
| 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()
|