Skip to content

Commit f8a3013

Browse files
committed
review docs
1 parent ca91a36 commit f8a3013

File tree

6 files changed

+94
-64
lines changed

6 files changed

+94
-64
lines changed

cspell.config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ words:
1616
- CIBW
1717
- cirquepinnacle
1818
- cpack
19+
- CPHA
1920
- cppreference
2021
- cpython
2122
- CROSSCOMPILING
23+
- cxxabiv
2224
- datasheet
2325
- DCMAKE
2426
- Doherty
@@ -38,9 +40,11 @@ words:
3840
- libnewlib
3941
- linenos
4042
- literalinclude
43+
- LSBFIRST
4144
- Makefiles
4245
- manylinux
4346
- MOSI
47+
- MSBFIRST
4448
- musllinux
4549
- Muxing
4650
- Ofast
@@ -67,6 +71,7 @@ words:
6771
- SPARFUN
6872
- Sparkfun
6973
- spidev
74+
- stddef
7075
- stdlib
7176
- STREQUAL
7277
- THINGPLUS

docs/conf.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
"Thumbs.db",
6161
".DS_Store",
6262
".env",
63-
"CODE_OF_CONDUCT.mdrequirements.txt",
63+
"API/cpp-generated/__gnu_cxx.__alloc_traits.rst",
64+
"API/cpp-generated/__cxxabiv1.__forced_unwind.rst",
6465
]
6566

6667
# The reST default role (used for this markup: `text`) to use for all
@@ -182,10 +183,18 @@
182183
include_directory_map={
183184
f"{cpp_src_dir}/": "",
184185
},
185-
allow_paths=["utility/template/", "utility/includes.h", ""],
186-
disallow_paths=["utility/[^template]/"],
186+
allow_paths=["utility/template/", "utility/includes.h", "", "__.*"],
187+
disallow_paths=[
188+
"utility/[^template]/",
189+
".*/bits/char_traits.h",
190+
".*_init_exception.h",
191+
".*/numeric_traits.h",
192+
".*/type_traits",
193+
],
194+
ignore_diagnostics=["'stddef.h' file not found"],
187195
disallow_namespaces=["^std$"],
188196
allow_macros=["^PINNACLE_"],
197+
disallow_macros=["PINNACLE_ANYMEAS_SUPPORT", "PINNACLE_SS_CTRL"],
189198
allow_symbols=["^PINNACLE_"],
190199
verbose=True,
191200
),
@@ -204,6 +213,9 @@
204213
.. |dr_pin_required| replace::
205214
Previously, this parameter conditionally accepted a sentinel value to use the
206215
"SW Data Ready" flag in the STATUS_1 register.
216+
.. |rev2025| replace:: not supported on trackpads manufactured on or after 2025.
217+
Defer to `~PinnacleTouch::isRev2025`.
218+
.. |rev2025-no-effect| replace:: on newer trackpads will have no effect
207219
"""
208220

209221
cpp_apigen_rst_prolog = """

src/CirquePinnacle.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,17 @@ bool PinnacleTouch::begin()
4040
buffer[0] = 0; // config power (defaults) and disable anymeas flags
4141
buffer[1] = 0; // config absolute mode defaults and disable feed
4242
rapWriteBytes(PINNACLE_SYS_CONFIG, buffer, 3);
43-
detectFingerStylus(); // detects both finger & stylus; sets sample rate to 100
43+
if (!_rev2025) {
44+
detectFingerStylus(); // detects both finger & stylus; sets sample rate to 100
45+
}
46+
else {
47+
setSampleRate(100);
48+
}
4449
rapWrite(PINNACLE_Z_IDLE, 30); // 30 z-idle packets
45-
setAdcGain(0); // most sensitive attenuation
46-
tuneEdgeSensitivity(); // because "why not?" (may only be beneficial if using an overlay)
50+
if (!_rev2025) {
51+
setAdcGain(0); // most sensitive attenuation
52+
tuneEdgeSensitivity(); // because "why not?" (may only be beneficial if using an overlay)
53+
}
4754
while (available()) {
4855
clearStatusFlags(); // ignore/discard all pending measurements waiting to be read()
4956
}

