From 9984f64584daf26ad90b5c72aebfb68e03d6caa7 Mon Sep 17 00:00:00 2001 From: MrYsLab Date: Wed, 23 Oct 2024 15:42:10 -0400 Subject: [PATCH] Addresses issue #88 --- html/telemetrix/index.html | 29 ++++++++++++++++++++++------- pyproject.toml | 2 +- telemetrix/private_constants.py | 2 +- telemetrix/telemetrix.py | 8 ++++++-- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/html/telemetrix/index.html b/html/telemetrix/index.html index 6321047..29287fe 100644 --- a/html/telemetrix/index.html +++ b/html/telemetrix/index.html @@ -1852,7 +1852,7 @@

Module telemetrix.telemetrix

self._send_command(command) def spi_read_blocking(self, register_selection, number_of_bytes_to_read, - call_back=None): + call_back=None, enable_read_bit=True): """ Read the specified number of bytes from the specified SPI port and call the callback function with the reported data. @@ -1864,6 +1864,10 @@

Module telemetrix.telemetrix

:param call_back: Required callback function to report spi data as a result of read command + :param enable_read_bit: Many SPI devices require that the register + selection be OR'ed with 0x80. If set to True + the bit will be set. + callback returns a data list: [SPI_READ_REPORT, count of data bytes read, data bytes, time-stamp] @@ -1885,7 +1889,7 @@

Module telemetrix.telemetrix

self.spi_callback = call_back command = [PrivateConstants.SPI_READ_BLOCKING, number_of_bytes_to_read, - register_selection] + register_selection, enable_read_bit] self._send_command(command) @@ -4427,7 +4431,7 @@

Classes

self._send_command(command) def spi_read_blocking(self, register_selection, number_of_bytes_to_read, - call_back=None): + call_back=None, enable_read_bit=True): """ Read the specified number of bytes from the specified SPI port and call the callback function with the reported data. @@ -4439,6 +4443,10 @@

Classes

:param call_back: Required callback function to report spi data as a result of read command + :param enable_read_bit: Many SPI devices require that the register + selection be OR'ed with 0x80. If set to True + the bit will be set. + callback returns a data list: [SPI_READ_REPORT, count of data bytes read, data bytes, time-stamp] @@ -4460,7 +4468,7 @@

Classes

self.spi_callback = call_back command = [PrivateConstants.SPI_READ_BLOCKING, number_of_bytes_to_read, - register_selection] + register_selection, enable_read_bit] self._send_command(command) @@ -6580,7 +6588,7 @@

Methods

-def spi_read_blocking(self, register_selection, number_of_bytes_to_read, call_back=None) +def spi_read_blocking(self, register_selection, number_of_bytes_to_read, call_back=None, enable_read_bit=True)

Read the specified number of bytes from the specified SPI port and @@ -6589,6 +6597,9 @@

Methods

:param number_of_bytes_to_read: Number of bytes to read

:param call_back: Required callback function to report spi data as a result of read command

+

:param enable_read_bit: Many SPI devices require that the register +selection be OR'ed with 0x80. If set to True +the bit will be set.

callback returns a data list: [SPI_READ_REPORT, count of data bytes read, data bytes, time-stamp]

SPI_READ_REPORT = 13

@@ -6597,7 +6608,7 @@

Methods

Expand source code
def spi_read_blocking(self, register_selection, number_of_bytes_to_read,
-                      call_back=None):
+                      call_back=None, enable_read_bit=True):
     """
     Read the specified number of bytes from the specified SPI port and
     call the callback function with the reported data.
@@ -6609,6 +6620,10 @@ 

Methods

:param call_back: Required callback function to report spi data as a result of read command + :param enable_read_bit: Many SPI devices require that the register + selection be OR'ed with 0x80. If set to True + the bit will be set. + callback returns a data list: [SPI_READ_REPORT, count of data bytes read, data bytes, time-stamp] @@ -6630,7 +6645,7 @@

Methods

self.spi_callback = call_back command = [PrivateConstants.SPI_READ_BLOCKING, number_of_bytes_to_read, - register_selection] + register_selection, enable_read_bit] self._send_command(command)
diff --git a/pyproject.toml b/pyproject.toml index 9d89e42..1710419 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ find = {} # Scan the project directory with the default parameters [project] name = "telemetrix" -version = "1.40" +version = "1.41" authors = [ { name="Alan Yorinks", email="MisterYsLab@gmail.com" }, ] diff --git a/telemetrix/private_constants.py b/telemetrix/private_constants.py index 2c97e7a..f530d97 100644 --- a/telemetrix/private_constants.py +++ b/telemetrix/private_constants.py @@ -103,7 +103,7 @@ class PrivateConstants: FEATURES = 20 DEBUG_PRINT = 99 - TELEMETRIX_VERSION = "1.40" + TELEMETRIX_VERSION = "1.41" # reporting control REPORTING_DISABLE_ALL = 0 diff --git a/telemetrix/telemetrix.py b/telemetrix/telemetrix.py index 86c2232..68ffe09 100644 --- a/telemetrix/telemetrix.py +++ b/telemetrix/telemetrix.py @@ -1809,7 +1809,7 @@ def spi_cs_control(self, chip_select_pin, select): self._send_command(command) def spi_read_blocking(self, register_selection, number_of_bytes_to_read, - call_back=None): + call_back=None, enable_read_bit=True): """ Read the specified number of bytes from the specified SPI port and call the callback function with the reported data. @@ -1821,6 +1821,10 @@ def spi_read_blocking(self, register_selection, number_of_bytes_to_read, :param call_back: Required callback function to report spi data as a result of read command + :param enable_read_bit: Many SPI devices require that the register + selection be OR'ed with 0x80. If set to True + the bit will be set. + callback returns a data list: [SPI_READ_REPORT, count of data bytes read, data bytes, time-stamp] @@ -1842,7 +1846,7 @@ def spi_read_blocking(self, register_selection, number_of_bytes_to_read, self.spi_callback = call_back command = [PrivateConstants.SPI_READ_BLOCKING, number_of_bytes_to_read, - register_selection] + register_selection, enable_read_bit] self._send_command(command)