qmk/drivers
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
..
backlight Relocate backlight drivers (#21444) 2023-07-08 23:13:10 +10:00
bluetooth Update GPIO macro usages in core (#23093) 2024-02-18 17:08:27 +11:00
eeprom EEPROM: Don't erase if we don't have to. Adding eeprom_driver_format abstraction. (#18332) 2024-05-28 12:49:55 +01:00
encoder Rename encoder pins defines (#24003) 2024-07-03 17:18:27 +10:00
flash SPI flash API cleanup, add async erase capability. (#23894) 2024-07-02 10:16:41 +10:00
gpio Update GPIO expander API naming (#23375) 2024-03-29 16:57:21 +00:00
haptic [Core] usb_device_state: consolidate usb state handling across implementations (#24258) 2024-10-18 09:57:08 +02:00
lcd input_club/ergodox_infinity ST7565 call spi_stop (#24429) 2024-09-26 11:43:39 -07:00
led Rename RGB and HSV structs (#24471) 2024-10-12 00:10:02 +01:00
oled Update GPIO macro usages in core (#23093) 2024-02-18 17:08:27 +11:00
painter Rename RGB and HSV structs (#24471) 2024-10-12 00:10:02 +01:00
ps2 Fix PS/2 Trackpoint mouse clicks (#22265) (#23694) 2024-05-21 00:36:48 +01:00
sensors Remove binary blobs from optical sensors. (#24428) 2024-10-06 20:41:55 +13:00
wear_leveling SPI flash API cleanup, add async erase capability. (#23894) 2024-07-02 10:16:41 +10:00
serial.h [Core] Split ChibiOS usart split driver in protocol and hardware driver part (#16669) 2022-06-18 08:04:17 +10:00
usb2422.c Update GPIO macro usages in core (#23093) 2024-02-18 17:08:27 +11:00
usb2422.h Initial USB2422 driver (#14835) 2021-10-22 00:49:58 +01:00
usbpd.h
ws2812.c WS2812 API rework (#24364) 2024-10-06 21:01:07 +13:00
ws2812.h WS2812 API rework (#24364) 2024-10-06 21:01:07 +13:00