GithubHelp home page GithubHelp logo

univa / rumcake Goto Github PK

View Code? Open in Web Editor NEW
62.0 3.0 10.0 1.55 MB

A rust-based keyboard firmware

Home Page: https://univa.github.io/rumcake/

License: MIT License

Rust 100.00%
embassy keyberon mechanical-keyboard rust embedded-hal no-std keyboard

rumcake's People

Contributors

kuolemax avatar univa avatar zunixorn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rumcake's Issues

[Help] nrf-softdevice compile error

Hi,
I am trying to make an Analog macro pad using nice!nano clone board and while compiling i get this error message.

error: You must activate at least one of the following features: ble-central, ble-peripheral
 --> /home/snappy/.cargo/git/checkouts/nrf-softdevice-03ef4aef10e777e4/487f98e/nrf-softdevice/src/lib.rs:9:1
  |
9 | compile_error!("You must activate at least one of the following features: ble-central, ble-peripheral");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0599]: no variant or associated item named `Peripheral` found for enum `ble::types::Role` in the current scope
   --> /home/snappy/.cargo/git/checkouts/nrf-softdevice-03ef4aef10e777e4/487f98e/nrf-softdevice/src/ble/connection.rs:151:25
    |
151 |             role: Role::Peripheral,
    |                         ^^^^^^^^^^ variant or associated item not found in `Role`
    |
   ::: /home/snappy/.cargo/git/checkouts/nrf-softdevice-03ef4aef10e777e4/487f98e/nrf-softdevice/src/ble/types.rs:68:1
    |
68  | pub enum Role {
    | ------------- variant or associated item `Peripheral` not found for this enum
    |
note: if you're trying to build a new `ble::types::Role`, consider using `ble::types::Role::from_raw` which returns `ble::types::Role`
   --> /home/snappy/.cargo/git/checkouts/nrf-softdevice-03ef4aef10e777e4/487f98e/nrf-softdevice/src/ble/types.rs:76:5
    |
76  |     pub fn from_raw(raw: u8) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0282]: type annotations needed
  --> /home/snappy/.cargo/git/checkouts/nrf-softdevice-03ef4aef10e777e4/487f98e/nrf-softdevice/src/ble/gap.rs:19:17
   |
