Skip to content
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

Example Rust firmware implementation? #17

Open
riskable opened this issue Dec 16, 2020 · 6 comments
Open

Example Rust firmware implementation? #17

riskable opened this issue Dec 16, 2020 · 6 comments

Comments

@riskable
Copy link

I would love to add support for HID-IO in my hall effect keyboard firmware but I can't find any Rust examples. Does anything exist that I can reference?

@haata
Copy link
Member

haata commented Dec 16, 2020

Do you have any details on your keyboard?

@riskable
Copy link
Author

I already made a hall effect numpad but I just designed and ordered a 65% PCB. So far I've been working with stm32f401 but it's written using platform-agnostic code/crates (embedded-hal) so it should be trivial to make it run on anything that Rust supports. I've presently got it based on Keyberon (https://github.com/TeXitoi/keyberon/) and I've been working with the author to add Sequence/Macro support (TeXitoi/keyberon#30).

My keyboard uses analog multiplexers + 49E linear hall effect sensors (because they're cheap but work fine =). It presently uses 1000Hz polling rate and supports 6key+modifiers rollover (and reports all 6 keys in that first 1ms report--unlike QMK haha). Here's some pics and details on the numpad I made as the proof-of-concept:

https://imgur.com/a/IFsvBGh

I'm using a 3D printable magnetic separation switch design: https://gfycat.com/sorrowfulequaliraniangroundjay

The switch design is entirely parametric (.scad file) so you can control the travel, tolerances, force curve, and whatnot to a very fine degree.

The keyboard case (for the 65%) I'm working on right now will be very similar to my numpad's case in that you can pop the whole top off and take it over to the sink to give it a good scrub hehe: https://gfycat.com/welcomeindolentcanary

Hopefully that explains what you need to know 😄

@riskable
Copy link
Author

riskable commented Dec 16, 2020

Oh, here's a force curve I measured for one of my switches: https://imgur.com/FNoTSpL

I believe that one was a 3.5mm-of-travel switch using N35 + N35 magnets with something like a 0.3mm MAGNET_GAP (a parameter in my .scad). The magnet gap controls the resting distance between the magnet in the stem and the magnet in the body which is a surprisingly accurate way to control the initial force of the switch. Since it's magnetic separation the point of tactility is basically at 0.0mm and it feels fantastic =)

@haata
Copy link
Member

haata commented Dec 16, 2020

This sounds very interesting, we should have a chat. Are you on discord?

@haata
Copy link
Member

haata commented Dec 16, 2020

Basically, I'm starting to port some pieces of the firmware to rust (specifically the hid-io protocol piece) instead of writing it in C. So it could be very useful for your project.

@riskable
Copy link
Author

riskable commented Dec 16, 2020

Yes I'm on Discord: riskable#4986

Also on Matrix: @riskable:matrix.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants