aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2021-06-21 20:00:32 +0000
committerQMK Bot <hello@qmk.fm>2021-06-21 20:00:32 +0000
commite28d7ab58cbf5b9912a33fbe1b5a3a95d3449bea (patch)
treebdc3d935693faf7c886668db78da4b19b314d0cc
parent6901411bca0760ceb8acbe1f0c95feaed9d2aaeb (diff)
parenteba3d68394ba7bdd15836c0f4f4bb3c44b4e1f91 (diff)
downloadqmk_firmware-e28d7ab58cbf5b9912a33fbe1b5a3a95d3449bea.tar.gz
qmk_firmware-e28d7ab58cbf5b9912a33fbe1b5a3a95d3449bea.zip
Merge remote-tracking branch 'origin/master' into develop
-rw-r--r--drivers/sensors/adns5050.c2
-rw-r--r--keyboards/ploopyco/trackball/readme.md2
-rw-r--r--keyboards/ploopyco/trackball_mini/readme.md10
-rw-r--r--keyboards/ploopyco/trackball_mini/rev1_001/config.h2
-rw-r--r--keyboards/ploopyco/trackball_mini/rev1_002/config.h40
-rw-r--r--keyboards/ploopyco/trackball_mini/rev1_002/readme.md1
-rw-r--r--keyboards/ploopyco/trackball_mini/rev1_002/rev1_002.h22
-rw-r--r--keyboards/ploopyco/trackball_mini/rev1_002/rules.mk0
-rw-r--r--keyboards/ploopyco/trackball_mini/trackball_mini.c38
-rw-r--r--keyboards/ploopyco/trackball_nano/trackball_nano.c27
10 files changed, 111 insertions, 33 deletions
diff --git a/drivers/sensors/adns5050.c b/drivers/sensors/adns5050.c
index 3c4f5e258..e7273977d 100644
--- a/drivers/sensors/adns5050.c
+++ b/drivers/sensors/adns5050.c
@@ -138,7 +138,7 @@ uint8_t adns_read_reg(uint8_t reg_addr) {
138 138
139void adns_write_reg(uint8_t reg_addr, uint8_t data) { 139void adns_write_reg(uint8_t reg_addr, uint8_t data) {
140 adns_cs_select(); 140 adns_cs_select();
141 adns_serial_write(reg_addr); 141 adns_serial_write( 0b10000000 | reg_addr );
142 adns_serial_write(data); 142 adns_serial_write(data);
143 adns_cs_deselect(); 143 adns_cs_deselect();
144} 144}
diff --git a/keyboards/ploopyco/trackball/readme.md b/keyboards/ploopyco/trackball/readme.md
index f34bbac30..7792c0cc5 100644
--- a/keyboards/ploopyco/trackball/readme.md
+++ b/keyboards/ploopyco/trackball/readme.md
@@ -19,7 +19,7 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to
19 19
20## Revisions 20## Revisions
21 21
22There are two main revisions for the PloopyCo Tracball, everything up to 1.004, and 1.005. 22There are two main revisions for the PloopyCo Tracball, everything up to 1.004, and 1.005-1.006.
23 23
24In the 1.005 revision, button for was changed from pin B5 to B6, and the debug LED pin was changed from F7 to B5. 24In the 1.005 revision, button for was changed from pin B5 to B6, and the debug LED pin was changed from F7 to B5.
25 25
diff --git a/keyboards/ploopyco/trackball_mini/readme.md b/keyboards/ploopyco/trackball_mini/readme.md
index 8b8482a38..1858efb6e 100644
--- a/keyboards/ploopyco/trackball_mini/readme.md
+++ b/keyboards/ploopyco/trackball_mini/readme.md
@@ -12,8 +12,8 @@ It's a DIY, QMK Powered Trackball...Mini!
12 12
13Make example for this trackball (after setting up your build environment): 13Make example for this trackball (after setting up your build environment):
14 14
15 make ploopyco/trackball_mini/rev1_001:default:flash 15 make ploopyco/trackball_mini/rev1_002:default:flash
16 make ploopyco/trackball_mini/rev1_001:via:flash 16 make ploopyco/trackball_mini/rev1_002:via:flash
17 17
18To jump to the bootloader, hold down "Button 4" (immediate right of the ball) 18To jump to the bootloader, hold down "Button 4" (immediate right of the ball)
19 19
@@ -51,13 +51,13 @@ This should allow you to more heavily customize the behavior.
51 51
52Alternatively, the `process_wheel` and `process_mouse` functions can both be replaced too, to allow for even more functionality. 52Alternatively, the `process_wheel` and `process_mouse` functions can both be replaced too, to allow for even more functionality.
53 53
54Additionally, you can change the DPI/CPI or speed of the trackball by calling `adns_set_cpi` at any time. Additionally, there is a `DPI_CONFIG` macro that will cycle through an array of options for the DPI. This is set to 375, 750, and 1375, but can be changed. 750 is the default. 54Additionally, you can change the DPI/CPI or speed of the trackball by calling `adns_set_cpi` at any time. Additionally, there is a `DPI_CONFIG` macro that will cycle through an array of options for the DPI. This is set to 375, 750, and 1375, but can be changed. 1375 is the default.
55 55
56To configure/set your own array, there are two defines to use, `PLOOPY_DPI_OPTIONS` to set the array, and `PLOOPY_DPI_DEFAULT`. 56To configure/set your own array, there are two defines to use, `PLOOPY_DPI_OPTIONS` to set the array, and `PLOOPY_DPI_DEFAULT`.
57 57
58```c 58```c
59#define PLOOPY_DPI_OPTIONS { CPI375, CPI750, CPI1375} 59#define PLOOPY_DPI_OPTIONS { CPI375, CPI750, CPI1375}
60#define PLOOPY_DPI_DEFAULT 1 60#define PLOOPY_DPI_DEFAULT 2
61``` 61```
62 62
63The `PLOOPY_DPI_OPTIONS` array sets the values that you want to be able to cycle through, and the order they are in. The "default" define lets the firmware know which of these options is the default and should be loaded by default. 63The `PLOOPY_DPI_OPTIONS` array sets the values that you want to be able to cycle through, and the order they are in. The "default" define lets the firmware know which of these options is the default and should be loaded by default.
@@ -72,4 +72,4 @@ When flashing the bootloader, use the following fuse settings:
72|----------|-------------| 72|----------|-------------|
73| Low | `0x5E` | 73| Low | `0x5E` |
74| High | `0x99` | 74| High | `0x99` |
75| Extended | `0xC3` | \ No newline at end of file 75| Extended | `0xC3` |
diff --git a/keyboards/ploopyco/trackball_mini/rev1_001/config.h b/keyboards/ploopyco/trackball_mini/rev1_001/config.h
index 3f5941dec..06720b8fd 100644
--- a/keyboards/ploopyco/trackball_mini/rev1_001/config.h
+++ b/keyboards/ploopyco/trackball_mini/rev1_001/config.h
@@ -31,7 +31,7 @@
31 */ 31 */
32#define DIRECT_PINS \ 32#define DIRECT_PINS \
33 { \ 33 { \
34 { D4, D2, E6, D7, B6 } \ 34 { D4, D2, E6, B6, D7 } \
35 } 35 }
36 36
37// These pins are not broken out, and cannot be used normally. 37// These pins are not broken out, and cannot be used normally.
diff --git a/keyboards/ploopyco/trackball_mini/rev1_002/config.h b/keyboards/ploopyco/trackball_mini/rev1_002/config.h
new file mode 100644
index 000000000..06720b8fd
--- /dev/null
+++ b/keyboards/ploopyco/trackball_mini/rev1_002/config.h
@@ -0,0 +1,40 @@
1/* Copyright 2021 Colin Lam (Ploopy Corporation)
2 * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
3 * Copyright 2019 Sunjun Kim
4 * Copyright 2019 Hiroyuki Okada
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22/*
23 * Keyboard Matrix Assignments
24 *
25 * Change this to how you wired your keyboard
26 * COLS: AVR pins used for columns, left to right
27 * ROWS: AVR pins used for rows, top to bottom
28 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
29 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
30 *
31 */
32#define DIRECT_PINS \
33 { \
34 { D4, D2, E6, B6, D7 } \
35 }
36
37// These pins are not broken out, and cannot be used normally.
38// They are set as output and pulled high, by default
39#define UNUSED_PINS \
40 { B5, C7, D0, D1, D3, D5, D6, F1, F3, F5, F6, F7 }
diff --git a/keyboards/ploopyco/trackball_mini/rev1_002/readme.md b/keyboards/ploopyco/trackball_mini/rev1_002/readme.md
new file mode 100644
index 000000000..e8a5a918e
--- /dev/null
+++ b/keyboards/ploopyco/trackball_mini/rev1_002/readme.md
@@ -0,0 +1 @@
See the main readme for more details. This is just here for when future revisions are released.
diff --git a/keyboards/ploopyco/trackball_mini/rev1_002/rev1_002.h b/keyboards/ploopyco/trackball_mini/rev1_002/rev1_002.h
new file mode 100644
index 000000000..4f34e17dd
--- /dev/null
+++ b/keyboards/ploopyco/trackball_mini/rev1_002/rev1_002.h
@@ -0,0 +1,22 @@
1/* Copyright 2021 Colin Lam (Ploopy Corporation)
2 * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
3 * Copyright 2019 Sunjun Kim
4 * Copyright 2019 Hiroyuki Okada
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include "trackball_mini.h"
diff --git a/keyboards/ploopyco/trackball_mini/rev1_002/rules.mk b/keyboards/ploopyco/trackball_mini/rev1_002/rules.mk
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/keyboards/ploopyco/trackball_mini/rev1_002/rules.mk
diff --git a/keyboards/ploopyco/trackball_mini/trackball_mini.c b/keyboards/ploopyco/trackball_mini/trackball_mini.c
index d6eb61a2b..996c00b22 100644
--- a/keyboards/ploopyco/trackball_mini/trackball_mini.c
+++ b/keyboards/ploopyco/trackball_mini/trackball_mini.c
@@ -18,6 +18,8 @@
18 */ 18 */
19 19
20#include "trackball_mini.h" 20#include "trackball_mini.h"
21#include "wait.h"
22#include "debug.h"
21 23
22#ifndef OPT_DEBOUNCE 24#ifndef OPT_DEBOUNCE
23# define OPT_DEBOUNCE 5 // (ms) Time between scroll events 25# define OPT_DEBOUNCE 5 // (ms) Time between scroll events
@@ -35,16 +37,8 @@
35# define OPT_SCALE 1 // Multiplier for wheel 37# define OPT_SCALE 1 // Multiplier for wheel
36#endif 38#endif
37 39
38#ifndef PLOOPY_DPI_OPTIONS 40#define PLOOPY_DPI_OPTIONS { CPI375, CPI750, CPI1375 }
39# define PLOOPY_DPI_OPTIONS { CPI375, CPI750, CPI1375 } 41#define PLOOPY_DPI_DEFAULT 2
40# ifndef PLOOPY_DPI_DEFAULT
41# define PLOOPY_DPI_DEFAULT 2
42# endif
43#endif
44
45#ifndef PLOOPY_DPI_DEFAULT
46# define PLOOPY_DPI_DEFAULT 1
47#endif
48 42
49// Transformation constants for delta-X and delta-Y 43// Transformation constants for delta-X and delta-Y
50const static float ADNS_X_TRANSFORM = -1.0; 44const static float ADNS_X_TRANSFORM = -1.0;
@@ -173,7 +167,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
173void keyboard_pre_init_kb(void) { 167void keyboard_pre_init_kb(void) {
174 // debug_enable = true; 168 // debug_enable = true;
175 // debug_matrix = true; 169 // debug_matrix = true;
176 debug_mouse = true; 170 // debug_mouse = true;
177 // debug_encoder = true; 171 // debug_encoder = true;
178 172
179 setPinInput(OPT_ENC1); 173 setPinInput(OPT_ENC1);
@@ -198,6 +192,22 @@ void keyboard_pre_init_kb(void) {
198void pointing_device_init(void) { 192void pointing_device_init(void) {
199 adns_init(); 193 adns_init();
200 opt_encoder_init(); 194 opt_encoder_init();
195
196 // reboot the adns.
197 // if the adns hasn't initialized yet, this is harmless.
198 adns_write_reg(REG_CHIP_RESET, 0x5a);
199
200 // wait maximum time before adns is ready.
201 // this ensures that the adns is actuall ready after reset.
202 wait_ms(55);
203
204 // read a burst from the adns and then discard it.
205 // gets the adns ready for write commands
206 // (for example, setting the dpi).
207 adns_read_burst();
208
209 // set the DPI.
210 adns_set_cpi(dpi_array[keyboard_config.dpi_config]);
201} 211}
202 212
203void pointing_device_task(void) { 213void pointing_device_task(void) {
@@ -223,9 +233,3 @@ void matrix_init_kb(void) {
223 } 233 }
224 matrix_init_user(); 234 matrix_init_user();
225} 235}
226
227void keyboard_post_init_kb(void) {
228 adns_set_cpi(dpi_array[keyboard_config.dpi_config]);
229
230 keyboard_post_init_user();
231}
diff --git a/keyboards/ploopyco/trackball_nano/trackball_nano.c b/keyboards/ploopyco/trackball_nano/trackball_nano.c
index 17cdedac7..9bcfa59ef 100644
--- a/keyboards/ploopyco/trackball_nano/trackball_nano.c
+++ b/keyboards/ploopyco/trackball_nano/trackball_nano.c
@@ -18,6 +18,7 @@
18 */ 18 */
19 19
20#include "trackball_nano.h" 20#include "trackball_nano.h"
21#include "wait.h"
21 22
22#ifndef OPT_DEBOUNCE 23#ifndef OPT_DEBOUNCE
23# define OPT_DEBOUNCE 5 // (ms) Time between scroll events 24# define OPT_DEBOUNCE 5 // (ms) Time between scroll events
@@ -43,7 +44,7 @@
43#endif 44#endif
44 45
45#ifndef PLOOPY_DPI_DEFAULT 46#ifndef PLOOPY_DPI_DEFAULT
46# define PLOOPY_DPI_DEFAULT 1 47# define PLOOPY_DPI_DEFAULT 2
47#endif 48#endif
48 49
49const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; 50const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { };
@@ -139,7 +140,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
139void keyboard_pre_init_kb(void) { 140void keyboard_pre_init_kb(void) {
140 // debug_enable = true; 141 // debug_enable = true;
141 // debug_matrix = true; 142 // debug_matrix = true;
142 debug_mouse = true; 143 // debug_mouse = true;
143 // debug_encoder = true; 144 // debug_encoder = true;
144 145
145 setPinInput(OPT_ENC1); 146 setPinInput(OPT_ENC1);
@@ -164,6 +165,22 @@ void keyboard_pre_init_kb(void) {
164void pointing_device_init(void) { 165void pointing_device_init(void) {
165 adns_init(); 166 adns_init();
166 opt_encoder_init(); 167 opt_encoder_init();
168
169 // reboot the adns.
170 // if the adns hasn't initialized yet, this is harmless.
171 adns_write_reg(REG_CHIP_RESET, 0x5a);
172
173 // wait maximum time before adns is ready.
174 // this ensures that the adns is actuall ready after reset.
175 wait_ms(55);
176
177 // read a burst from the adns and then discard it.
178 // gets the adns ready for write commands
179 // (for example, setting the dpi).
180 adns_read_burst();
181
182 // set the DPI.
183 adns_set_cpi(dpi_array[keyboard_config.dpi_config]);
167} 184}
168 185
169void pointing_device_task(void) { 186void pointing_device_task(void) {
@@ -188,9 +205,3 @@ void matrix_init_kb(void) {
188 } 205 }
189 matrix_init_user(); 206 matrix_init_user();
190} 207}
191
192void keyboard_post_init_kb(void) {
193 adns_set_cpi(dpi_array[keyboard_config.dpi_config]);
194
195 keyboard_post_init_user();
196}