19 |             let handled = match Role::from_raw(params.role) {
   |                 ^^^^^^^
...
25 |             if !handled {
   |                -------- type must be known at this point
   |
help: consider giving `handled` an explicit type
   |
19 |             let handled: /* Type */ = match Role::from_raw(params.role) {
   |                        ++++++++++++
   

repo: https://github.com/SnappierSoap318/macropad

Feature: Improve docs

Type of Feature Request

  • Enhancement to an existing rumcake feature
  • New feature unrelated to existing rumcake features
  • New driver for existing rumcake features
  • Support for a new MCU

Description

First of all thanks for putting this project together. I've been looking for an option to get things working for my latest keyboard, and this looks like the closest I've got.

My current keyboard is a ferris/sweep with one half with an ELITE-pi (aka an RP2040), and the other half is a nice!nano board. Both of these boards are connected via a wired connection on a TRRS cable. The reason this project seems like a great option is;

  1. I like rust and I typically do most my embedded development in rust
  2. QMK doesn't support Bluetooth
  3. ZMK supports Bluetooth but doesn't support a wired connection between split left/right.

This project seems to be the perfect fit, but after a few hours of reading through the source code I'm kind of stumped as to how all the pieces fit together. The documentation that is available it seems like it's very well written but there are some holes where docs could probably be better. I'm fully aware that writing docs can be quite dry and boring, so I'm just going to ask some questions and if you have time to respond I'll write them up into some docs as I go. Here are my questions;

Setting wired serial connection between split left/right

What are the parameters that I should be using with rumcake::hw::mcu::setup_buffered_uarte to implement the necessary settings for wired communication? Apart from the RX/TX pin args it's unclear what I should be using here. I've tried looking through the docs and source code in embassy, nrf-hal etc. But between all the macros and abstraction layer's I've kind of got a little lost. e.g. Here are one of the errors that I'm running into;

error: proc macro panicked
  --> src/right.rs:82:5
   |
82 |     setup_buffered_uarte!{UART0, TIMER1, PPI_CH1, PPI_CH2, PPI_GROUP0, P0_08, P0_06}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: message: proc-macro-error API cannot be used outside of `entry_point` invocation, perhaps you forgot to annotate your #[proc_macro] function with `

TBH I'm not even sure if the arguments I've used here even make sense. So it could be that I'm just using the macro completely incorrectly.

Setting up non-matrix type keyboard pinouts

In the case that there is 1-gpio-pin per key, what should I be doing with the layouts? It's not entirely clear how to adapt the layout for non-diode-matrix keyboards.

License changes

Early on in the history of this repo, I threw on the MIT license. Looking back in retrospect, and looking forward about the potential directions of this project, I realize that MIT may not be the most appropriate choice for all parts of this repository.

I plan on changing parts of this repository (if not all) over to GPLv3 for two main reasons:

  • I want to respect the licensing of any referenced code from other GPL projects
  • I want to use crates that are licensed under GPL (which would enable us to support some GPL-licensed drivers)

That being said, I'm opening this issue for discussion on potential ways forward, as well as getting the appropriate permissions from other developers to handle code that might be affected by these changes. I will also be trying to get in contact with people I believe to be copyright holders for some relevant code.

Some possible solutions I thought of:

  • Changing the license for the entire repo to be GPLv3
  • Moving certain parts of the codebase into their own separately GPL-licensed crates (like Via/Vial, Lighting, and the drivers), while keeping the core rumcake crate under MIT
    • I foresee this introducing some technical challenges, and may have effects on usability.

Other potential concerns:

  • Licensing of older commits in git history

Compile error when compiling for split keyboard without additional features

Description of the issue

When compiling for a split keyboard and not having any of the "simple-backlight", "simple-backlight-matrix", "rgb-backlight-matrix", "underglow" features enabled, I get a the following compile error:

error[E0084]: unsupported representation for zero-variant enum
  --> rumcake/rumcake/src/split/mod.rs:49:1
   |
49 | #[repr(u8)]
   | ^^^^^^^^^^^
50 | pub enum MessageToPeripheral {
   | ---------------------------- zero-variant enum

Two possible fixes I thought of, would be either wrapping the repr(u8) on MessageToPeripheral in a cfg_attr:

#[cfg_attr(any(
    feature = "simple-backlight", 
    feature = "simple-backlight-matrix", 
    feature = "rgb-backlight-matrix", 
    feature = "underglow"
), repr(u8))]

or by adding a dummy variant to the enum, so it always has at least one variant, regardless enabled of features.

Hardware

Shouldn't work with other MCUs either, but in this case I tested it on an RP2040 and nRF52840 (split-template)

Version of rumcake used

0.1.0 (a73d77b)

Minimum Reproducible Example

You can just use the split example and change the rev of rumcake to a73d77b

How to Reproduce

  1. use split example
  2. change the rev of rumcake to a73d77b
  3. compile
  4. observe compile error

Expected Behaviour

compile without errors when not specifying any additional features

[Help] Compile error when bulding Analog matrix

Hi, i am getting an error message when i try to compile an analog matrix

$ cargo build --release
   Compiling rumcake-macropad v0.1.0 (/mnt/d/Coding/PROJECTS/Macropad/macropad)
error: unknown field encountered.
  --> src/main.rs:28:17
   |
28 |     (interrupt: ADC1_2, adc: ADC2) => {
   |                 ^^^^^^

error[E0412]: cannot find type `AdcSamplerType` in this scope
   --> src/main.rs:43:5
    |
43  | /     build_analog_matrix! {
44  | |         channels: {
45  | |             [(0, 0) (0, 1) (0, 2) (0, 3)]
46  | |             [(1, 0) (1, 1) (1, 2) (1, 3)]
...   |
55  | |         }
56  | |     }
    | |     ^
    | |     |
    | |_____not found in this scope
    |       in this macro invocation
    |
   ::: /home/snappy/.cargo/git/checkouts/rumcake-f831d65ecf4877c1/3ef4990/rumcake-macros/src/lib.rs:179:1
    |
179 |   #[proc_macro_error]
    |   ------------------- in this expansion of `build_analog_matrix!`

error[E0423]: expected function, found macro `setup_adc_sampler`
   --> src/main.rs:13:1
    |
13  | / #[keyboard(
14  | |     usb,
15  | |     bluetooth
16  | | )]
    | |  ^
    | |  |
    | |__not a function
    |    in this procedural macro expansion
    |
   ::: /home/snappy/.cargo/git/checkouts/rumcake-f831d65ecf4877c1/3ef4990/rumcake-macros/src/lib.rs:147:1
    |
147 |   #[proc_macro_error]
    |   ------------------- in this expansion of `#[keyboard]`
    |
help: use `!` to invoke the macro
    |
16  | )]!
    |   +

error[E0423]: expected function, found macro `setup_adc_sampler`
   --> src/main.rs:43:5
    |
43  | /     build_analog_matrix! {
44  | |         channels: {
45  | |             [(0, 0) (0, 1) (0, 2) (0, 3)]
46  | |             [(1, 0) (1, 1) (1, 2) (1, 3)]
...   |
55  | |         }
56  | |     }
    | |     ^
    | |     |
    | |_____not a function
    |       in this macro invocation
    |
   ::: /home/snappy/.cargo/git/checkouts/rumcake-f831d65ecf4877c1/3ef4990/rumcake-macros/src/lib.rs:179:1
    |
179 |   #[proc_macro_error]
    |   ------------------- in this expansion of `build_analog_matrix!`
    |
help: use `!` to invoke the macro
    |
56  |     }!
    |      +

I am not sure about the errors that are popping up.

