Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addresses issue #88 #89

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions html/telemetrix/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,7 @@ <h1 class="title">Module <code>telemetrix.telemetrix</code></h1>
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):
&#34;&#34;&#34;
Read the specified number of bytes from the specified SPI port and
call the callback function with the reported data.
Expand All @@ -1864,6 +1864,10 @@ <h1 class="title">Module <code>telemetrix.telemetrix</code></h1>
: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&#39;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]
Expand All @@ -1885,7 +1889,7 @@ <h1 class="title">Module <code>telemetrix.telemetrix</code></h1>
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)

Expand Down Expand Up @@ -4427,7 +4431,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
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):
&#34;&#34;&#34;
Read the specified number of bytes from the specified SPI port and
call the callback function with the reported data.
Expand All @@ -4439,6 +4443,10 @@ <h2 class="section-title" id="header-classes">Classes</h2>
: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&#39;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]
Expand All @@ -4460,7 +4468,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
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)

Expand Down Expand Up @@ -6580,7 +6588,7 @@ <h3>Methods</h3>
</details>
</dd>
<dt id="telemetrix.telemetrix.Telemetrix.spi_read_blocking"><code class="name flex">
<span>def <span class="ident">spi_read_blocking</span></span>(<span>self, register_selection, number_of_bytes_to_read, call_back=None)</span>
<span>def <span class="ident">spi_read_blocking</span></span>(<span>self, register_selection, number_of_bytes_to_read, call_back=None, enable_read_bit=True)</span>
</code></dt>
<dd>
<div class="desc"><p>Read the specified number of bytes from the specified SPI port and
Expand All @@ -6589,6 +6597,9 @@ <h3>Methods</h3>
<p>:param number_of_bytes_to_read: Number of bytes to read</p>
<p>:param call_back: Required callback function to report spi data as a
result of read command</p>
<p>: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.</p>
<p>callback returns a data list:
[SPI_READ_REPORT, count of data bytes read, data bytes, time-stamp]</p>
<p>SPI_READ_REPORT = 13</p></div>
Expand All @@ -6597,7 +6608,7 @@ <h3>Methods</h3>
<span>Expand source code</span>
</summary>
<pre><code class="python">def spi_read_blocking(self, register_selection, number_of_bytes_to_read,
call_back=None):
call_back=None, enable_read_bit=True):
&#34;&#34;&#34;
Read the specified number of bytes from the specified SPI port and
call the callback function with the reported data.
Expand All @@ -6609,6 +6620,10 @@ <h3>Methods</h3>
: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&#39;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]
Expand All @@ -6630,7 +6645,7 @@ <h3>Methods</h3>
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)</code></pre>
</details>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]" },
]
Expand Down
2 changes: 1 addition & 1 deletion telemetrix/private_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions telemetrix/telemetrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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]
Expand All @@ -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)

Expand Down