Skip to content

Exergist/Adafruit-MacroPad-RP2040

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Adafruit MacroPad RP2040

image

What Is This?

This project includes QMK files for various keymaps for the Adafruit MacroPad RP2040, which includes 12 RGB LED key switches, a pressable rotary encoder, an OLED screen, and audio output capability.

Key Maps

Layout

image

UltraKvmpSwitch

Configuration for simultaneously controlling the ATEN CS62KM KM switch as well as the ATEN CS1824 and CS1924 KVMP switches.

  • The MacroPad connects to the CS62KM, which is then connected to both the CS1824 and CS1924
  • This enables the MacroPad to control both the CS1824 and CS1924 by using the CS62KM as an intermediary
  • Note that the ATEN CS62KM does not support media keys (see below Keymap), so the MacroPad cannot change the computer volume when it is connected using the CS62KM

Jump to the files here.

Keymap
  • OLED Screen = Displays configuration information
  • Encoder (ENCODER_DANCE)
    • Single-Tap = Illuminate keys and populate OLED screen to show the current configuration for the CS1924 KVMP switch
    • Press-Hold = Illuminate key and populate OLED screen to show the current configuration for the CS1824 KVMP switch
    • Clockwise Rotation = Volume Up
    • Counter-Clockwise Rotation = Volume Down
  • Button1 (PORT1_DANCE)
    • Single-Tap = Change to port 1 on the CS1924
    • Press-Hold = Change to port 1 on the CS1824
  • Button2 (PORT2_DANCE)
    • Single-Tap = Change to port 2 on the CS1924
    • Press-Hold = Change to port 2 on the CS1824
  • Button3 (PORT3_DANCE)
    • Single-Tap = Change to port 3 on the CS1924
    • Press-Hold = Change to port 3 on the CS1824
  • Button4 (KVM_1) = Change KVM focus on the CS1924 to port 1
  • Button5 (KVM_2) = Change KVM focus on the CS1924 to port 2
  • Button6 (KVM_3) = Change KVM focus on the CS1924 to port 3
  • Button7 (USB_1) = Change USB hub focus on the CS1924 to port 1
  • Button8 (USB_2) = Change USB hub focus on the CS1924 to port 2
  • Button9 (USB_3) = Change USB hub focus on the CS1924 to port 3
  • Button10 (AUDIO_1) = Change Audio focus on the CS1924 to port 1
  • Button11 (AUDIO_2) = Change Audio focus on the CS1924 to port 2
  • Button12 (AUDIO_3) = Change Audio focus on the CS1924 to port 3

SuperKvmpSwitch

Configuration for the ATEN CS1924 or CS1824 KVMP switch.

  • The MacroPad connects directly to the CS1924 or CS1824 KVMP switch

Jump to the files here.

Keymap
  • OLED Screen = Displays configuration information
  • Encoder
    • Single-Tap = PORT_CHECK = Illuminate keys and populate OLED screen to show the current configuration for the CS1824/CS1924
    • Clockwise Rotation = Volume Up
    • Counter-Clockwise Rotation = Volume Down
  • Button1 (PORT_1) = Change to port 1 on the CS1824/CS1924
  • Button2 (PORT_2) = Change to port 2 on the CS1824/CS1924
  • Button3 (PORT_3) = Change to port 3 on the CS1824/CS1924
  • Button4 (KVM_1) = Change KVM focus on the CS1824/CS1924 to port 1
  • Button5 (KVM_2) = Change KVM focus on the CS1824/CS1924 to port 2
  • Button6 (KVM_3) = Change KVM focus on the CS1824/CS1924 to port 3
  • Button7 (USB_1) = Change USB hub focus on the CS1824/CS1924 to port 1
  • Button8 (USB_2) = Change USB hub focus on the CS1824/CS1924 to port 2
  • Button9 (USB_3) = Change USB hub focus on the CS1824/CS1924 to port 3
  • Button10 (AUDIO_1) = Change Audio focus on the CS1824/CS1924 to port 1
  • Button11 (AUDIO_2) = Change Audio focus on the CS1824/CS1924 to port 2
  • Button12 (AUDIO_3) = Change Audio focus on the CS1824/CS1924 to port 3

