Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mini M keyboard support with the MiniRazz controller #20106

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
02ac378
Mini M keyboard support with the MiniRazz controller
purdeaandrei Mar 12, 2023
86469fe
Increment MATRIX_IO_DELAY to 4
purdeaandrei Mar 13, 2023
58f941d
Update keyboards/unicomp/mini_m/keymaps/default/keymap.c
purdeaandrei Mar 26, 2023
48cc2c2
Update keyboards/unicomp/mini_m/minirazz/minirazz.c
purdeaandrei Mar 26, 2023
7029919
Update keyboards/unicomp/mini_m/minirazz/rules.mk
purdeaandrei Mar 26, 2023
756fb8d
Update keyboards/unicomp/mini_m/minirazz/rules.mk
purdeaandrei Mar 26, 2023
dc0bef8
Code Review Changes
purdeaandrei Mar 26, 2023
a28af4e
Removing keyboard name from parent info.json, sice overriding still d…
purdeaandrei Mar 26, 2023
4053bf7
Update keyboards/unicomp/mini_m/minirazz/readme.md
purdeaandrei Apr 1, 2023
3af570a
Pretty-pront info.json
purdeaandrei Apr 1, 2023
cddf2ec
unicomp/mini_m made the layout macro data-driven
purdeaandrei Apr 1, 2023
adbf55e
unicomp/mini_m: move embedded numpad layer and custom keycode into ke…
purdeaandrei Apr 1, 2023
003390c
Code review changes
purdeaandrei Apr 1, 2023
8a581c6
Define cols and rows to make compilation warning go away
purdeaandrei Apr 2, 2023
3b5ba32
Mini M use QMK driver for SPI
purdeaandrei Apr 2, 2023
53cbb4f
replace gpio_get_all() with palReadPort(PAL_PORT(GP0))
purdeaandrei Apr 8, 2023
8dd8515
minirazz: change to bitbang (revert this once #20315 is merged)
purdeaandrei Apr 8, 2023
30db72b
Applied qmk format-json
purdeaandrei Apr 9, 2023
c29b78e
Apply suggestions from code review
purdeaandrei Apr 9, 2023
fa74a2b
move qspi pad setting code into board file, into board_init() functio…
purdeaandrei Apr 9, 2023
edbda7b
Get rid of long bit-reversing function, use function from quantum/bit…
purdeaandrei Apr 9, 2023
0bde15f
Mini M: add support for some community layouts
purdeaandrei Apr 16, 2023
db0b3fa
Mini M: Move non-layout-related information to the inner json
purdeaandrei Apr 22, 2023
d5b3e11
define a macro DEF_SERIAL_NUMBER, so that keymaps can append text to …
purdeaandrei Apr 22, 2023
938ebaa
justify mike smith added
purdeaandrei Jun 18, 2023
187a297
increase debounce to 10ms
purdeaandrei Jun 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
469 changes: 469 additions & 0 deletions keyboards/unicomp/mini_m/info.json
sigprof marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions keyboards/unicomp/mini_m/justify_mike_smith/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */

#pragma once

#define DEF_SERIAL_NUMBER "purdea.ro:justify_mike_smith"

#ifndef SERIAL_NUMBER
#define SERIAL_NUMBER DEF_SERIAL_NUMBER
#endif

#define MATRIX_ROWS 12
#define MATRIX_COLS 16

#define WEAR_LEVELING_LOGICAL_SIZE 16384
#define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2)

// with eager debouncing the default is not good enough:
#define DEBOUNCE 10
29 changes: 29 additions & 0 deletions keyboards/unicomp/mini_m/justify_mike_smith/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"manufacturer": "Unicomp",
"maintainer": "purdeaandrei",
"url": "https://github.com/purdeaandrei/MiniRazz",
"usb": {
"device_version": "0.0.1",
"pid": "0x27DB",
"vid": "0x16C0"
},
"keyboard_name": "Mini M (Justify Mike Smith)",
"processor": "RP2040",
"bootloader": "rp2040",
"board": "GENERIC_RP_RP2040",
"matrix_pins": {
"ghost": true,
"io_delay": 4,
"cols": [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null],
"rows": [null, null, null, null, null, null, null, null, null, null, null, null]
},
"indicators": {
"on_state": 0,
"num_lock": "GP6",
"caps_lock": "GP7",
"scroll_lock": "GP8"
},
"bootmagic": {
"matrix": [0, 1]
}
}
23 changes: 23 additions & 0 deletions keyboards/unicomp/mini_m/justify_mike_smith/justify_mike_smith.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Copyright 2023 Purdea Andrei
*
* 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 <http://www.gnu.org/licenses/>.
*/