edit: adding project repo https://github.com/SnappierSoap318/macropad

Feature: Support wired split keyboard

Type of Feature Request

  • Enhancement to an existing rumcake feature
  • New feature unrelated to existing rumcake features
  • New driver for existing rumcake features
  • Support for a new MCU

Description

Many split keyboards use a TRRS cable to communicate between split keyboards. It would be great if there where some method to communicate between peripheral and central via a wired connection rather than just bluetooth.

Feature: Double-Tap reset button to Enter bootloader

Type of Feature Request

  • Enhancement to an existing rumcake feature
  • New feature unrelated to existing rumcake features
  • New driver for existing rumcake features
  • Support for a new MCU

Description

Hello, first of all, thank you for this amazing project. Now that there is RP2040 support, I really want to use this firmware for my Corne, instead of QMK.

In QMK there is an option to enter the UF2 Bootloader with a double-tap of the reset button. I use this feature, since my Corne PCB only exposes the reset button but not the boot button.

The feature is already implemented in my fork (here) and I could open a pull request if you are interested.

In my implementation, the feature is not exclusive to the RP2040 but can only really be used with it, since the other MCUs do not currently have an implemented jump_to_bootloader() function. I also am not sure what the best way is, to configure the timeout time, currently it can be change via an environment variable at compile-time

Feature: nice!view support

Type of Feature Request

  • Enhancement to an existing rumcake feature
  • New feature unrelated to existing rumcake features
  • New driver for existing rumcake features
  • Support for a new MCU

Description

Just found this while trying to figure out why my nice!nano wouldn't work with USB/BLE (I did get it to blink the LED and respond to a short to ground on a pin). While looking at the docs I noticed that the only display listed was the SSD1306.

I'm fairly new to building keyboards (just got sucked into it 2 weeks ago), so I haven't dived into all the specs. Feel free to close this issue if the SSD1306 driver is compatible with the nice!view.

I do have a pair of nice!view's that I can test with, but I believe I saw that I can't use the uf2 flashing method with rumcake (I did manage it with my LED example, but not anything more complex). So I'll have to wait to test it until I get some jumper cables (should be arriving in the mail tomorrow EST) :)

Thanks for making this! โค๏ธ

I was also planning to add joystick support to my board. Specifically for this guy, so I might look into adding that here if there's interest (I'll make a new issue once I figure out the details involved).

add touchpad support

Type of Feature Request

  • Enhancement to an existing rumcake feature
  • New feature unrelated to existing rumcake features
  • New driver for existing rumcake features
  • Support for a new MCU

Description

the eskarp keyboard uses a rust based firmware with a touchpad driver that could be ported to rumcake with a little effort. i may try getting this working for a personal project but wanted to put this out there for others to try as well.

How to contribute?

Hello, I have just found this amazing project and I would like to know how to contribute, as well as which tasks are being done and which ones are left, in order to organize my contribution a little bit ๐Ÿ˜ƒ

Feature: Single code for splited keyboards

Type of Feature Request

  • Enhancement to an existing rumcake feature
  • New feature unrelated to existing rumcake features
  • New driver for existing rumcake features
  • Support for a new MCU

Description

It would be nice if we could have only a single source (and binary) for both sides, by recognizing which side is left or right and which one is central or peripheral via a provided function from the user. I come from KMK and there the side is usually gathered by

  • reading the label of the fat32 partition (on devices that can provide one, like rp2040)
  • checking a couple of fiscally bridged pins as marker of the right side.

and for the central, the presence of USB connection makes it act as such, or else it falls back to being a peripheral.

`Keybow2040` device won't compile, gives unsatisfied trait bound for `embedded_hal_async::i2c::I2c`

Description of the issue

If you use the Keybow2040 device, it fails on compilation with:

note: the following trait bounds were not satisfied:
      `<I2C as embedded_hal_async::i2c::ErrorType>::Error = _`
      `I2C: I2c`

I've submitted a PR to address this

Hardware

I'm actually using Univa/is31fl3731 directly from an RP2040 board (Keybow 2040) - at the moment I'm just doing some messing around to get a basic keyboard running so I'm not using rumcake itself, but I'd like to try out using more of it as I go.

Version of rumcake used

I'm using the same is31fl3731 crate as current rumcake main, with:

is31fl3731 = { git = "https://github.com/Univa/is31fl3731", features = ["async", "keybow_2040"] }

Minimum Reproducible Example

You just need to set up a matrix using Keybow2040 to see the error, my code on RP2040 is as follows:

    let p = embassy_rp::init(Default::default());

    let sda = p.PIN_4;
    let scl = p.PIN_5;

    info!("set up i2c ");
    let i2c = i2c::I2c::new_async(p.I2C0, scl, sda, Irqs, i2c::Config::default());

    // Create LED matrix driver
    let mut matrix = Keybow2040::configure(i2c);

How to Reproduce

  1. Set up a matrix using Keybow2040
  2. Run cargo build

Expected Behaviour

Code compiles.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.