From 48ca8f849fdac69e393e127fc38c004cf4c1472c Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Wed, 2 Feb 2022 10:35:44 -0500 Subject: [PATCH 1/7] allowing the kt60 file to be modified so I can do things while waiting for it to be fixed upstream --- keyboards/keyten/kt60_m/kt60_m.c | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/keyboards/keyten/kt60_m/kt60_m.c b/keyboards/keyten/kt60_m/kt60_m.c index 63a7f8d6b6d8..7d4f7614c839 100644 --- a/keyboards/keyten/kt60_m/kt60_m.c +++ b/keyboards/keyten/kt60_m/kt60_m.c @@ -1,18 +1,18 @@ - /* Copyright 2022 Ivan Gromov (@key10iq) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - + /* Copyright 2022 Ivan Gromov (@key10iq) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + #include "kt60_m.h" \ No newline at end of file From ab5df09453e06605854d43bcd6d461dfef4dd02a Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Thu, 9 Jun 2022 12:59:08 -0400 Subject: [PATCH 2/7] Initial commit. --- docs/feature_pointing_device.md | 24 ++++++++++++++++-------- drivers/sensors/cirque_pinnacle.c | 7 ++++++- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/docs/feature_pointing_device.md b/docs/feature_pointing_device.md index 8c51865558e2..6584922e5b8b 100644 --- a/docs/feature_pointing_device.md +++ b/docs/feature_pointing_device.md @@ -72,7 +72,6 @@ The Analog Joystick is an analog (ADC) driven sensor. There are a variety of jo |`ANALOG_JOYSTICK_SPEED_MAX` | (Optional) The maximum value used for motion. | `2` | |`ANALOG_JOYSTICK_CLICK_PIN` | (Optional) The pin wired up to the press switch of the analog stick. | _not defined_ | - ### Cirque Trackpad To use the Cirque Trackpad sensor, add this to your `rules.mk`: @@ -104,16 +103,25 @@ This supports the Cirque Pinnacle 1CA027 Touch Controller, which is used in the |`CIRQUE_PINNACLE_ADDR` | (Required) Sets the I2C Address for the Cirque Trackpad | `0x2A` | |`CIRQUE_PINNACLE_TIMEOUT` | (Optional) The timeout for i2c communication with the trackpad in milliseconds. | `20` | -| SPI Setting | Description | Default | -|-------------------------------|------------------------------------------------------------------------|---------------| -|`CIRQUE_PINNACLE_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `1000000` | -|`CIRQUE_PINNACLE_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` | -|`CIRQUE_PINNACLE_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `1` | -|`CIRQUE_PINNACLE_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ | -|`CIRQUE_PINNACLE_SPI_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ | +| SPI Setting | Description | Default | +|-------------------------------|------------------------------------------------------------------------|---------------------| +|`CIRQUE_PINNACLE_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `1000000` | +|`CIRQUE_PINNACLE_ATTENUATION` | (Optional) Sets the attenuation of the sensor data. | `ADC_ATTENUATE_4X` | +|`CIRQUE_PINNACLE_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` | +|`CIRQUE_PINNACLE_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `1` | +|`CIRQUE_PINNACLE_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ | +|`CIRQUE_PINNACLE_SPI_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ | Default Scaling/CPI is 1024. +**`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. + +Default attenuation is set to 4X, although if you are using a thicker overlay (such as the curved overlay) you will want a lower attenuation such as 2X. The possible values are: +* `:ADC_ATTENUATE_4X`: Least sensitive +* `:ADC_ATTENUATE_3X`: +* `:ADC_ATTENUATE_2X`: +* `:ADC_ATTENUATE_1X`: Most sensitive + ### Pimoroni Trackball To use the Pimoroni Trackball module, add this to your `rules.mk`: diff --git a/drivers/sensors/cirque_pinnacle.c b/drivers/sensors/cirque_pinnacle.c index 2db7f916fed3..822eed1b1fa2 100644 --- a/drivers/sensors/cirque_pinnacle.c +++ b/drivers/sensors/cirque_pinnacle.c @@ -213,7 +213,12 @@ void cirque_pinnacle_init(void) { // Host sets z-idle packet count to 5 (default is 30) RAP_Write(Z_IDLE_COUNT, Z_IDLE_COUNT_VALUE); - cirque_pinnacle_set_adc_attenuation(0xFF); +#ifdef CIRQUE_PINNACLE_ATTENUATION + cirque_pinnacle_set_adc_attenuation(CIRQUE_PINNACLE_ATTENUATION); +#else + cirque_pinnacle_set_adc_attenuation(ADC_ATTENUATE_4X); +#endif + cirque_pinnacle_tune_edge_sensitivity(); cirque_pinnacle_enable_feed(true); } From f520d38a87d47690b05942c728e803e17175bd90 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Thu, 9 Jun 2022 13:04:39 -0400 Subject: [PATCH 3/7] Fixed formatting. --- docs/feature_pointing_device.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/feature_pointing_device.md b/docs/feature_pointing_device.md index 6584922e5b8b..3261807cab82 100644 --- a/docs/feature_pointing_device.md +++ b/docs/feature_pointing_device.md @@ -117,10 +117,10 @@ Default Scaling/CPI is 1024. **`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. Default attenuation is set to 4X, although if you are using a thicker overlay (such as the curved overlay) you will want a lower attenuation such as 2X. The possible values are: -* `:ADC_ATTENUATE_4X`: Least sensitive -* `:ADC_ATTENUATE_3X`: -* `:ADC_ATTENUATE_2X`: -* `:ADC_ATTENUATE_1X`: Most sensitive +* `ADC_ATTENUATE_4X`: Least sensitive +* `ADC_ATTENUATE_3X`: +* `ADC_ATTENUATE_2X`: +* `ADC_ATTENUATE_1X`: Most sensitive ### Pimoroni Trackball From 58e23e7a07d6407b403a081d8ec4bf37cb487ced Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Thu, 9 Jun 2022 13:05:28 -0400 Subject: [PATCH 4/7] Fixed formatting...again. --- docs/feature_pointing_device.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/feature_pointing_device.md b/docs/feature_pointing_device.md index 3261807cab82..390e8ddd741f 100644 --- a/docs/feature_pointing_device.md +++ b/docs/feature_pointing_device.md @@ -118,8 +118,8 @@ Default Scaling/CPI is 1024. Default attenuation is set to 4X, although if you are using a thicker overlay (such as the curved overlay) you will want a lower attenuation such as 2X. The possible values are: * `ADC_ATTENUATE_4X`: Least sensitive -* `ADC_ATTENUATE_3X`: -* `ADC_ATTENUATE_2X`: +* `ADC_ATTENUATE_3X` +* `ADC_ATTENUATE_2X` * `ADC_ATTENUATE_1X`: Most sensitive ### Pimoroni Trackball From 32170eab66467375aaf3fa761750571c1b6a19a8 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Thu, 9 Jun 2022 13:41:31 -0400 Subject: [PATCH 5/7] Moved the new setting and info to the appropriate table. --- docs/feature_pointing_device.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/feature_pointing_device.md b/docs/feature_pointing_device.md index 390e8ddd741f..605e837af16e 100644 --- a/docs/feature_pointing_device.md +++ b/docs/feature_pointing_device.md @@ -95,6 +95,7 @@ This supports the Cirque Pinnacle 1CA027 Touch Controller, which is used in the |`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` | @@ -103,14 +104,13 @@ This supports the Cirque Pinnacle 1CA027 Touch Controller, which is used in the |`CIRQUE_PINNACLE_ADDR` | (Required) Sets the I2C Address for the Cirque Trackpad | `0x2A` | |`CIRQUE_PINNACLE_TIMEOUT` | (Optional) The timeout for i2c communication with the trackpad in milliseconds. | `20` | -| SPI Setting | Description | Default | -|-------------------------------|------------------------------------------------------------------------|---------------------| -|`CIRQUE_PINNACLE_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `1000000` | -|`CIRQUE_PINNACLE_ATTENUATION` | (Optional) Sets the attenuation of the sensor data. | `ADC_ATTENUATE_4X` | -|`CIRQUE_PINNACLE_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` | -|`CIRQUE_PINNACLE_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `1` | -|`CIRQUE_PINNACLE_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ | -|`CIRQUE_PINNACLE_SPI_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ | +| SPI Setting | Description | Default | +|-------------------------------|------------------------------------------------------------------------|----------------| +|`CIRQUE_PINNACLE_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `1000000` | +|`CIRQUE_PINNACLE_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` | +|`CIRQUE_PINNACLE_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `1` | +|`CIRQUE_PINNACLE_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ | +|`CIRQUE_PINNACLE_SPI_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ | Default Scaling/CPI is 1024. From 82ef0f17c0d00ccacad5911ef90e9f9998e0a539 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Thu, 9 Jun 2022 13:41:52 -0400 Subject: [PATCH 6/7] Moved the new setting and info to the appropriate table. --- docs/feature_pointing_device.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/feature_pointing_device.md b/docs/feature_pointing_device.md index 605e837af16e..715b052c2e49 100644 --- a/docs/feature_pointing_device.md +++ b/docs/feature_pointing_device.md @@ -99,6 +99,14 @@ This supports the Cirque Pinnacle 1CA027 Touch Controller, which is used in the |`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_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. + +Default attenuation is set to 4X, although if you are using a thicker overlay (such as the curved overlay) you will want a lower attenuation such as 2X. The possible values are: +* `ADC_ATTENUATE_4X`: Least sensitive +* `ADC_ATTENUATE_3X` +* `ADC_ATTENUATE_2X` +* `ADC_ATTENUATE_1X`: Most sensitive + | I2C Setting | Description | Default | |--------------------------|---------------------------------------------------------------------------------|---------| |`CIRQUE_PINNACLE_ADDR` | (Required) Sets the I2C Address for the Cirque Trackpad | `0x2A` | @@ -114,14 +122,6 @@ This supports the Cirque Pinnacle 1CA027 Touch Controller, which is used in the Default Scaling/CPI is 1024. -**`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. - -Default attenuation is set to 4X, although if you are using a thicker overlay (such as the curved overlay) you will want a lower attenuation such as 2X. The possible values are: -* `ADC_ATTENUATE_4X`: Least sensitive -* `ADC_ATTENUATE_3X` -* `ADC_ATTENUATE_2X` -* `ADC_ATTENUATE_1X`: Most sensitive - ### Pimoroni Trackball To use the Pimoroni Trackball module, add this to your `rules.mk`: From ff96bac01e1ad3cb95e953628d5e0187ab2558d5 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Thu, 9 Jun 2022 18:21:22 -0400 Subject: [PATCH 7/7] Changed to work with formatting feedback --- drivers/sensors/cirque_pinnacle.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/sensors/cirque_pinnacle.c b/drivers/sensors/cirque_pinnacle.c index 822eed1b1fa2..670b96f2fb40 100644 --- a/drivers/sensors/cirque_pinnacle.c +++ b/drivers/sensors/cirque_pinnacle.c @@ -38,6 +38,10 @@ #define ADC_ATTENUATE_3X 0x80 #define ADC_ATTENUATE_4X 0xC0 +#ifndef CIRQUE_PINNACLE_ATTENUATION +# define CIRQUE_PINNACLE_ATTENUATION ADC_ATTENUATE_4X +#endif + // Register config values for this demo #define SYSCONFIG_1_VALUE 0x00 #define FEEDCONFIG_1_VALUE 0x03 // 0x03 for absolute mode 0x01 for relative mode @@ -213,11 +217,7 @@ void cirque_pinnacle_init(void) { // Host sets z-idle packet count to 5 (default is 30) RAP_Write(Z_IDLE_COUNT, Z_IDLE_COUNT_VALUE); -#ifdef CIRQUE_PINNACLE_ATTENUATION cirque_pinnacle_set_adc_attenuation(CIRQUE_PINNACLE_ATTENUATION); -#else - cirque_pinnacle_set_adc_attenuation(ADC_ATTENUATE_4X); -#endif cirque_pinnacle_tune_edge_sensitivity(); cirque_pinnacle_enable_feed(true);