#include <hardware/structs/pads_qspi.h>
void board_init(void) {
/* The following sets the QSPI drive strengths to 2mA with a slow slew rate. */
for (int gpio=0;gpio<NUM_QSPI_GPIOS;gpio++) {
pads_qspi_hw->io[gpio] &= ~(PADS_QSPI_GPIO_QSPI_SCLK_DRIVE_BITS | PADS_QSPI_GPIO_QSPI_SCLK_SLEWFAST_BITS);
}
}
90 changes: 90 additions & 0 deletions keyboards/unicomp/mini_m/justify_mike_smith/matrix.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/* Copyright 2023 Purdea Andrei
*
* 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 <http://www.gnu.org/licenses/>.
*/

#include "quantum.h"
#include <hardware/structs/pads_qspi.h>

#define LEDS_COMMON_ANODE GP5
#define DEC_A0 GP0
#define DEC_A1 GP1
#define DEC_A2 GP2
#define DEC_EN_U1 GP3
#define DEC_EN_U2 GP4
#define ROW_MIN_GPIO GP11

matrix_row_t previous_matrix[MATRIX_ROWS];

static inline void setPinOutput_writeLow(pin_t pin) {
setPinOutput(pin);
writePinLow(pin);
}

void matrix_init_custom(void) {
setPinOutput(LEDS_COMMON_ANODE);
writePinHigh(LEDS_COMMON_ANODE);
setPinOutput(DEC_EN_U1);
writePinHigh(DEC_EN_U1);
setPinOutput(DEC_EN_U2);
writePinHigh(DEC_EN_U2);
setPinOutput(DEC_A0);
setPinOutput(DEC_A1);
setPinOutput(DEC_A2);

for (int i=0; i<=11; i++)
{
setPinInputHigh(ROW_MIN_GPIO + i);
}
}

bool matrix_has_it_changed(const matrix_row_t current_matrix[]) {
bool changed = false;
for (uint8_t row=0; row<MATRIX_ROWS; row++)
{
if (previous_matrix[row] != current_matrix[row]) changed = true;
previous_matrix[row] = current_matrix[row];
}
return changed;
}

bool matrix_scan_custom(matrix_row_t current_matrix[]) {
for (int col=0; col<16; col++) {
uint32_t bit = 1 << col;
writePin(DEC_A0, col & 1);
writePin(DEC_A1, (col >> 1) & 1);
writePin(DEC_A2, (col >> 2) & 1);
if (col & 0b1000) {
writePinLow(DEC_EN_U2);
} else {
writePinLow(DEC_EN_U1);
}
matrix_output_select_delay();
uint32_t keys_pressed = (~palReadPort(PAL_PORT(GP0)) >> (ROW_MIN_GPIO - GP0)) & 0xfff;
if (col & 0b1000) {
writePinHigh(DEC_EN_U2);
} else {
writePinHigh(DEC_EN_U1);
}
matrix_output_unselect_delay(col, !!keys_pressed);
for (int row = 0; row < 12; row++) {
if (keys_pressed & (1 << row)) {
current_matrix[row] |= bit;
} else {
current_matrix[row] &= ~bit;
}
}
}
return matrix_has_it_changed(current_matrix);
}
31 changes: 31 additions & 0 deletions keyboards/unicomp/mini_m/justify_mike_smith/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# unicomp/mini_m/justify_mike_smith