src/CirquePinnacle.h

Lines changed: 60 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <stdint.h>
2222
#include "CirquePinnacle_common.h"
2323

24-
/** Defined constants for Pinnacle registers */
24+
/* Defined constants for Pinnacle registers */
2525
#define PINNACLE_FIRMWARE_ID 0x00
2626
#define PINNACLE_STATUS 0x02
2727
#define PINNACLE_SYS_CONFIG 0x03
@@ -167,9 +167,9 @@ enum PinnacleAnyMeasMuxing : uint8_t
167167
enum PinnacleAnyMeasCtrl : uint8_t
168168
{
169169
/** only required for more than 1 measurement */
170-
PINNACLE_CRTL_REPEAT = 0x80,
170+
PINNACLE_CTRL_REPEAT = 0x80,
171171
/** triggers low power mode (sleep) after completing measurements */
172-
PINNACLE_CRTL_PWR_IDLE = 0x40,
172+
PINNACLE_CTRL_PWR_IDLE = 0x40,
173173
};
174174

175175
#endif // PINNACLE_ANYMEAS_SUPPORT == false
@@ -294,8 +294,8 @@ class PinnacleTouch
294294
PinnacleTouch(pinnacle_gpio_t dataReadyPin);
295295
/**
296296
* This function controls if the touch/button event data is reported or
297-
* not. It only applies to `PINNACLE_RELATIVE` or `PINNACLE_ABSOLUTE`
298-
* mode, otherwise if `setDataMode()` is given `PINNACLE_ANYMEAS`, then this
297+
* not. It only applies to `~PinnacleDataMode::PINNACLE_RELATIVE` or `~PinnacleDataMode::PINNACLE_ABSOLUTE`
298+
* mode, otherwise if `setDataMode()` is given `~PinnacleDataMode::PINNACLE_ANYMEAS`, then this
299299
* function will do nothing.
300300
*
301301
* @param isEnabled Enables (``true``) or disables (``false``) data reporting.
@@ -307,7 +307,7 @@ class PinnacleTouch
307307
*
308308
* @return
309309
* The setting configured by `feedEnabled()` or ``false`` if `setDataMode()`
310-
* is given `PINNACLE_ANYMEAS`.
310+
* is given `~PinnacleDataMode::PINNACLE_ANYMEAS`.
311311
*/
312312
bool isFeedEnabled();
313313
/**
@@ -318,9 +318,9 @@ class PinnacleTouch
318318
* .. csv-table::
319319
* :header: "``mode`` (enum value)", description
320320
*
321-
* ":expr:`PINNACLE_RELATIVE` (``0``)", "for relative/mouse mode"
322-
* ":expr:`PINNACLE_ANYMEAS` (``1``)", "for reading raw ADC values"
323-
* ":expr:`PINNACLE_ABSOLUTE` (``2``)", "for absolute positioning mode"
321+
* "`~PinnacleDataMode::PINNACLE_RELATIVE` (``0``)", "for relative/mouse mode"
322+
* "`~PinnacleDataMode::PINNACLE_ANYMEAS` (``1``)", "for reading raw ADC values"
323+
* "`~PinnacleDataMode::PINNACLE_ABSOLUTE` (``2``)", "for absolute positioning mode"
324324
*
325325
* Invalid input values have no affect.
326326
*/
@@ -329,16 +329,16 @@ class PinnacleTouch
329329
* This function describes which mode for which kind of data to report.
330330
*
331331
* .. important::
332-
* When switching from `PINNACLE_ANYMEAS` to `PINNACLE_RELATIVE`
333-
* or `PINNACLE_ABSOLUTE` all configurations are reset, and must be
332+
* When switching from `~PinnacleDataMode::PINNACLE_ANYMEAS` to `~PinnacleDataMode::PINNACLE_RELATIVE`
333+
* or `~PinnacleDataMode::PINNACLE_ABSOLUTE` all configurations are reset, and must be
334334
* re-configured by using `absoluteModeConfig()` or `relativeModeConfig()`.
335335
*
336336
* @return
337-
* - :expr:`PINNACLE_RELATIVE` (``0``) for relative mode (AKA mouse mode)
338-
* - :expr:`PINNACLE_ANYMEAS` (``1``) for anymeas mode (raw ADC measurements)
339-
* - :expr:`PINNACLE_ABSOLUTE` (``2``) for absolute mode (X & Y axis
337+
* - `~PinnacleDataMode::PINNACLE_RELATIVE` (``0``) for relative mode (AKA mouse mode)
338+
* - `~PinnacleDataMode::PINNACLE_ANYMEAS` (``1``) for anymeas mode (raw ADC measurements)
339+
* - `~PinnacleDataMode::PINNACLE_ABSOLUTE` (``2``) for absolute mode (X & Y axis
340340
* positions)
341-
* - :expr:`PINNACLE_ERROR` (``0xFF``) if `begin()` returns ``false`` (failed to
341+
* - `~PinnacleDataMode::PINNACLE_ERROR` (``0xFF``) if `begin()` returns ``false`` (failed to
342342
* initialize the trackpad)
343343
*/
344344
PinnacleDataMode getDataMode();
@@ -395,8 +395,8 @@ class PinnacleTouch
395395
bool available();
396396
/**
397397
* Configure settings specific to Absolute mode (reports axis positions). This function only
398-
* applies to `PINNACLE_ABSOLUTE` mode, otherwise if `setDataMode()` is given
399-
* `PINNACLE_ANYMEAS` or `PINNACLE_RELATIVE`, then this function does nothing.
398+
* applies to `~PinnacleDataMode::PINNACLE_ABSOLUTE` mode, otherwise if `setDataMode()` is given
399+
* `~PinnacleDataMode::PINNACLE_ANYMEAS` or `~PinnacleDataMode::PINNACLE_RELATIVE`, then this function does nothing.
400400
*
401401
* @param zIdleCount Specifies the number of empty packets (x-axis, y-axis, and z-axis
402402
* are ``0``) reported (every 10 milliseconds) when there is no touch detected. Defaults
@@ -411,8 +411,8 @@ class PinnacleTouch
411411
bool invertY = false);
412412
/**
413413
* Configure settings specific to Relative mode (AKA Mouse mode) data reporting. This function
414-
* only applies to `PINNACLE_RELATIVE` mode, otherwise if `setDataMode()` is given
415-
* `PINNACLE_ANYMEAS` or `PINNACLE_ABSOLUTE`, then this function does nothing.
414+
* only applies to `~PinnacleDataMode::PINNACLE_RELATIVE` mode, otherwise if `setDataMode()` is given
415+
* `~PinnacleDataMode::PINNACLE_ANYMEAS` or `~PinnacleDataMode::PINNACLE_ABSOLUTE`, then this function does nothing.
416416
*
417417
* @param taps Specifies if all taps should be reported (``true``) or not
418418
* (``false``). Default is ``true``. This affects `secondaryTap` option as well.
@@ -434,9 +434,9 @@ class PinnacleTouch
434434
bool glideExtend = false);
435435
/**
436436
* This function will fetch touch (and button) event data from the
437-
* Pinnacle ASIC. This function only applies to `PINNACLE_RELATIVE` mode,
438-
* otherwise if `setDataMode()` is given `PINNACLE_ANYMEAS` or
439-
* `PINNACLE_ABSOLUTE`, then this function does nothing.
437+
* Pinnacle ASIC. This function only applies to `~PinnacleDataMode::PINNACLE_RELATIVE` mode,
438+
* otherwise if `setDataMode()` is given `~PinnacleDataMode::PINNACLE_ANYMEAS` or
439+
* `~PinnacleDataMode::PINNACLE_ABSOLUTE`, then this function does nothing.
440440
*
441441
* @param[out] report A reference pointer (declared variable of datatype
442442
* `RelativeReport`) for storing the data that describes the touch (and
@@ -458,8 +458,8 @@ class PinnacleTouch
458458
/**
459459
* This function will fetch touch (and button) event data from the
460460
* Pinnacle ASIC (including empty packets on ending of a touch/button
461-
* event). This function only applies to `PINNACLE_ABSOLUTE` mode, otherwise
462-
* if `setDataMode()` is given `PINNACLE_ANYMEAS` or `PINNACLE_RELATIVE`,
461+
* event). This function only applies to `~PinnacleDataMode::PINNACLE_ABSOLUTE` mode, otherwise
462+
* if `setDataMode()` is given `~PinnacleDataMode::PINNACLE_ANYMEAS` or `~PinnacleDataMode::PINNACLE_RELATIVE`,
463463
* then this function does nothing.
464464
*
465465
* @param[out] report A reference pointer (declared variable of datatype
@@ -529,18 +529,23 @@ class PinnacleTouch
529529
bool isShutdown();
530530
/**
531531
* This function controls how many samples (of data) per second are
532-
* taken. This function only applies to `PINNACLE_RELATIVE` or
533-
* `PINNACLE_ABSOLUTE` mode, otherwise if `setDataMode()` is given
534-
* `PINNACLE_ANYMEAS`, then this function will do nothing.
532+
* taken. This function only applies to `~PinnacleDataMode::PINNACLE_RELATIVE` or
533+
* `~PinnacleDataMode::PINNACLE_ABSOLUTE` mode, otherwise if `setDataMode()` is given
534+
* `~PinnacleDataMode::PINNACLE_ANYMEAS`, then this function will do nothing.
535535
*
536536
* @param value Valid input values are ``100``, ``80``, ``60``, ``40``, ``20``,
537537
* ``10``. Any other input values automatically set the sample rate to 100
538-
* sps (samples per second). Optionally, ``200`` and ``300`` sps can be
538+
* sps (samples per second).
539+
*
540+
* Optionally, on older trackpads, ``200`` and ``300`` sps can be
539541
* specified, but using these optional values automatically disables palm
540542
* (referred to as "NERD" in the specification sheet) and noise
541543
* compensations. These higher values are meant for using a stylus with a
542544
* 2mm diameter tip, while the values less than 200 are meant for a finger
543545
* or stylus with a 5.25mm diameter tip.
546+
*
547+
* .. warning:: This method is |rev2025| Specifying the values ``200`` or ``300``
548+
* |rev2025-no-effect| and will be clamped to ``100``.
544549
*/
545550
void setSampleRate(uint16_t value);
546551
/**
@@ -549,7 +554,7 @@ class PinnacleTouch
549554
*
550555
* :Return:
551556
* The setting configured by `setSampleRate()` or ``0`` if `setDataMode()` is
552-
* given `PINNACLE_ANYMEAS`.
557+
* given `~PinnacleDataMode::PINNACLE_ANYMEAS`.
553558
*/
554559
uint16_t getSampleRate();
555560
/**
@@ -559,6 +564,8 @@ class PinnacleTouch
559564
* .. tip:: Consider adjusting the ADC matrix's gain to enhance
560565
* performance/results using `setAdcGain()`.
561566
*
567+
* .. warning:: This method is |rev2025| Calling this method |rev2025-no-effect|.
568+
*
562569
* @param enableFinger ``true`` enables the Pinnacle ASIC's measurements to
563570
* detect if the touch event was caused by a finger or 5.25mm stylus.
564571
* ``false`` disables this feature. Default is ``true``.
@@ -573,9 +580,9 @@ class PinnacleTouch
573580
uint16_t sampleRate = 100);
574581
/**
575582
* Set calibration parameters when the Pinnacle ASIC calibrates itself.
576-
* This function only applies to `PINNACLE_RELATIVE` or
577-
* `PINNACLE_ABSOLUTE` mode, otherwise if `setDataMode()` is given
578-
* `PINNACLE_ANYMEAS`, then this function will do nothing.
583+
* This function only applies to `~PinnacleDataMode::PINNACLE_RELATIVE` or
584+
* `~PinnacleDataMode::PINNACLE_ABSOLUTE` mode, otherwise if `setDataMode()` is given
585+
* `~PinnacleDataMode::PINNACLE_ANYMEAS`, then this function will do nothing.
579586
*
580587
* .. note:: According to the datasheet, calibration of the sensor takes about
581588
* 100 milliseconds. This function will block until calibration is complete
@@ -594,10 +601,10 @@ class PinnacleTouch
594601
* ``true``.
595602
* @returns
596603
* ``false``
597-
* - If `setDataMode()` is not set to `PINNACLE_RELATIVE` or `PINNACLE_ABSOLUTE`.
604+
* - If `setDataMode()` is not set to `~PinnacleDataMode::PINNACLE_RELATIVE` or `~PinnacleDataMode::PINNACLE_ABSOLUTE`.
598605
* - If the calibration `run` timed out after 100 milliseconds.
599606
* ``true``
600-
* - If `setDataMode()` is not given `PINNACLE_RELATIVE` or `PINNACLE_ABSOLUTE` and the
607+
* - If `setDataMode()` is not given `~PinnacleDataMode::PINNACLE_RELATIVE` or `~PinnacleDataMode::PINNACLE_ABSOLUTE` and the
601608
* calibration is not `run`.
602609
* - If the calibration `run` successfully finishes.
603610
*/
@@ -609,7 +616,9 @@ class PinnacleTouch
609616
/**
610617
* Manually sets the compensation matrix (array) of the 46 16-bit unsigned
611618
* integer values stored in the Pinnacle ASIC's memory that is used for
612-
* taking measurements. This matrix is not applicable to `PINNACLE_ANYMEAS` mode.
619+
* taking measurements. This matrix is not applicable to `~PinnacleDataMode::PINNACLE_ANYMEAS` mode.
620+
*
621+
* .. warning:: This method is |rev2025| Calling this method |rev2025-no-effect|.
613622
*
614623
* @param matrix The array of 16-bit unsigned integers that will be used
615624
* for compensation calculations when measuring of input events.
@@ -626,6 +635,8 @@ class PinnacleTouch
626635
* created internally by calling `calibrate()` with the ``run`` parameter as
627636
* ``true``.
628637
*
638+
* .. warning:: This method is |rev2025| Calling this method |rev2025-no-effect|.
639+
*
629640
* .. hint:: A note from Cirque's Application Note on Comparing matrices:
630641
*
631642
* If any 16-bit values are above 20K (absolute), it generally
@@ -652,10 +663,12 @@ class PinnacleTouch
652663
* Sets the ADC (Analog to Digital Converter) attenuation (gain ratio) to
653664
* enhance performance based on the overlay type. This does not apply to
654665
* AnyMeas mode. However, the input value specified can be written while
655-
* `setDataMode()` is given `PINNACLE_ANYMEAS`, but there is no guarantee that
666+
* `setDataMode()` is given `~PinnacleDataMode::PINNACLE_ANYMEAS`, but there is no guarantee that
656667
* it will "stick" as it may be overridden by the Pinnacle ASIC
657668
* (specification sheet does not imply either way).
658669
*
670+
* .. warning:: This method is |rev2025| Calling this method |rev2025-no-effect|.
671+
*
659672
* @param sensitivity This byte specifies how sensitive the ADC component
660673
* is. It must be in range [0, 3]. Where ``0`` means most sensitive, and ``3``
661674
* means least sensitive. A value outside this range will default to ``0``.
@@ -673,13 +686,15 @@ class PinnacleTouch
673686
* documented memory map for the Pinnacle ASIC as this function directly
674687
* alters values in the Pinnacle ASIC's memory. ALTER THESE PARAMETERS AT
675688
* YOUR OWN RISK!
689+
*
690+
* .. warning:: This method is |rev2025| Calling this method |rev2025-no-effect|.
676691
*/
677692
void tuneEdgeSensitivity(uint8_t xAxisWideZMin = 4, uint8_t yAxisWideZMin = 3);
678693
#if PINNACLE_ANYMEAS_SUPPORT
679694
/**
680695
* This function configures the Pinnacle ASIC for taking raw ADC
681696
* measurements. Be sure that `setDataMode()` is given
682-
* `PINNACLE_ANYMEAS` before calling this function otherwise it will do
697+
* `~PinnacleDataMode::PINNACLE_ANYMEAS` before calling this function otherwise it will do
683698
* nothing.
684699
*
685700
* .. note:: The `apertureWidth` parameter has an inverse relationship/affect
@@ -705,8 +720,8 @@ class PinnacleTouch
705720
* @param controlPowerCount Configure the Pinnacle to perform a number of
706721
* measurements for each call to `measureAdc()`. Defaults to 1. Constants
707722
* defined in `PinnacleAnyMeasCtrl` can be added (with ``+``) to specify if
708-
* sleep is allowed (`PINNACLE_CRTL_PWR_IDLE` -- this is not default) or
709-
* if repetitive measurements is allowed (`PINNACLE_CRTL_REPEAT`) when
723+
* sleep is allowed (`PINNACLE_CTRL_PWR_IDLE` -- this is not default) or
724+
* if repetitive measurements is allowed (`PINNACLE_CTRL_REPEAT`) when
710725
* number of measurements is more than 1.
711726
*
712727
* .. warning:: There is no bounds checking on the number of measurements
@@ -729,12 +744,12 @@ class PinnacleTouch
729744
*
730745
* Internally, this function uses the non-blocking helper functions
731746
* `startMeasureAdc()` and `getMeasureAdc()`, but blocks until ADC measurements are
732-
* completed. Be sure that `setDataMode()` is given `PINNACLE_ANYMEAS` before
747+
* completed. Be sure that `setDataMode()` is given `~PinnacleDataMode::PINNACLE_ANYMEAS` before
733748
* calling this function otherwise it will do nothing and return ``0``.
734749
*
735750
* :Return:
736751
* A signed short integer. If `setDataMode()` is not given
737-
* `PINNACLE_ANYMEAS`, then this function returns ``0`` and does nothing.
752+
* `~PinnacleDataMode::PINNACLE_ANYMEAS`, then this function returns ``0`` and does nothing.
738753
* :4-byte Integer Format (for use as each parameter):
739754
* Bits 29 and 28 represent the optional implementation of reference
740755
* capacitors built into the Pinnacle ASIC. To use these capacitors, the
@@ -783,7 +798,7 @@ class PinnacleTouch
783798
int16_t measureAdc(unsigned int bitsToToggle, unsigned int togglePolarity);
784799
/**
785800
* A non-blocking function to instigate ADC measurements when the `setDataMode()` is given
786-
* `PINNACLE_ANYMEAS` mode. See parameters and table in `measureAdc()` as
801+
* `~PinnacleDataMode::PINNACLE_ANYMEAS` mode. See parameters and table in `measureAdc()` as
787802
* this helper function's parameters are used exactly the same.
788803
*/
789804
void startMeasureAdc(unsigned int bitsToToggle, unsigned int togglePolarity);
@@ -795,8 +810,8 @@ class PinnacleTouch
795810
*
796811
* :Returns:
797812
*
798-
* - A 16-bit integer if `setDataMode()` is given `PINNACLE_ANYMEAS`.
799-
* - ``0`` if `setDataMode()` is not given `PINNACLE_ANYMEAS`.
813+
* - A 16-bit integer if `setDataMode()` is given `~PinnacleDataMode::PINNACLE_ANYMEAS`.
814+
* - ``0`` if `setDataMode()` is not given `~PinnacleDataMode::PINNACLE_ANYMEAS`.
800815
*/
801816
int16_t getMeasureAdc();
802817
#endif // PINNACLE_ANYMEAS_SUPPORT == true
@@ -829,7 +844,7 @@ class PinnacleTouch
829844
* - ``true`` if the Pinnacle ASIC was setup and configured properly (with data
830845
* feed enabled using Relative mode).
831846
* - ``false`` if the Pinnacle ASIC was unresponsive for some reason; all further
832-
* operations will be nullified by `setDataMode()` to `PINNACLE_ERROR` (``0xFF``).
847+
* operations will be nullified by `setDataMode()` to `~PinnacleDataMode::PINNACLE_ERROR`.
833848
*/
834849
bool begin();
835850
};

0 commit comments

Comments
 (0)