Skip to content

Commit

Permalink
cirque: update config options and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kriechi committed Jun 22, 2022
1 parent 1f2991c commit afab84c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
23 changes: 14 additions & 9 deletions docs/feature_pointing_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,17 @@ POINTING_DEVICE_DRIVER = cirque_pinnacle_spi

This supports the Cirque Pinnacle 1CA027 Touch Controller, which is used in the TM040040, TM035035 and the TM023023 trackpads. These are I2C or SPI compatible, and both configurations are supported.

| Setting | Description | Default |
|---------------------------------|---------------------------------------------------------------------------------|-----------------------|
|`CIRQUE_PINNACLE_X_LOWER` | (Optional) The minimum reachable X value on the sensor. | `127` |
|`CIRQUE_PINNACLE_X_UPPER` | (Optional) The maximum reachable X value on the sensor. | `1919` |
|`CIRQUE_PINNACLE_Y_LOWER` | (Optional) The minimum reachable Y value on the sensor. | `63` |
|`CIRQUE_PINNACLE_Y_UPPER` | (Optional) The maximum reachable Y value on the sensor. | `1471` |
|`CIRQUE_PINNACLE_ATTENUATION` | (Optional) Sets the attenuation of the sensor data. | `ADC_ATTENUATE_4X` |
|`CIRQUE_PINNACLE_TAPPING_TERM` | (Optional) Length of time that a touch can be to be considered a tap. | `TAPPING_TERM`/`200` |
|`CIRQUE_PINNACLE_TOUCH_DEBOUNCE` | (Optional) Length of time that a touch can be to be considered a tap. | `TAPPING_TERM`/`200` |
| Setting | Description | Default |
|-------------------------------------|--------------------------------------------------------------------------------------------------|---------------------------------|
|`CIRQUE_PINNACLE_X_LOWER` | (Optional) The minimum reachable X value on the sensor. | `127` |
|`CIRQUE_PINNACLE_X_UPPER` | (Optional) The maximum reachable X value on the sensor. | `1919` |
|`CIRQUE_PINNACLE_Y_LOWER` | (Optional) The minimum reachable Y value on the sensor. | `63` |
|`CIRQUE_PINNACLE_Y_UPPER` | (Optional) The maximum reachable Y value on the sensor. | `1471` |
|`CIRQUE_PINNACLE_ATTENUATION` | (Optional) Sets the attenuation of the sensor data. | `ADC_ATTENUATE_4X` |
|`CIRQUE_PINNACLE_TAPPING_TERM` | (Optional) Length of time that a touch can be to be considered a tap. | `TAPPING_TERM`/`200` |
|`CIRQUE_PINNACLE_TOUCH_DEBOUNCE` | (Optional) Length of time that a touch can be to be considered a tap. | `TAPPING_TERM`/`200` |
|`CIRQUE_PINNACLE_RESET_ON_INIT_WAIT` | (Optional) Wait time in milliseconds after sending reset during init. Use 0 to skip. | `30` |
|`CIRQUE_PINNACLE_POSITION_MODE` | (Optional) Absolute or Relative positioning mode. Use `CIRQUE_PINNACLE_{ABSOLUTE,RELATIVE}_MODE` | `CIRQUE_PINNACLE_ABSOLUTE_MODE` |

**`CIRQUE_PINNACLE_ATTENUATION`** is a measure of how much data is suppressed in regards to sensitivity. The higher the attenuation, the less sensitive the touchpad will be.

Expand All @@ -122,6 +124,9 @@ Default attenuation is set to 4X, although if you are using a thicker overlay (s

Default Scaling/CPI is 1024.

Also see the `POINTING_DEVICE_TASK_THROTTLE_MS`, which defaults to 10ms when using Cirque Pinnacle, which matches the internal update rate of the position registers (in standard configuration). Advanced configuration for pen/stylus usage might require lower values.


### Pimoroni Trackball

To use the Pimoroni Trackball module, add this to your `rules.mk`:
Expand Down
4 changes: 3 additions & 1 deletion drivers/sensors/cirque_pinnacle.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@ void cirque_pinnacle_init(void) {
// Bit 1: Shutdown, 1=Shutdown, 0=Active
// Bit 2: Sleep Enable, 1=low power mode, 0=normal mode
// send a RESET command now, in case QMK had a soft-reset without a power cycle
#if CIRQUE_PINNACLE_RESET_ON_INIT_WAIT > 0
RAP_Write(SYSCONFIG_1, 0x01);
wait_ms(20); // Pinnacle needs 10-15ms to boot, so wait long enough before configuring
wait_ms(CIRQUE_PINNACLE_RESET_ON_INIT_WAIT);
#endif
RAP_Write(SYSCONFIG_1, 0x00);
wait_us(50);

Expand Down
9 changes: 6 additions & 3 deletions drivers/sensors/cirque_pinnacle.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
#include <stdbool.h>

#ifndef CIRQUE_PINNACLE_TIMEOUT
# define CIRQUE_PINNACLE_TIMEOUT 20
# define CIRQUE_PINNACLE_TIMEOUT 20 // I2C timeout in milliseconds
#endif
#ifndef CIRQUE_PINNACLE_RESET_ON_INIT_WAIT
# define CIRQUE_PINNACLE_RESET_ON_INIT_WAIT 30 // milliseconds to wait after setting reset bit. Pinnacle needs 15-20ms to boot, increase if needed. Set to 0 to skip reset-on-init.
#endif

#define CIRQUE_PINNACLE_ABSOLUTE_MODE 1
Expand Down Expand Up @@ -34,9 +37,9 @@
#ifndef CIRQUE_PINNACLE_Y_RANGE
# define CIRQUE_PINNACLE_Y_RANGE (CIRQUE_PINNACLE_Y_UPPER - CIRQUE_PINNACLE_Y_LOWER)
#endif
#if !defined(POINTING_DEVICE_TASK_THROTTLE_MS) || POINTING_DEVICE_TASK_THROTTLE_MS < 10
#if !defined(POINTING_DEVICE_TASK_THROTTLE_MS)
# undef POINTING_DEVICE_TASK_THROTTLE_MS
# define POINTING_DEVICE_TASK_THROTTLE_MS 10 // Cirque Pinnacle at most will have fresh data every 10ms
# define POINTING_DEVICE_TASK_THROTTLE_MS 10 // Cirque Pinnacle in normal operation produces data every 10ms. Advanced configuration for pen/stylus usage might require lower values.
#endif
#if defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_i2c)
# include "i2c_master.h"
Expand Down

0 comments on commit afab84c

Please sign in to comment.