Skip to main content

Keyboard Host Configuration

Select the button labels to be displayed in the usage guide:

GP2040

Purpose: This add-on is intended to allow you to use a keyboard with GP2040-CE to be used with GP2040-CE supported systems.

GP2040-CE Configurator - Keyboard Host Configuration

Web Configurator Options

GPIO Pin Assignment

The Data, 5V Enable, and Pin Orientation options for USB host ports are now configured in Configuration > Peripheral Mapping - USB Host.

Default Keybindings

GP2040Key
UpArrow Up
DownArrow Down
LeftArrow Left
RightArrow Right
B1Shift Left
B2Z
B3Control Left
B4Alt Left
L1C
R1Space
L2V
R2X
S15
S21
L3Equal
R3Minus
A19
A2F2
FunctionNone

Hardware

Requirements

This add-on requires that you have a USB host port available on your device connected to GPIO pins on the RP2040 board. There are a number of methods to do so.

See USB Host Port Installation for more information on the requirements for adding a USB host port to your controller.

Installation

Example Wiring

note

While this example wiring guide uses a Raspberry Pi Pico, the general principle applies to ALL RP2040 based boards.

USB Host Wiring Diagram

  • VCC - Connects to 5V power (Example: VBUS on the Raspberry Pi Pico)
  • D+ - Connects to the D+ GPIO Pin above, set in the Web Configurator. (Example: GPIO0 on the Raspberry Pi Pico)
  • D- - Connects to the D- GPIO Pin above, automatically set based on D+. (Example: GPIO1 on the Raspberry Pi Pico)
  • GND - Connects to a ground pin, any GND pin will work. (Example: GND on the Raspberry Pi Pico)

note

For D+ and D-, any set of GPIO pins can be used from the RP2040. However, there is a requirement that D- GPIO must immediately precede or follow D+ (i.e. D+ = GPIO Pin X -> D- must be X+1 or X-1).

Miscellaneous Notes

As long as the keyboard has a USB plug, any keyboard should work with this addon, including wireless USB keyboards.

Due to current implementation of Pico-PIO-USB and the add-on system, the following limitations are present.

  • The keyboard is limited to only as many inputs as listed above. All other keys on the keyboard will not function and will send no inputs to the system reading inputs.
  • The keyboard is limited to 6 key rollover, meaning that a maximum of 6 keyboard keys can be activated at a time. This is the case regardless if the keyboard being used normally has N key rollover (NKRO).
  • The keyboard is unable to affect the Input Mode on boot. The Input Mode must either be set using Web Configurator > Settings or an additional switch on the GP2040-CE device using the add-on.