microscheme icon indicating copy to clipboard operation
microscheme copied to clipboard

Add support for the Keyboardio Atreus

Open hexbyte-de opened this issue 4 years ago • 5 comments

This adds the Keyboardio Atreus as new model to be able to build Menelaus for it. This is necessary, because the Keyboardio Atreus uses 3 pins that aren't provided by the LEO, in contrast to the original design by @technomancy.

This is marked as draft, because I don't know if there is an LED on the PCB that can be used for exception indication. I don't assume there is, but want to make sure before this gets merged. @keyboardio could you help me out with this question, please?

Except from that, everything works as expected, is ready for review and can be tested with this branch: https://git.sr.ht/~hexbyte/menelaus/tree/keyboardio-atreus

hexbyte-de avatar Feb 24 '21 13:02 hexbyte-de

If this isn't a good fit for inclusion in microscheme, maybe it would be better to call (set! arduino-pins ...) and (set! arduino-ports ...) from menelaus instead?

technomancy avatar Mar 20 '21 18:03 technomancy

@technomancy Come to think of it, my changes add an arbitrary mapping between microscheme pin numbers and real pins. Considering @ryansuchocki's comment https://github.com/ryansuchocki/microscheme/pull/21#issuecomment-168361156, setting the ports and pins in menelaus sounds like the cleaner solution.

hexbyte-de avatar Mar 20 '21 23:03 hexbyte-de

Apologies for staying quiet so long. Did you work out what to do about the debug LED?

w.r.t. pin mappings, I think the ideal solution would be to add a generic "raw 32u4" model a la #21, and then define Atreus-specific mappings downstream. The advantages of this would be that (A) others can benefit from the raw model and (B) you can update the mappings in future without requiring a ms release.

However, if that can't be done then I'm happy to merge whatever you have.

ryansuchocki avatar Mar 22 '21 11:03 ryansuchocki

I just received an answer from keyboardio and there is no onboard LED, so I'll remove the draft state.

@technomancy: Setting the pins and port in menelaus also works for me. If it is not too hacky for you, I'm perfectly happy with this solution. Maybe this is how I would have implemented it initially, if I had any prior practical experience with Scheme (or Lisp in general).

A raw mode would be ideal and maybe I find the time to add it someday, but at the moment I can't promise that. I don't have any preference, how we add the pin definitions now. In the end, it comes down to what you both prefer for Microscheme and Menelaus.

hexbyte-de avatar Mar 23 '21 22:03 hexbyte-de

I finally got around to loading Microscheme on my Keyboardio Atreus, and this PR works great for that. But I think the "raw 32u4" model makes more sense as a general-purpose thing to ship with micrscheme.

Putting the pin mappings in Menelaus makes plenty of sense, and it would open this up to being used on other non-Arudino chips.

technomancy avatar Jun 06 '21 21:06 technomancy