How to Build and Install the Firmware?

Creating the Firmware

QMK Configurator Method
  1. Load the MacroPad RP2040 default configuration in the QMK Configurator.

  2. Select the functions for the buttons and click compile.

    image
  3. Once the compiling is complete, download and save the firmware uf2 file.

QMK Code-Only Method (Recommended)
General
  1. Go through The QMK Tutorial. To get started, create a new keymap project within QMK MSYS environment by running qmk new-keymap -kb [keyboard name] -km [name of project]
    • Example: qmk new-keymap -kb adafruit/macropad -km UltraKvmpSwitch
  2. Create the desired keyboard behavior by building content in the keymap.c file.
  3. Add (or copy from other QMK MacroPad RP2040 efforts) config.h and rules.mk files if needed (most likely YES) into the same location as the keymap.c file.
  4. When keymap.c and (if applicable) config.h and rules.mk are ready, go back to QMK MSYS and run qmk compile -j 0 -kb [keyboard name] -km [name of project].
    • Example: qmk compile -j 0 -kb adafruit/macropad -km UltraKvmpSwitch
  5. The outputted firmware (uf2 file) is located at ...qmk_firmware\.build\[keyboard_name]_[project_name].uf2
    • Example: ...qmk_firmware\.build\adafruit_macropad_UltraKvmpSwitch.uf2
Creating Images for the OLED Screen
  1. Create an image (such as a *.png) you want to display on the OLED screen. Note that for best results the image should have white foreground coloring and black background coloring.
  2. Convert the image to a C byte array using a tool such as image2cpp. Here are some detailed instructions when using image2cpp:
    • The "Canvas Size" is the extent of the image as displayed on the OLED screen. Ideally the canvas width and height are multiples of 8 (e.g., 32x32, 64x64).
    • Background Color = Black
    • Dithering = Binary (though other types will likely work fine)
    • Brightness/Alpha Threshold = 128
    • Scaling = Scale to fit, keeping proportions
    • Center Image = Horizontally and Vertically
    • Code Output Format = Plain bytes
    • Draw Mode = Vertical - 1 bit per pixel
  3. The image2cpp tool provides a preview of what the image will look like for the provided Canvas Size.
  4. Press the "Generate code" button, and a byte array corresponding to the preview image will be created.
  5. Leverage this created byte array in the keymap.c file (see Source for example usage).
CircuitPython Method

Adafruit provides a comprehensive guide that walks through using CircuitPython to build firmware for the MacroPad RP2040. Note that this project currently focuses on using QMK for building the firmware.

Installing the Firmware

Firmware Drag-and-Drop Method
  1. Plug the Adafruit MacroPad RP2040 into the computer.

  2. Press and hold down on the encoder, and then press the reset button (located to the left of the OLED screen on the side of the board).

    image
  3. The MacroPad should enter bootloader mode and a new USB storage device called RPI-RP2 should be available on the computer.

  4. Drag and drop the desired firmware uf2 file into the RPI-RP2 device.

  5. The MacroPad should auto-restart and launch with the new firmware.

Notes

  • My MacroPad RP2040 was ordered through Adafruit in December 2021
  • Additional MacroPad RP2040 resources may be found on Adafruit's website
  • Additional QMK resources are compiled in the QMK Syllabus

Acknowledgements

  • QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community (and Hasu)
  • Keymap header ASCII art by patorjk
  • ForsakenRei for his RP2040-MacroPad project, which was a useful reference
  • "Laptop" image created by Dong Gyu Yang from Noun Project

About

Source, firmware, and related files for Adafruit Macropad projects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published