Skip to content

Commit f15c30f

Browse files
authored
compensate for newer (undocumented) firmware (#15)
# Breaking Change The trackpad's DataReady (DR) is now a required parameter for the constructors. ## Support for new trackpad firmware Introduces a new property `PinnacleTouch.rev2025`. The following functionality is affected on the trackpads where this property returns `True`: - `sample_rate` cannot exceed 100 - `detect_finger_stylus()` is non-operational - `tune_edge_sensitivity()` is non-operational - `calibration_matrix` is non-operational - `set_adc_gain()` is non-operational ## Chores Other changes involve house keeping chores like - spelling fixes - pre-commit hook updates - formatting changes - doc updates - RTD config updates
1 parent f7d8217 commit f15c30f

12 files changed

+201
-93
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
repos:
2-
- repo: https://github.com/python/black
3-
rev: 23.11.0
4-
hooks:
5-
- id: black
62
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.5.0
3+
rev: v5.0.0
84
hooks:
95
- id: check-yaml
106
- id: end-of-file-fixer
117
- id: trailing-whitespace
128
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: v0.1.7
9+
rev: v0.11.4
1410
hooks:
11+
# Run the linter.
1512
- id: ruff
13+
# Run the formatter.
14+
- id: ruff-format
1615
- repo: https://github.com/pre-commit/mirrors-mypy
17-
rev: v1.7.1
16+
rev: v1.15.0
1817
hooks:
1918
- id: mypy
2019
name: mypy (library code)

.readthedocs.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
version: 2
22

3+
sphinx:
4+
# Path to your Sphinx configuration file.
5+
configuration: docs/conf.py
6+
37
build:
4-
os: "ubuntu-22.04"
8+
os: "ubuntu-24.04"
59
tools:
6-
python: "3.11"
10+
python: "latest"
711

812
python:
913
install:

circuitpython_cirque_pinnacle.py

Lines changed: 131 additions & 58 deletions
Large diffs are not rendered by default.

cspell.config.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: "0.2"
2+
words:
3+
- adafruit
4+
- autoattribute
5+
- autoclass
6+
- automethod
7+
- ANYMEAS
8+
- ASIC
9+
- baudrate
10+
- busio
11+
- circuitpython
12+
- datasheet
13+
- digitalio
14+
- intellimouse
15+
- micropython
16+
- MOSI
17+
- Muxing
18+
- pipx
19+
- seealso
20+
- sparkfun
21+
- tolower
22+
- trackpad
23+
- trackpads

docs/anymeas.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ AnyMeas mode Control
8888
These constants control the number of measurements performed in `measure_adc()`.
8989
The number of measurements can range [0, 63].
9090

91-
.. autodata:: circuitpython_cirque_pinnacle.PINNACLE_CRTL_REPEAT
91+
.. autodata:: circuitpython_cirque_pinnacle.PINNACLE_CTRL_REPEAT
9292
:no-value:
9393

94-
.. autodata:: circuitpython_cirque_pinnacle.PINNACLE_CRTL_PWR_IDLE
94+
.. autodata:: circuitpython_cirque_pinnacle.PINNACLE_CTRL_PWR_IDLE
9595
:no-value:

docs/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ PinnacleTouch class
1919
:no-members:
2020

2121
.. autoattribute:: circuitpython_cirque_pinnacle.PinnacleTouch.data_mode
22+
.. autoattribute:: circuitpython_cirque_pinnacle.PinnacleTouch.rev2025
2223

2324
SPI & I2C Interfaces
2425
--------------------

docs/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# pylint: disable=invalid-name,too-few-public-methods
22
"""This file is for `sphinx-build` configuration"""
3+
34
import os
45
import sys
56

@@ -86,6 +87,10 @@
8687
:language: python
8788
:class: highlight
8889
.. default-literal-role:: python
90+
91+
.. |rev2025| replace:: not supported on trackpads manufactured on or after 2025.
92+
Defer to :py:attr:`~circuitpython_cirque_pinnacle.PinnacleTouch.rev2025`.
93+
.. |rev2025-no-effect| replace:: on newer trackpads will have no effect
8994
"""
9095

9196
# If true, '()' will be appended to :func: etc. cross-reference text.
@@ -112,6 +117,13 @@
112117
],
113118
# Set the color and the accent color
114119
"palette": [
120+
{
121+
"media": "(prefers-color-scheme)",
122+
"toggle": {
123+
"icon": "material/brightness-auto",
124+
"name": "Switch to light mode",
125+
},
126+
},
115127
{
116128
"media": "(prefers-color-scheme: light)",
117129
"scheme": "default",

examples/cirque_pinnacle_absolute_mode.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
A simple example of using the Pinnacle ASIC in absolute mode.
33
"""
4+
45
import math
56
import sys
67
import time
@@ -17,21 +18,18 @@
1718

1819
print("Cirque Pinnacle absolute mode\n")
1920

20-
# a HW ``dr_pin`` is more efficient, but not required for Absolute or Relative modes
21-
dr_pin = None
22-
if not input("Use SW Data Ready? [y/N] ").lower().startswith("y"):
23-
print("-- Using HW Data Ready pin.")
24-
dr_pin = DigitalInOut(board.D7 if not IS_ON_LINUX else board.D25)
21+
# the pin connected to the trackpad's DR pin.
22+
dr_pin = DigitalInOut(board.D7 if not IS_ON_LINUX else board.D25)
2523

2624
if not input("Is the trackpad configured for I2C? [y/N] ").lower().startswith("y"):
2725
print("-- Using SPI interface.")
2826
spi = board.SPI()
2927
ss_pin = DigitalInOut(board.D2 if not IS_ON_LINUX else board.CE0)
30-
trackpad = PinnacleTouchSPI(spi, ss_pin, dr_pin=dr_pin)
28+
trackpad = PinnacleTouchSPI(spi, ss_pin, dr_pin)
3129
else:
3230
print("-- Using I2C interface.")
3331
i2c = board.I2C()
34-
trackpad = PinnacleTouchI2C(i2c, dr_pin=dr_pin)
32+
trackpad = PinnacleTouchI2C(i2c, dr_pin)
3533

3634
trackpad.data_mode = PINNACLE_ABSOLUTE # ensure Absolute mode is enabled
3735
trackpad.absolute_mode_config(z_idle_count=1) # limit idle packet count to 1

examples/cirque_pinnacle_anymeas_mode.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
A simple example of using the Pinnacle ASIC in anymeas mode.
33
"""
4+
45
import sys
56
import time
67
import board
@@ -15,18 +16,18 @@
1516

1617
print("Cirque Pinnacle anymeas mode\n")
1718

18-
# Using HW Data Ready pin as required for Anymeas mode
19+
# the pin connected to the trackpad's DR pin.
1920
dr_pin = DigitalInOut(board.D7 if not IS_ON_LINUX else board.D25)
2021

2122
if not input("Is the trackpad configured for I2C? [y/N] ").lower().startswith("y"):
2223
print("-- Using SPI interface.")
2324
spi = board.SPI()
2425
ss_pin = DigitalInOut(board.D2 if not IS_ON_LINUX else board.CE0)
25-
trackpad = PinnacleTouchSPI(spi, ss_pin, dr_pin=dr_pin)
26+
trackpad = PinnacleTouchSPI(spi, ss_pin, dr_pin)
2627
else:
2728
print("-- Using I2C interface.")
2829
i2c = board.I2C()
29-
trackpad = PinnacleTouchI2C(i2c, dr_pin=dr_pin)
30+
trackpad = PinnacleTouchI2C(i2c, dr_pin)
3031

3132
trackpad.data_mode = PINNACLE_ANYMEAS
3233

examples/cirque_pinnacle_relative_mode.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
A simple example of using the Pinnacle ASIC in relative mode.
33
"""
4+
45
import sys
56
import time
67
import board
@@ -16,21 +17,18 @@
1617

1718
print("Cirque Pinnacle relative mode\n")
1819

19-
# a HW ``dr_pin`` is more efficient, but not required for Absolute or Relative modes
20-
dr_pin = None
21-
if not input("Use SW Data Ready? [y/N] ").lower().startswith("y"):
22-
print("-- Using HW Data Ready pin.")
23-
dr_pin = DigitalInOut(board.D7 if not IS_ON_LINUX else board.D25)
20+
# the pin connected to the trackpad's DR pin.
21+
dr_pin = DigitalInOut(board.D7 if not IS_ON_LINUX else board.D25)
2422

2523
if not input("Is the trackpad configured for I2C? [y/N] ").lower().startswith("y"):
2624
print("-- Using SPI interface.")
2725
spi = board.SPI()
2826
ss_pin = DigitalInOut(board.D2 if not IS_ON_LINUX else board.CE0)
29-
trackpad = PinnacleTouchSPI(spi, ss_pin, dr_pin=dr_pin)
27+
trackpad = PinnacleTouchSPI(spi, ss_pin, dr_pin)
3028
else:
3129
print("-- Using I2C interface.")
3230
i2c = board.I2C()
33-
trackpad = PinnacleTouchI2C(i2c, dr_pin=dr_pin)
31+
trackpad = PinnacleTouchI2C(i2c, dr_pin)
3432

3533
trackpad.data_mode = PINNACLE_RELATIVE # ensure mouse mode is enabled
3634
trackpad.relative_mode_config(True) # enable tap detection

0 commit comments

Comments
 (0)