Compare commits

...

23 Commits

Author SHA1 Message Date
Florian Didron
624cce85d0 feat(trackball): user addressable CPI
Some checks failed
Build firmware / build-firmware (default) (push) Has been cancelled
Build firmware / build-firmware (oryx) (push) Has been cancelled
Unit Tests / test (push) Has been cancelled
2025-09-03 14:28:38 +07:00
Florian Didron
91d29fe418 fix: trackball cpi boundaries, restore user set default cpi at boot
Some checks failed
Build firmware / build-firmware (default) (push) Has been cancelled
Build firmware / build-firmware (oryx) (push) Has been cancelled
2025-09-02 16:51:28 +07:00
Florian Didron
2ec6a09d59 Merge branch 'firmware25' into feat/trackball_default_cpi 2025-09-02 16:38:14 +07:00
Florian Didron
2c6565c49b feat: allows setting the default trackball sensitivity 2025-08-29 08:52:04 +07:00
Florian Didron
73a60adccb feat: wip navigator trackpad support 2025-08-26 10:15:16 +07:00
Florian Didron
63df8aaf50 chore: add more comments 2025-08-22 12:27:10 +07:00
Florian Didron
4ed023b399 fix: change the packet size from 53 to 17 2025-08-12 16:03:08 +07:00
Florian Didron
3e055c27ba fix: address the i2c transmit and receive length on u16 2025-08-12 14:16:50 +07:00
Florian Didron
8ff6738dce chore: update zsa module 2025-08-06 09:42:26 +07:00
Florian Didron
9601e77500 fix: #pragma once 2025-08-06 09:23:58 +07:00
Florian Didron
3635d313ed Merge branch 'firmware25' into feat/navigator-qmk25 2025-07-11 08:57:43 +07:00
Florian Didron
0893f2ebf9 Merge branch 'firmware25' into feat/navigator-qmk25 2025-07-10 08:59:03 +07:00
Florian Didron
74c38ae1c1 chore: merge firmware25 branch 2025-06-20 11:12:11 +07:00
Florian Didron
96c5b8e2d9 chore: remove navigator keys 2025-06-17 18:51:02 +07:00
Florian Didron
b7d0132457 chore: tweak turbo/aim for the trackpad 2025-06-17 18:47:55 +07:00
Florian Didron
574b2798a4 feat: adds aim/turbo mode 2025-06-17 18:21:06 +07:00
Florian Didron
f11ebc3a71 fix: a better way to debounce taps 2025-06-11 08:27:54 +07:00
Florian Didron
39c17221b4 experiment: slight acceleration curve, more aggressive tap debounce 2025-06-11 08:20:27 +07:00
Florian Didron
996cf81b59 feat: improved trackpad scrolling, maybe? 2025-06-10 17:21:15 +07:00
Florian Didron
9c0d3c5eb5 fix: navigator trackpad compile issue 2025-06-05 19:58:15 +07:00
Florian Didron
d9f419845d feat: adds a transmit and receive i2c method 2025-06-05 19:56:35 +07:00
Florian Didron
dbe50d2a66 feat: port navigators to qmk25 2025-06-05 17:59:59 +07:00
Florian Didron
f2f1de4d97 chore: move zsa/oryx module to a git submodule 2025-06-05 16:03:35 +07:00
3 changed files with 19 additions and 81 deletions

View File

