-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Handle communication in interrupts #16
Comments
Hello, 1.) The mouse CAN be done, but is far from polished up. ps2dev was originaly RAW PS2 library (just send and receive bytes over ps2). i've added the keyboard_handle() infrastructure to handle the keyboard protocol to spare user from details and just press the keys. But such thing was not yet done for the mouse protocol. It can be done, but will take few hours to go through the code. Also you would probably need to run two instances of ps2dev, i've never tried it. 2.) How much time do you really need in your main loop? It seems rather weird that you don't have time to call keyboard_handle() once every 10ms... It is probably possible to setup timer interrupt to call it for you every 10ms, but that way it might affect the timing of other jobs, it is probably better to call it yourself from the loop. Or do you mean to use interrupts even for bit-banging (bit timing)? That would require lots of changes and probably might be smart to fork the library for such major change. But i think it would be wise to polish the mouse API first, so after fork both of the libraries have same nice API. I am rather busy, so i would consider the rewrite of bit timing as last resort, but yes, it is probably interresting topic and i don't say it should not be done. |
Sup! Thank you for answering me. Let me clarify the details. Here the firmware of the HID controller. It's based on arduino micro pro (atmega32u4). Here the main(). I use HID Project and ps2dev to provide users with different HID options (USB and PS/2). As for periodic calls - as you can see, I already have something similar in main, but I need to know that these calls do not contain a delay and that they do not have any recommendations regarding the frequency of the call. That is, main should spin without any delays. That's why I said that it would be great to have a bitbang without delay or with the help of a periodic call that will decide internally when it's time to send the next bit, and will not call delay. |
@mdevaev BTW do you know you can use raspberry pi zero (running Linux) to act as USB mouse/keyboard? |
Yes, I've been doing this for a long time. Arduino is another way, which, however, is still needed since the core modules are imperfect and do not work well with ancient motherboards. The GPIO has a voltage of 3.3 v while the PS/2 uses 5v. In order not to damange the GPIO, you need a level shifter. In addition, it complicates the design. The Arduino does a great job and it's a dedicated fast controller for any HID purpose. In general, I don't need a port on Raspberry, only Arduino. |
Please let me know when you are going to do this :) Plans, etc |
Have you seen this? https://github.com/ndusart/ps2-keyboard |
@Harvie This library is tied to using TIMER1 without the ability to configure it, and there is no mouse support. If you don't have time, I could contact the author of that library. |
Maxim Devaev ( https://github.com/pikvm ) wrote this:
The text was updated successfully, but these errors were encountered: