Skip to content

Commit

Permalink
Update QMK exapmle to ver 0.21.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ziteh committed Jul 17, 2023
1 parent f494d26 commit 78ead47
Show file tree
Hide file tree
Showing 20 changed files with 251 additions and 248 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ For 1.8V MCU, please connect VIN to 2.0\~5.5V, solder and connect the 2 and 3 pa
- [QMK](/firmware/qmk/pmw3360_test/)
- [nRF Connect SDK (NCS)](/firmware/nordic/)

Pre-Build firmware can be found in [Releases](https://github.com/siderakb/pmw3360-pcb/releases/tag/fw_v0.1.0).

## License

- KiCad Files (e.g. schematics, PCBs, footprints and symbols): [MIT](/LICENSE).
Expand Down
27 changes: 27 additions & 0 deletions firmware/qmk/pmw3360_promicro/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2023 ZiTe (@ZiTe)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define PMW33XX_CS_PIN B6 // SPI CS pin.

/* Optional. */
#define PMW33XX_CPI 1600 // The CPI range is 100-12000, in increments of 100. Defaults to 1600 CPI.
#define MOUSE_EXTENDED_REPORT // Use -32767 to 32767, instead of just -127 to 127.
// #define POINTING_DEVICE_TASK_THROTTLE_MS 10

/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/

/* disable debug print */
// #define NO_DEBUG

/* disable print */
// #define NO_PRINT

/* disable action features */
// #define NO_ACTION_LAYER
// #define NO_ACTION_TAPPING
// #define NO_ACTION_ONESHOT
33 changes: 33 additions & 0 deletions firmware/qmk/pmw3360_promicro/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"manufacturer": "SideraKB",
"url": "https://github.com/siderakb/pmw3360-pcb",
"maintainer": "ZiTe",
"keyboard_name": "PMW3360-ProMicro",
"processor": "atmega32u4",
"bootloader": "caterina",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": false
},
"usb": {
"vid": "0x5A69",
"pid": "0x3361",
"device_version": "1.0.0"
},
"matrix_pins": {
"cols": ["B4"],
"rows": ["B5"]
},
"diode_direction": "COL2ROW",
"layouts": {
"LAYOUT": {
"layout": [
{ "matrix": [0, 0], "x": 0, "y": 0 }
]
}
}
}
5 changes: 5 additions & 0 deletions firmware/qmk/pmw3360_promicro/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(KC_LGUI)
};
33 changes: 33 additions & 0 deletions firmware/qmk/pmw3360_promicro/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# PMW3360-RP2040