@@ -19,7 +19,7 @@ const pointing_device_driver_t navigator_trackball_pointing_device_driver = {
.set_cpi = navigator_trackball_set_cpi
};
uint8_t current_cpi = DEFAULT_CPI_TICK;
uint8_t current_cpi = NAVIGATOR_TRACKBALL_CPI;
uint8_t has_motion = 0;
@@ -77,58 +77,11 @@ i2c_status_t sci18is606_configure(void) {
}
bool paw3805ek_set_cpi(void) {
uint8_t next_cpi_x = 0;
uint8_t next_cpi_y = 0;
// traverse the sequence by compairing the cpi_x value with the current cpi_x value
// set the cpi to the next value in the sequence
switch (current_cpi) {
case 1: {
next_cpi_x = CPI_X_800;
next_cpi_y = CPI_Y_800;
break;
}
case 2: {
next_cpi_x = CPI_X_1000;
next_cpi_y = CPI_Y_1000;
break;
}
case 3: {
next_cpi_x = CPI_X_1200;
next_cpi_y = CPI_Y_1200;
break;
}
case 4: {
next_cpi_x = CPI_X_1600;
next_cpi_y = CPI_Y_1600;
break;
}
case 5: {
next_cpi_x = CPI_X_2000;
next_cpi_y = CPI_Y_2000;
break;
}
case 6: {
next_cpi_x = CPI_X_2400;
next_cpi_y = CPI_Y_2400;
break;
}
case 7: {
next_cpi_x = CPI_X_3000;
next_cpi_y = CPI_Y_3000;
break;
}
default: {
current_cpi = DEFAULT_CPI_TICK;
next_cpi_x = CPI_X_800;
next_cpi_y = CPI_Y_800;
break;
}
}
paw3805ek_reg_seq_t cpi_reg_seq[] = {
{0x09 | WRITE_REG_BIT, 0x5A}, // Disable write protection
{0x0D | WRITE_REG_BIT, next_cpi_x},
{0x0E | WRITE_REG_BIT, next_cpi_y},
{0x0D | WRITE_REG_BIT, current_cpi},
{0x0E | WRITE_REG_BIT, current_cpi},
{0x09 | WRITE_REG_BIT, 0x00}, // Enable the write protection
};
@@ -239,6 +192,7 @@ void navigator_trackball_device_init(void) {
}
trackball_init = 1;
restore_cpi(current_cpi);
if (!callback_token) {
// Register the callback to read the trackball motion
callback_token = defer_exec(NAVIGATOR_TRACKBALL_READ, sci18is606_read_callback, NULL);
@@ -268,13 +222,13 @@ void restore_cpi(uint8_t cpi) {
void navigator_trackball_set_cpi(uint16_t cpi) {
if (cpi == 0) { // Decrease one tick
if (current_cpi > 1) {
current_cpi--;
if (current_cpi > NAVIGATOR_TRACKBALL_CPI_TICK) {
current_cpi -= NAVIGATOR_TRACKBALL_CPI_TICK;
paw3805ek_set_cpi();
}
} else {
if (current_cpi < CPI_TICKS) {
current_cpi++;
if (current_cpi <= NAVIGATOR_TRACKBALL_CPI_MAX - NAVIGATOR_TRACKBALL_CPI_TICK) {
current_cpi += NAVIGATOR_TRACKBALL_CPI_TICK;
paw3805ek_set_cpi();
}
}

View File

@@ -10,6 +10,16 @@
# define NAVIGATOR_TRACKBALL_ADDRESS 0x50
#endif
#ifndef NAVIGATOR_TRACKBALL_CPI
# define NAVIGATOR_TRACKBALL_CPI 40
#endif
#ifndef NAVIGATOR_TRACKBALL_CPI_TICK
# define NAVIGATOR_TRACKBALL_CPI_TICK 5
#endif
#define NAVIGATOR_TRACKBALL_CPI_MAX 125
#ifndef NAVIGATOR_TRACKBALL_TIMEOUT
# define NAVIGATOR_TRACKBALL_TIMEOUT 100
#endif
@@ -28,33 +38,6 @@
#define SCI18IS606_GET_ID 0xFE
#define WRITE_REG_BIT 0x80
/*
The PAW3805EK datasheet suggests the following CPI values for the X and Y axes:
CPI X-axis Y-axis
800 0x1F 0x22
1000 0x26 0x2A
1200 0x2E 0x32
1600 0x3C 0x43
2000 0x4C 0x54
2400 0x5B 0x64
3000 0x70 0x7B
*/
#define CPI_TICKS 7
#define DEFAULT_CPI_TICK 1
#define CPI_X_800 0x1F
#define CPI_Y_800 0x22
#define CPI_X_1000 0x26
#define CPI_Y_1000 0x2A
#define CPI_X_1200 0x2E
#define CPI_Y_1200 0x32
#define CPI_X_1600 0x3C
#define CPI_Y_1600 0x43
#define CPI_X_2000 0x4C
#define CPI_Y_2000 0x54
#define CPI_X_2400 0x5B
#define CPI_Y_2400 0x64
#define CPI_X_3000 0x70
#define CPI_Y_3000 0x7B
typedef struct {
uint8_t reg;

View File

@@ -22,6 +22,7 @@ typedef union {
bool disable_layer_led : 1;
bool led_level : 1;
uint8_t led_level_res : 2; // DO NOT REMOVE
uint8_t navigator_cpi : 3;
};
} keyboard_config_t;