![unicomp/mini_m/justify_mike_smith](https://i.imgur.com/JFXIz4Oh.jpeg)

Supports the Unicomp Mini M keyboard, with the "Justify with Mike Smith" OEM controller.

* Keyboard Maintainer: [Purdea Andrei](https://github.com/purdeaandrei)
* Hardware Supported: Unicomp Mini M Keyboard + OEM Justify with Mike Smith controller
* Hardware Availability:
* [keyboard](https://www.pckeyboard.com/)

To place the keyboard into bootloader mode in order to flash it, hold the ESC key while plugging the board in.
It's possible to make this feature not work, by flashing the wrong firmware onto the keyboard.
If that happens, open up the keyboard, and hold the pushbutton on the controller while plugging in the keyboard.

A couple features of this keyboard implementation:
* The QK_USER_0 keycode is defined as Scroll Lock, when pressed without modifiers, and Num Lock when pressed with shift.
* You can disable this with `#define DISABLE_CUSTOM_NUMSLCK_KEYCODE` in your keymap's config.h
* Layer 1 is a special layer that is activated when the NumLock locklight is on. This is in order to support the embedded numpad.
* You can disable this with `#define DISABLE_NUMPAD_LAYER` in your keymap's config.h
* You can change the number of the activated layer by `#define NUMPAD_LAYER <number>` in your keymap's config.h

Make example for this keyboard (after setting up your build environment):

make unicomp/mini_m/justify_mike_smith:default

Flashing example for this keyboard:

make unicomp/mini_m/justify_mike_smith:default:flash

See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
13 changes: 13 additions & 0 deletions keyboards/unicomp/mini_m/justify_mike_smith/rules.mk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this (eg everything but the src part) can be moved to info.json, and should be.

qmk info -f ascii or qmk migrate can help with that.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover

SRC += matrix.c
CUSTOM_MATRIX = lite
DEBOUNCE_TYPE = sym_eager_pk
41 changes: 41 additions & 0 deletions keyboards/unicomp/mini_m/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* Copyright 2021 stevendlander
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H

// Layer shortcuts
enum custom_layers {
_QWERTY,
_NUMPAD,
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_all(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, QK_USER_0, KC_PAUS,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[_NUMPAD] = LAYOUT_all(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_TRNS, KC_PMNS, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PAST, KC_TRNS, KC_TRNS, KC_PENT,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P0, KC_TRNS, KC_PDOT, KC_PSLS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
};
73 changes: 73 additions & 0 deletions keyboards/unicomp/mini_m/mini_m.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/* Copyright 2021 stevendlander
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H

#ifndef NUMPAD_LAYER
#define NUMPAD_LAYER 1
#endif

#ifndef DISABLE_CUSTOM_NUMSLCK_KEYCODE

enum custom_keycodes {
NUMSLCK = QK_USER_0, // Num Lock on shift, Scroll Lock regularly
};

// Mod key detection
#define MODS_SHIFT_MASK (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT))
#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))

bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case NUMSLCK: {
if (record->event.pressed) {
if (keyboard_report->mods & MODS_SHIFT_MASK) {
tap_code(KC_NUM);
} else {
register_code(KC_SCRL);
}
} else {
unregister_code(KC_SCRL);
}
break;
}
}

return process_record_user(keycode, record);
}

#endif

#ifndef DISABLE_NUMPAD_LAYER

bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (res) {
static bool num_state = false;
if (num_state != led_state.num_lock) {
if (led_state.num_lock) {
layer_on(NUMPAD_LAYER);
} else {
layer_off(NUMPAD_LAYER);
}
num_state = led_state.num_lock;
}

led_update_ports(led_state);
}
return res;
}

#endif
25 changes: 25 additions & 0 deletions keyboards/unicomp/mini_m/minirazz/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */

#pragma once

#define DEF_SERIAL_NUMBER "purdea.ro:minirazz"

#ifndef SERIAL_NUMBER
#define SERIAL_NUMBER DEF_SERIAL_NUMBER
#endif

#define MATRIX_ROWS 12
#define MATRIX_COLS 16

#define SOLENOID_PIN GP25
#define HAPTIC_ENABLE_PIN GP23
#define SOLENOID_DEFAULT_DWELL 20
#define SOLENOID_MIN_DWELL 4
#define HAPTIC_OFF_IN_LOW_POWER 1
#define NO_HAPTIC_MOD

#define WEAR_LEVELING_LOGICAL_SIZE 16384
#define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2)

// with eager debouncing the default is not good enough:
#define DEBOUNCE 10
29 changes: 29 additions & 0 deletions keyboards/unicomp/mini_m/minirazz/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"manufacturer": "Unicomp",
"maintainer": "purdeaandrei",
"url": "https://github.com/purdeaandrei/MiniRazz",
"usb": {
"device_version": "0.0.1",
"pid": "0x27DB",
"vid": "0x16C0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This vendor ID is provided for free as shared usb id by v-usb:
https://github.com/obdev/v-usb/blob/master/usbdrv/USB-IDs-for-free.txt

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still an issue as it is not a unique VID/PID combo, and if you or community users wish to use VIA or similar could be considered a blocker.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not planning on supporting VIA ever.
I am supporting VIAL however, but that doesn't require a unique VID/PID. VIAL detects the keyboard by a magic number embedded somewhere in the SERIAL_NUMBER. (Which for VIAL it means that I have to have a serial number like "purdea.ro:minirazz:MAGIC_NUMBER")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, i don't mean to annoying by refusing to change something, just let me explain my thinking of why I'm resisting this:

If anyone else from my users isn't satisfied with VIAL, and wants to add
VIA support they can of course get a different, unique pair of VID:PID in the future, I'm not gonna block that.

I don't see why I should bother to go requesting a PID code from https://pid.codes/ now, since I don't need it, and occupying a valuable PID code for no reason is wasteful. I am not a keyboard manufacturer, just an open source contributor, I can't afford buying a USB VID, so I must rely on one of the free offerings available.

XAP Also doesn't need Unique VID:PID so hopefully need for unique vid:pid will disappear even for VIA users in the future, so hopefully my hypothetical future users who will want to add VIA support will not need to acquire a vid:pid pair after all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that using the 16C0:27DB USB ID for a QMK-based device is proper, because QMK can present more than just a HID keyboard device to the host:

  • HID mouse or joystick — these have separate entries in the ID table;
  • HID digitizer (absolute pointer) — this one would probably be considered a “generic HID class device”;
  • HID interfaces used by console, VIA, Vial or XAP — probably “generic HID class device” too;
  • MIDI — has a separate entry in the ID table, and uses a completely different driver on Windows;
  • CDC-ACM serial — also has a separate entry in the ID table, and uses a completely different driver on Windows.

These non-HID options are probably the most problematic, because apparently Windows caches the driver configuration by idVendor:idProduct:bcdDevice, and can end up using a completely wrong driver if the cached configuration does not match the actual interfaces presented by the device.

Also apparently there are already some users of 16C0:27DB in the repo:

  • dm9records/plaid
  • dm9records/tartan
  • ibm/model_m_4th_gen
  • ibm/model_m_4th_gen/overnumpad_1xb
  • keyhive/lattice60
  • ortho5by12
  • silverbullet44
  • unicomp/classic_ultracl_post_2013
  • unicomp/classic_ultracl_pre_2013
  • unicomp/pc122
  • unicomp/spacesaver_m_post_2013
  • unicomp/spacesaver_m_pre_2013

Copy link
Contributor Author

@purdeaandrei purdeaandrei Apr 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unicomp/* and ibm/* are mine. I can make changes to them if it becomes necessary. The others are not mine.

dm9records/tartan with 16c0:27db actually has via support: the-via/keyboards#526
This isn't really correct, since it's a shared vid:pid, and I don't think there's a way for VIA to differentiate. dm9records/plaid has a via keymap, but no matching VIA json in the the-via/keyboards repository.

When it comes to compliance with the V-USB terms, I think using 16c0/27db is okay: Under the section "IDs FOR DISCRIMINATION BY SERIAL NUMBER", it says "The USB device MUST provide a textual representation of the serial number, unless ONLY the operating system's default class driver is used.", this implies that both vendor class and an OS default class can coexist, as long as the serial number is specified. It is indeed true that combinations of different kinds of HID is not explicitly permitted, but based on the above I don't think they intended to disallow it. They definitely don't use the precise language of 'usage'/'usage page' that HID documentation uses, instead the say 'Description of use'. I read this as a much fuzzier specification, and even though the keyboard can be compiled to act as a USB mouse too, it still fundamentally is a keyboard, so I think the right VID:PID for it is 16c0/27db, and I think using it this way does comply with the V-USB terms. I fired off a message to Objective Development to check if my interpretation is correct, I will report back if/when I get a response.

Regarding windows caching behavior, I am not really able to test this since I don't have any windows systems. I maybe be able to do some directed testing by borrowing a laptop from someone else. Do you have a reference to where I can read more about this behavior, to figure out how I can test for it? It seems to me like this behavior as it has been described here so far, would affect keymaps too, enabling/disabling certain features, and would affect temporary builds too that enable the CONSOLE for debugging, so I'm surprised that I haven't heard about this. Do windows users really have to overwrite DEVICE_VER in custom keymaps, and when changing what features are enabled?

Copy link
Contributor Author

@purdeaandrei purdeaandrei Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sigprof I have tested the following, in this order, on a borrowed windows 10 machine:

  1. 16c0:27db with all features enabled (8 interfaces in use), shows up nicely, this is the view in Device Manager, if you select View > Devices By Connection:
    image
    Ableton detects the midi interface nicely.
    This vid:pid has never been plugged into this machine before, so should be starting with a fresh "cache".

  2. 16c0:27db disabled all of the features, it doesn't show up as a composite device anymore. Ableton doesn't detect the MIDI interface anymore:
    image

  3. c0ff:fffe disabled all of the features (should be starting fresh with no cache)
    Same as point 2 above

  4. c0ff:fffe with all features enabled
    Same as point 1 above.
    Ableton correctly detects the midi interface

I don't see any evidence of caching causing any kind of trouble.
If you think caching really is a problem, then could you give me some set of steps that would reproduce it, or at least some documentation that I can reference to come up with a possible theory as to how it could be causing trouble?

},
"keyboard_name": "Mini M (MiniRazz)",
"processor": "RP2040",
"bootloader": "rp2040",
"board": "GENERIC_RP_RP2040",
"matrix_pins": {
"ghost": true,
"io_delay": 4,
"cols": [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null],
"rows": [null, null, null, null, null, null, null, null, null, null, null, null]
},
"indicators": {
"on_state": 0,
"num_lock": "GP22",
"caps_lock": "GP21",
"scroll_lock": "GP20"
},
"bootmagic": {
"matrix": [0, 1]
}
}
Loading