[PMW3360 PCB](https://github.com/siderakb/pmw3360-pcb) QMK example Pro Micro edition.

Pre-Build firmware can be found in [Releases](https://github.com/siderakb/pmw3360-pcb/releases/tag/fw_v0.1.0).

## Usage

Note the processor frequency settings in `rules.mk`, default is 8MHz.

Copy and paste this folder to `qmk_firmware\keyboards\`, and build:
```
qmk compile -kb pmw3360_promicro -km default
```

> Tested on QMK version `0.21.6`.
## Pin Map

| PMW3360 PCB | Pro Micro | ATmega32U4 |
| ----------- | --------- | ---------- |
| VIN | VCC | VCC |
| GND | GND | GND |
| SCLK | 15 | PB1 |
| MOSI | 16 | PB2 |
| MISO | 14 | PB3 |
| CS | 10 | PB6 |
| MOTION | -- | -- |
| RESET | -- | -- |

- "--" means do not connect.
- JP1: 2 and 1 close, 3 NC.
- For 5V Pro Micro, voltage-level shifter is required.
5 changes: 5 additions & 0 deletions firmware/qmk/pmw3360_promicro/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Processor frequency
F_CPU = 8000000

POINTING_DEVICE_ENABLE = yes
POINTING_DEVICE_DRIVER = pmw3360
33 changes: 33 additions & 0 deletions firmware/qmk/pmw3360_rp2040/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2023 ZiTe (@ZiTe)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define SPI_SCK_PIN GP22
#define SPI_MOSI_PIN GP23
#define SPI_MISO_PIN GP20
#define PMW33XX_CS_PIN GP21 // SPI CS pin.

/* Optional. */
#define PMW33XX_CPI 1600 // The CPI range is 100-12000, in increments of 100. Defaults to 1600 CPI.
#define MOUSE_EXTENDED_REPORT // Use -32767 to 32767, instead of just -127 to 127.
// #define POINTING_DEVICE_TASK_THROTTLE_MS 10

/* RP2040 Reset. */
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET

/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/

/* disable debug print */
// #define NO_DEBUG

/* disable print */
// #define NO_PRINT

/* disable action features */
// #define NO_ACTION_LAYER
// #define NO_ACTION_TAPPING
// #define NO_ACTION_ONESHOT
21 changes: 21 additions & 0 deletions firmware/qmk/pmw3360_rp2040/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* Copyright 2020 QMK Contributors
*
* 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 3 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 <http://www.gnu.org/licenses/>.
*/

#pragma once

#define HAL_USE_SPI TRUE

#include_next "halconf.h"
33 changes: 33 additions & 0 deletions firmware/qmk/pmw3360_rp2040/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"manufacturer": "SideraKB",
"url": "https://github.com/siderakb/pmw3360-pcb",
"maintainer": "ZiTe",
"keyboard_name": "PMW3360-RP2040",
"processor": "RP2040",
"bootloader": "rp2040",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": false
},
"usb": {
"vid": "0x5A69",
"pid": "0x3360",
"device_version": "1.0.0"
},
"matrix_pins": {
"cols": ["GP8"],
"rows": ["GP9"]
},
"diode_direction": "COL2ROW",
"layouts": {
"LAYOUT": {
"layout": [
{ "matrix": [0, 0], "x": 0, "y": 0 }
]
}
}
}
5 changes: 5 additions & 0 deletions firmware/qmk/pmw3360_rp2040/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(KC_LGUI)
};
22 changes: 22 additions & 0 deletions firmware/qmk/pmw3360_rp2040/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Copyright 2020 QMK Contributors
*
* 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 3 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 <http://www.gnu.org/licenses/>.
*/

#pragma once

#include_next "mcuconf.h"

#undef RP_SPI_USE_SPI1
#define RP_SPI_USE_SPI1 TRUE
30 changes: 30 additions & 0 deletions firmware/qmk/pmw3360_rp2040/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# PMW3360-RP2040

[PMW3360 PCB](https://github.com/siderakb/pmw3360-pcb) QMK example RP2040 edition.

Pre-Build firmware can be found in [Releases](https://github.com/siderakb/pmw3360-pcb/releases/tag/fw_v0.1.0).

## Usage

Copy and paste this folder to `qmk_firmware\keyboards\`, and build:
```
qmk compile -kb pmw3360_rp2040 -km default
```

> Tested on QMK version `0.21.6`.
## Pin Map

| PMW3360 PCB | RP2040 |
| ----------- | ------ |
| VIN | 3.3V |
| GND | GND |
| SCLK | GP22 |
| MOSI | GP23 |
| MISO | GP20 |
| CS | GP21 |
| MOTION | -- |
| RESET | -- |

- "--" means do not connect.
- JP1: 2 and 1 close, 3 NC.
2 changes: 2 additions & 0 deletions firmware/qmk/pmw3360_rp2040/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
POINTING_DEVICE_ENABLE = yes
POINTING_DEVICE_DRIVER = pmw3360
3 changes: 0 additions & 3 deletions firmware/qmk/pmw3360_test/Makefile

This file was deleted.

55 changes: 0 additions & 55 deletions firmware/qmk/pmw3360_test/config.h

This file was deleted.

Loading

0 comments on commit 78ead47

Please sign in to comment.