Commit Graph

98 Commits

Author SHA1 Message Date
Joel Challis bc5c5e3251 Align sleep_led logic (#25395) 2025-06-27 08:17:28 +01:00
Pablo Martínez 955809bd5a Add compiler_support.h (#25274) 2025-05-22 23:31:15 +10:00
Joel Challis 88c094908b Add raw_hid support to host driver (#25255) 2025-05-12 08:38:48 +10:00
eynsai 7a2cd0fa96 High resolution scrolling (without feature report parsing) (#24423)
* hires scrolling without feature report parsing

* fix valid range for exponent

* fix incorrect minimum exponent value documentation
2025-04-23 00:04:31 +02:00
Ryan a3cfb1dab7 Joystick: add support for 8-way hat switch (#24515) 2024-11-09 14:10:10 -08:00
Stefan Kerkmann 3f9d464412 [Core] usb_device_state: consolidate usb state handling across implementations (#24258)
* usb_device_state: add idle_rate, led and protocol

Previously all usb drivers and platform implementations (expect for our
oddball atsam) tracked the same two global variables:

- keyboard_protocol: to indicate if we are in report or boot protocol
- keyboard_idle: for the idle_rate of the keyboard endpoint

And a local variable that was exposed trough some indirection:

- keyboard_led_state: for the currently set indicator leds (caps lock etc.)

These have all been moved into the usb_device_state struct wich is
accessible by getters and setters.

This reduces code duplication and centralizes the state management
across platforms and drivers.

Signed-off-by: Stefan Kerkmann <karlk90@pm.me>

* usb_device_state: reset protocol on reset

The usb hid specification section 7.2.6 states:

When initialized, all devices default to report protocol. However the
host should not make any assumptions about the device’s state and should
set the desired protocol whenever initializing a device.

Thus on reset we should always do exactly that.

Signed-off-by: Stefan Kerkmann <karlk90@pm.me>

* keyboards: fix oversize warnings

Signed-off-by: Stefan Kerkmann <karlk90@pm.me>

---------

Signed-off-by: Stefan Kerkmann <karlk90@pm.me>
2024-10-18 09:57:08 +02:00
QMK Bot 7e53bb9965 Merge remote-tracking branch 'origin/master' into develop 2024-10-15 14:06:17 +00:00
Ryan 85a7627641 Digitizer: fix units tag in report descriptor (#24482) 2024-10-15 07:05:43 -07:00
eynsai 2cb35373c6 Extended wheel reports (#24422)
extended wheel reports
2024-10-06 11:26:55 +02:00
Joel Challis 63dd131d81 Refactor vusb to protocol use pre/post task (#14944) 2024-03-14 21:45:12 +11:00
Joel Challis 79020519b4 Align VUSB suspend protocol logic (#22688) 2024-02-01 15:33:57 +00:00
Joel Challis b6b3efc14b Remove console out endpoint (#22304) 2024-01-09 14:01:34 +00:00
Ryan 4601f339e4 V-USB: implement NKRO (#22398) 2023-11-26 22:50:53 +11:00
Ryan cbf538aaaa V-USB: Add generic send_report() function (#22323) 2023-11-26 22:50:21 +11:00
Ryan db4e3bb232 V-USB: Fix GET_IDLE/SET_IDLE (#22332)
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
2023-10-27 12:21:13 +11:00
Ryan b7e62af755 V-USB: Implement GET_PROTOCOL and SET_PROTOCOL handling (#22324) 2023-10-25 00:54:43 +01:00
Ryan 0c160e1fba Separate 6KRO and NKRO report structs (#22267) 2023-10-23 15:43:46 +11:00
Stefan Kerkmann 32174abcfa Update keyboard report descriptor for USB compliance (#21626)
Running the "HID Tests" suite of the USB 3 Command Verifier (USB3CV)
tool resulted in the following error:

(HID: 3.2.61) The report descriptor returned in response to a
GetDescriptor(Report) must be compliant with the HID specification.

Byte Number:   37h (  55d)
Data Field: 91 02
Mnemonic:  Output
Value: (Variable)
Errors: Error:   LOGICAL MAX MUST be bounded by Report Size

The error stems from the fact that logical minimum and maximum are
global items, which means that the next item in a report descriptor
inherits the value from the previously set value. In this case the
status leds item inherited the logical minimum (=0) and maximum (=255)
from the keycodes item. As the status leds set a report size of 1 bit,
wich can only hold a boolean, it becomes clear that this range would
never fit.

The fix is straightforward, we just define a appropriate logical maximum
(=1), the mismatch is solved and our keyboard now passes the compliance
tests. Defining the logical minimum is redundant in this case but is
kept to form a logical block.
2023-07-28 01:05:01 +01:00
Ryan aad5746682 Move protocol makefiles into their respective folders (#21332)
* Move protocol makefiles into their respective folders

* Fix USB-USB converter
2023-06-22 15:07:28 +01:00
Ruslan Sayfutdinov 85ee55ff3b Detect host OS based on USB fingerprint (#18463)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Nick Brassel <nick@tzarc.org>
2022-12-09 03:45:30 +11:00
Ryan 1e95f7be8f Joystick feature improvements (#19052) 2022-11-27 03:14:45 +11:00
Ryan 6cc9513ab0 Digitizer feature improvements (#19034) 2022-11-12 23:28:11 +00:00
Ryan 6dbbeea46a Refactor send_extra (#18615) 2022-10-06 19:35:01 -07:00
Ryan 09d3e27710 Refactor more host code (programmable button & digitizer) (#18565) 2022-10-05 09:19:12 +11:00
Ryan f76b55d5ad Adjust EXTRAKEY_ENABLE ifdefs for send_extra() (#18249) 2022-09-02 21:50:36 +01:00
Ryan 09d668eb0e Simplify extrakeys sending at the host driver level (#18230)
* Simplify extrakeys sending at the host driver level

* There are two arguments here

* Wrong syntax

* Adjust keyboards which use a custom host driver
2022-09-02 20:38:27 +01:00
Ryan d983251c10 Switch over MANUFACTURER and PRODUCT to string literals (#18183) 2022-08-28 09:59:40 -07:00
Drashna Jaelre 0ab51ee29d Add support for large Mouse Reports (#16371)
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
2022-06-08 18:39:16 -07:00
Joel Challis 047ef3cd12 VUSB - Use correct endpoint poll for VIA (#16691) 2022-03-19 17:40:47 +00:00
QMK Bot 63646e8906 Format code according to conventions (#16322) 2022-02-12 18:29:31 +00:00
Drashna Jaelre 9d7e64bcb3 Remove Deprecated USB Polling comment from vusb.c (#15420) 2021-12-07 19:57:33 +11:00
Joel Challis 634e42b2b4 Revert to old init order for host driver (#15029)
* Partially revert 14888
2021-11-02 18:53:46 +00:00
Joel Challis ee371c1295 Fix up issues shown by clang-format of vusb (#15004) 2021-11-01 18:57:37 +00:00
Joel Challis 2ec268bd21 Begin to carve out platform/protocol API - Migrate keyboard_* calls (#14888) 2021-10-24 20:39:41 +01:00
Thomas Weißschuh 83988597f4 Add Support for USB programmable buttons (#12950) 2021-09-15 08:40:22 -07:00
Joel Challis 96e2b13d1d Begin to carve out platform/protocol API - Single main loop (#13843)
* Begin to carve out platform/protocol API

* Fix up after rebase
2021-08-18 00:11:07 +01:00
a-chol 75b49aff56 Digitizer HID interface : absolute coordinates for mouse cursor (#12851)
* Add digitizer HID interface for setting the mouse cursor position at
absolute screen coordinates. Tested on Pro Micro, Proton C and
Blackpill.

* Update docs/feature_digitizer.md

Co-authored-by: Ryan <fauxpark@gmail.com>

* Update tmk_core/protocol/usb_descriptor.c

Co-authored-by: Ryan <fauxpark@gmail.com>

* Add missing copyrights
Add V-USB support

* Add support for digitizer dedicated endpoint for lufa and chibios.
Fix formatting issues
Move digitizer_task definition to the feature's base implementation file

* Run cformat on modified files

* Change digitizer report usage to Digitizer instead of Pen to avoid
pointer disappearing on Windows.

* Update tmk_core/protocol/vusb/vusb.c

Co-authored-by: Ryan <fauxpark@gmail.com>

* Run cformat from docker image

* Remove send_digitizer from host_driver_t and instead rely on the
declaration being the interface to the implementation in each
HW-specific usb implementation.

* Fix build : send_digitizer shouldn't be static in vusb and add
weak-linkage implementation for tests without usb implementation

* Change digitizer user interface to match pointing device's

* Update documentation with new API

Co-authored-by: a-chol <nothing@none.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
2021-08-18 04:52:44 +10:00
Joel Challis 567da49ed0 Avoid LTO conficts on arm_atsam (#13676) 2021-07-24 12:13:06 +01:00
Ryan 7ed5ac4a60 Use string literals for SERIAL_NUMBER (#13403) 2021-07-16 19:43:18 +10:00
Stefan Kerkmann 49fd3c0760 [Core] ChibiOS fix O3 and LTO breakage of extra keys and joystick (#12819) 2021-06-06 22:16:55 -07:00
Nick Brassel 58142f0726 Fixup housekeeping from being invoked twice per loop. (#12933) 2021-05-18 17:02:28 +10:00
Joel Challis 5ba4391cf2 Refactor of USB code within split_common (#11890)
* Initial refactor of usb code within split_common

* Add headers

* Correct disable condition

* Format

* Align func name
2021-02-28 15:52:58 +00:00
github-actions[bot] deaabff752 Format code according to conventions (#12046)
Co-authored-by: QMK Bot <hello@qmk.fm>
2021-02-27 22:35:41 +00:00
Nick Brassel 6623744172 Fix build for attiny85-based boards. (#12044) 2021-02-28 09:33:33 +11:00
fauxpark 23fd1aee00 Merge remote-tracking branch 'upstream/master' into develop 2021-02-25 16:04:53 +11:00
Ryan 39694d5eb0 V-USB suspend refactor (#11891) 2021-02-25 15:54:25 +11:00
Joel Challis 1f2fe2eab9 Refactor platform logic within print.h (#11863)
* Remove GCC check from debug

* Remove platform logic from common.mk

* Refactor platform logic within print.h

* restore debug.c format

* headers

* Rename function pointer type

* review comments

* Update tmk_core/common/printf.c

Co-authored-by: Nick Brassel <nick@tzarc.org>

* Format

Co-authored-by: Nick Brassel <nick@tzarc.org>
2021-02-14 01:44:22 +00:00
Drashna Jaelre 99f3df2893 Add support for 8 buttons to mouse report (#10807)
* Add support for 8 buttons to mouse report

This includes support for 8 buttons in mousekeys.  However, this does move the keys around due to the fact that the last mousekey keycode is already 0xFF, so any past that would not work with register_code and the like, breaking them for tap hold keys, encoders, and other features.

* Update mouse key docs

* Add changes based on feedback

* Fix VUSB report size comment

Because drashna red gud

* Fix typo in action.c

* Fix IS_MOUSE_BUTTON check

* Change start range for mousekeys so that the end is 0xFF properly

* condense mousekeys check
2021-01-28 04:38:34 +11:00
Ryan aa0e33eca0 Add support for shared EP on V-USB boards (#11103) 2021-01-11 19:46:30 +11:00
Ryan 78b2f120e5 V-USB: Fix initial dropped keypress (#11263) 2020-12-23 07:33:04 +11:00