The following warnings occurred: | |||||||||||||||
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.1.31 (Linux)
|
![]() |
Configure D-Pad - Printable Version +- Freeplaytech Forum (https://forum.freeplaytech.com) +-- Forum: Freeplay Zero / Freeplay CM3 / Game Pie Advance (https://forum.freeplaytech.com/forumdisplay.php?fid=24) +--- Forum: Freeplay Zero/CM3 (AKA GPA) Software (https://forum.freeplaytech.com/forumdisplay.php?fid=26) +--- Thread: Configure D-Pad (/showthread.php?tid=5051) |
RE: Configure D-Pad - billsuncle - 11-10-2019 Thanks for the speedy replies guys! I’m looking for a permanent way to do it, and ideally would have the audio intact as well. I’ve had a read through and started making my own DTS file, but have been very bogged down with work so it may take a little while before I can report back with results... RE: Configure D-Pad - Porcinus - 11-12-2019 Thanks ![]() RE: Configure D-Pad - billsuncle - 11-22-2019 Ok so I’ve managed to get the button sending button presses by modifying the DTS file as per your earlier post, thanks Flavor ![]() ![]() ![]() However, now I am trying to configure it so that the D-Pad moves the mouse cursor. Just replacing the linux codes in the DTS file with, for example, Rel_X+1 doesn’t seem to work - I get a syntax error message when I try to compile the dtbo file from the dts file, and in any case, the input device doesn’t seem to be configure to send EV_REL data (as a USB mouse input device does). Do you have any pointers on how I can configure the device tree overlay so that it can move the mouse cursor? Apologies if my message is a jumble, I’m very new to tinkering with linux!!! RE: Configure D-Pad - billsuncle - 11-22-2019 Further searching reveals that the kernel has a driver “gpio_mouse”, and I assume I must substitute “gpio_keys” in the “compatible = “gpio_keys”” section of the DTS file, then configure the GPIO lines accordingly... I’ve found the “gpio_mouse” driver at: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/input/mouse/gpio_mouse.c But am unsure exactly how to modify the DTS file so that gpio pins 6, 5, 4 and 17 control mouse movement, pins 16 and 24 are left and right mouse clicks, and the rest of the pins are key presses as in your original DTS file Flavor. Any help with how to do this would be much appreciated!!! RE: Configure D-Pad - billsuncle - 11-25-2019 Ooooooook, So I have found what I need to put in the DTS file for the GPIO to control the mouse here: https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/input/gpio-mouse.txt And have written the following DTS file: Code: #include <dt-bindings/gpio/gpio.h> Code: dtc -I dts -O dtb -o /boot/overlays/FPZgpiomouse.dtbo FPZgpiomouse.dts Code: Error: FPZgpiomouse.dts:1.1-2 syntax error Any suggestions where to go from here??? RE: Configure D-Pad - Porcinus - 11-25-2019 I think the example is maybe outdated or not compatible with Rpi. I am on my phone so it is hard to write a long explain :S Look at https://github.com/TheFlav/Freeplay-Support/blob/master/gpio-keys-freeplay.dts ,each key section. Not sure the include is needed. RE: Configure D-Pad - billsuncle - 11-25-2019 Thanks for the reply Porcinus, The DTS on TheFlav's github references the gpio_keys kernel driver, and I believe it can only send key presses, not mouse input, so I cannot simply replace the key presses with equivalent Linux codes for mouse input. I believe that in order send mouse input I need to use the gpio_mouse kernel driver, so I've created a DTS file referencing that, but when I try to compile it into the binary DTBO file I get the above error... RE: Configure D-Pad - Porcinus - 11-25-2019 Little misunderstand, On your current mouse DTS, please try: - remove the include - replace &gpio0 by &gpio (I was meaning this and the following line by "each key section") - replace GPIO_ACTIVE_LOW by 1 RE: Configure D-Pad - billsuncle - 11-25-2019 Thanks again for your reply Porcinus. Okay, so this is the DTS file I've arrived at; Code: // Definitions for Freeplay Zero/CM3 gpio-keys (sorry pasting the code hasn't preserved the indents, but they are there!) It compiles to binary, and I've updated /boot/config.txt But it still doesn't work ![]() I've downloaded the the evtest and input-utils packages And when I enter the command lsinput I get the following: Code: /dev/input/event0 So it isn't showing up as an input device... Do you have any other recommendations for things I could try? I feel like we're so close to cracking it! ![]() RE: Configure D-Pad - Porcinus - 11-26-2019 By curiosity, does dmesg show anything related to gpio-mouse? |