mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-23 11:52:59 +00:00
d4be07dad3
* add support for hid gamepad interface add documentation for HID joystick Add joystick_task to read analog axes values even when no key is pressed or release. update doc Update docs/feature_joystick.md Manage pin setup and read to maintain matrix scan after analog read * Incorporates patches and changes to HID reporting There are some patches provided by @a-chol incorporated on this commit, and also some changes I made to the HID Report structure. The most interesting is the one dealing with number of buttons: Linux doesn't seem to care, but Windows requires the HID structure to be byte aligned (that's in the spec). So if one declares 8/16/32... buttons they should not have any issues, but this is what happens when you have 9 buttons: ``` bits |0|1|2|3|4|5|6|7| |*|*|*|*|*|*|*|*| axis 0 (report size 8) |*|*|*|*|*|*|*|*| ... |*|*|*|*|*|*|*|*| |*|*|*|*|*|*|*|*| |*|*|*|*|*|*|*|*| |*|*|*|*|*|*|*|*| |*|*|*|*|*|*|*|*| axis 6 |*|*|*|*|*|*|*|*| first 8 buttons (report size 1) |*| | | | | | | | last of 9 buttons, not aligned ``` So for that I added a conditonal that will add a number of reports with size 1 to make sure it aligns to the next multiple of 8. Those reports send dummy inputs that don't do anything aside from aligning the data. Tested on Linux, Windows 10 and Street Fighter (where the joystick is recognized as direct-input) * Add save and restore of each pin used in reading joystick (AVR). Allow output pin to be JS_VIRTUAL_AXIS if the axis is connected to Vcc instead of an output pin from the MCU. Fix joystick report id Fix broken v-usb hid joystick interface. Make it more resilient to unusual settings (none multiple of eight button count, 0 buttons or 0 axes) Correct adc reading for multiple axes. Piecewise range conversion for uncentered raw value range. Input, output and ground pin configuration per axis. Documentation fixes * Fix port addressing for joystick analog read * The other required set of changes As per the PR, the changes still holding it up. Add onekey for testing. Fix ARM builds. Fix device descriptor when either axes or buttons is zero. Add compile-time check for at least one axis or button. Move definition to try to fix conflict. PR review comments. qmk cformat * avoid float functions to compute range mapping for axis adc reading * Remove V-USB support for now. Updated docs accordingly. * Update tmk_core/protocol/lufa/lufa.c Co-Authored-By: Ryan <fauxpark@gmail.com> * Update tmk_core/protocol/usb_descriptor.c Co-Authored-By: Ryan <fauxpark@gmail.com> * Update tmk_core/protocol/usb_descriptor.c Co-Authored-By: Ryan <fauxpark@gmail.com> * Update tmk_core/protocol/usb_descriptor.c Co-Authored-By: Ryan <fauxpark@gmail.com> * Add support for joystick adc reading for stm32 MCUs. Fix joystick hid report sending for chibios * Fix HID joystick report sending for ChibiOS. Add one analog axis to the onekey:joystick keymap. Fix pin state save and restore during joystick analog read for STM32 MCUs. * Update tmk_core/protocol/chibios/usb_main.c Co-Authored-By: Ryan <fauxpark@gmail.com> * Update tmk_core/protocol/lufa/lufa.c Co-Authored-By: Ryan <fauxpark@gmail.com> * Add missing mcuconf.h and halconf.h to onekey:joystick keymap. Add suggested fixes from PR. * Switch saveState and restoreState signature to use pin_t type. onekey:joystick : add a second axis, virtual and programmatically animated. * Update docs/feature_joystick.md Co-Authored-By: Ryan <fauxpark@gmail.com> * Update docs/feature_joystick.md Co-Authored-By: Ryan <fauxpark@gmail.com> * Add PR corrections * Remove halconf.h and mcuconf.h from onekey keymaps * Change ADC_PIN to A0 Co-authored-by: achol <allecooll@hotmail.com> Co-authored-by: José Júnior <jose.junior@gmail.com> Co-authored-by: a-chol <achol@notamail.com> Co-authored-by: Nick Brassel <nick@tzarc.org> Co-authored-by: Ryan <fauxpark@gmail.com>
178 lines
6.5 KiB
Markdown
178 lines
6.5 KiB
Markdown
* Tutorial
|
|
* [Introduction](newbs.md)
|
|
* [Setup](newbs_getting_started.md)
|
|
* [Building Your First Firmware](newbs_building_firmware.md)
|
|
* [Flashing Firmware](newbs_flashing.md)
|
|
* [Testing and Debugging](newbs_testing_debugging.md)
|
|
* [Getting Help/Support](support.md)
|
|
* [Other Resources](newbs_learn_more_resources.md)
|
|
* [Syllabus](syllabus.md)
|
|
|
|
* FAQs
|
|
* [General FAQ](faq_general.md)
|
|
* [Build/Compile QMK](faq_build.md)
|
|
* [Debugging/Troubleshooting QMK](faq_debug.md)
|
|
* [Keymap FAQ](faq_keymap.md)
|
|
* [Glossary](reference_glossary.md)
|
|
|
|
* Configurator
|
|
* [Overview](newbs_building_firmware_configurator.md)
|
|
* [Step by Step](configurator_step_by_step.md)
|
|
* [Troubleshooting](configurator_troubleshooting.md)
|
|
* QMK API
|
|
* [Overview](api_overview.md)
|
|
* [API Documentation](api_docs.md)
|
|
* [Keyboard Support](reference_configurator_support.md)
|
|
|
|
* CLI
|
|
* [Overview](cli.md)
|
|
* [Configuration](cli_configuration.md)
|
|
* [Commands](cli_commands.md)
|
|
|
|
* Using QMK
|
|
* Guides
|
|
* [Customizing Functionality](custom_quantum_functions.md)
|
|
* [Driver Installation with Zadig](driver_installation_zadig.md)
|
|
* [Keymap Overview](keymap.md)
|
|
* Development Environments
|
|
* [Docker Guide](getting_started_docker.md)
|
|
* [Vagrant Guide](getting_started_vagrant.md)
|
|
* Flashing
|
|
* [Flashing](flashing.md)
|
|
* [Flashing ATmega32A (ps2avrgb)](flashing_bootloadhid.md)
|
|
* IDEs
|
|
* [Using Eclipse with QMK](other_eclipse.md)
|
|
* [Using VSCode with QMK](other_vscode.md)
|
|
* Git Best Practices
|
|
* [Introduction](newbs_git_best_practices.md)
|
|
* [Your Fork](newbs_git_using_your_master_branch.md)
|
|
* [Merge Conflicts](newbs_git_resolving_merge_conflicts.md)
|
|
* [Fixing Your Branch](newbs_git_resynchronize_a_branch.md)
|
|
* Keyboard Building
|
|
* [Hand Wiring Guide](hand_wire.md)
|
|
* [ISP Flashing Guide](isp_flashing_guide.md)
|
|
|
|
* Simple Keycodes
|
|
* [Full List](keycodes.md)
|
|
* [Basic Keycodes](keycodes_basic.md)
|
|
* [Language-Specific Keycodes](reference_keymap_extras.md)
|
|
* [Modifier Keys](feature_advanced_keycodes.md)
|
|
* [Quantum Keycodes](quantum_keycodes.md)
|
|
|
|
* Advanced Keycodes
|
|
* [Command](feature_command.md)
|
|
* [Dynamic Macros](feature_dynamic_macros.md)
|
|
* [Grave Escape](feature_grave_esc.md)
|
|
* [Leader Key](feature_leader_key.md)
|
|
* [Mod-Tap](mod_tap.md)
|
|
* [Macros](feature_macros.md)
|
|
* [Mouse Keys](feature_mouse_keys.md)
|
|
* [Space Cadet Shift](feature_space_cadet.md)
|
|
* [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md)
|
|
|
|
* Software Features
|
|
* [Auto Shift](feature_auto_shift.md)
|
|
* [Combos](feature_combo.md)
|
|
* [Debounce API](feature_debounce_type.md)
|
|
* [Key Lock](feature_key_lock.md)
|
|
* [Layers](feature_layers.md)
|
|
* [One Shot Keys](one_shot_keys.md)
|
|
* [Pointing Device](feature_pointing_device.md)
|
|
* [Raw HID](feature_rawhid.md)
|
|
* [Swap Hands](feature_swap_hands.md)
|
|
* [Tap Dance](feature_tap_dance.md)
|
|
* [Tap-Hold Configuration](tap_hold.md)
|
|
* [Terminal](feature_terminal.md)
|
|
* [Unicode](feature_unicode.md)
|
|
* [Userspace](feature_userspace.md)
|
|
* [WPM Calculation](feature_wpm.md)
|
|
|
|
* Hardware Features
|
|
* Displays
|
|
* [HD44780 LCD Controller](feature_hd44780.md)
|
|
* [OLED Driver](feature_oled_driver.md)
|
|
* Lighting
|
|
* [Backlight](feature_backlight.md)
|
|
* [LED Matrix](feature_led_matrix.md)
|
|
* [RGB Lighting](feature_rgblight.md)
|
|
* [RGB Matrix](feature_rgb_matrix.md)
|
|
* [Audio](feature_audio.md)
|
|
* [Bluetooth](feature_bluetooth.md)
|
|
* [Bootmagic](feature_bootmagic.md)
|
|
* [Custom Matrix](custom_matrix.md)
|
|
* [DIP Switch](feature_dip_switch.md)
|
|
* [Encoders](feature_encoders.md)
|
|
* [Haptic Feedback](feature_haptic_feedback.md)
|
|
* [Joystick](feature_joystick.md)
|
|
* [Proton C Conversion](proton_c_conversion.md)
|
|
* [PS/2 Mouse](feature_ps2_mouse.md)
|
|
* [Split Keyboard](feature_split_keyboard.md)
|
|
* [Stenography](feature_stenography.md)
|
|
* [Thermal Printer](feature_thermal_printer.md)
|
|
* [Velocikey](feature_velocikey.md)
|
|
|
|
* Developing QMK
|
|
* [PR Checklist](pr_checklist.md)
|
|
* Breaking Changes
|
|
* [Overview](breaking_changes.md)
|
|
* [My Pull Request Was Flagged](breaking_changes_instructions.md)
|
|
* History
|
|
* [2020 May 30](ChangeLog/20200530.md)
|
|
* [2020 Feb 29](ChangeLog/20200229.md)
|
|
* [2019 Aug 30](ChangeLog/20190830.md)
|
|
|
|
* C Development
|
|
* [ARM Debugging Guide](arm_debugging.md)
|
|
* [AVR Processors](hardware_avr.md)
|
|
* [Coding Conventions](coding_conventions_c.md)
|
|
* [Compatible Microcontrollers](compatible_microcontrollers.md)
|
|
* [Drivers](hardware_drivers.md)
|
|
* [ADC Driver](adc_driver.md)
|
|
* [I2C Driver](i2c_driver.md)
|
|
* [SPI Driver](spi_driver.md)
|
|
* [WS2812 Driver](ws2812_driver.md)
|
|
* [EEPROM Driver](eeprom_driver.md)
|
|
* ['serial' Driver](serial_driver.md)
|
|
* [GPIO Controls](internals_gpio_control.md)
|
|
* [Keyboard Guidelines](hardware_keyboard_guidelines.md)
|
|
|
|
* Python Development
|
|
* [Coding Conventions](coding_conventions_python.md)
|
|
* [QMK CLI Development](cli_development.md)
|
|
|
|
* Configurator Development
|
|
* QMK API
|
|
* [Development Environment](api_development_environment.md)
|
|
* [Architecture Overview](api_development_overview.md)
|
|
|
|
* Hardware Platform Development
|
|
* Arm/ChibiOS
|
|
* [Selecting an MCU](platformdev_selecting_arm_mcu.md)
|
|
* [Early initialization](platformdev_chibios_earlyinit.md)
|
|
|
|
* QMK Reference
|
|
* [Contributing to QMK](contributing.md)
|
|
* [Translating the QMK Docs](translating.md)
|
|
* [Config Options](config_options.md)
|
|
* [Make Documentation](getting_started_make_guide.md)
|
|
* [Documentation Best Practices](documentation_best_practices.md)
|
|
* [Documentation Templates](documentation_templates.md)
|
|
* [Community Layouts](feature_layouts.md)
|
|
* [Unit Testing](unit_testing.md)
|
|
* [Useful Functions](ref_functions.md)
|
|
* [info.json Format](reference_info_json.md)
|
|
|
|
* For a Deeper Understanding
|
|
* [How Keyboards Work](how_keyboards_work.md)
|
|
* [How a Matrix Works](how_a_matrix_works.md)
|
|
* [Understanding QMK](understanding_qmk.md)
|
|
|
|
* QMK Internals (In Progress)
|
|
* [Defines](internals_defines.md)
|
|
* [Input Callback Reg](internals_input_callback_reg.md)
|
|
* [Midi Device](internals_midi_device.md)
|
|
* [Midi Device Setup Process](internals_midi_device_setup_process.md)
|
|
* [Midi Util](internals_midi_util.md)
|
|
* [Send Functions](internals_send_functions.md)
|
|
* [Sysex Tools](internals_sysex_tools.md)
|