Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c2ca00074 | ||
|
|
594558ec7b | ||
|
|
5e1b1f5023 | ||
|
|
cc567c917b | ||
|
|
81cc69c2dd | ||
|
|
0fde9c9cac | ||
|
|
5bb7476400 | ||
|
|
6242c09f7d | ||
|
|
eb5703d12e | ||
|
|
bb2ca21647 | ||
|
|
ed343ddad4 | ||
|
|
e7ad19bb95 | ||
|
|
024c4ef853 | ||
|
|
00eebfb575 | ||
|
|
22b213e191 | ||
|
|
8522449ccf | ||
|
|
cbeab2ac4f | ||
|
|
aa5a6d38de | ||
|
|
a1096e1dec | ||
|
|
a9739f7868 | ||
|
|
a5fb7cfbc9 | ||
|
|
62d87fa446 | ||
|
|
8e5550dbb2 | ||
|
|
f4123acc72 | ||
|
|
98e65cf3e1 | ||
|
|
7d0fc5d486 | ||
|
|
1c1e8d7f7a |
2
.github/workflows/api.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
if: github.repository == 'qmk/qmk_firmware'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
persist-credentials: false
|
||||
|
||||
2
.github/workflows/auto_tag.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
if: github.repository == 'qmk/qmk_firmware'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
251
.github/workflows/bootstrap_testing.yml
vendored
Normal file
@@ -0,0 +1,251 @@
|
||||
name: Bootstrap Script Testing
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [bootstrap]
|
||||
paths:
|
||||
- "util/env-bootstrap.sh"
|
||||
- ".github/workflows/bootstrap_testing.yml"
|
||||
- "lib/python/**"
|
||||
pull_request:
|
||||
branches: [master, develop, xap]
|
||||
paths:
|
||||
- "util/env-bootstrap.sh"
|
||||
- ".github/workflows/bootstrap_testing.yml"
|
||||
- "lib/python/**"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
bootstrap-test-linux:
|
||||
name: Bootstrap (Linux)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distribution:
|
||||
# Ubuntu/Debian based
|
||||
- debian:11
|
||||
- debian:12
|
||||
- debian:13
|
||||
- ubuntu:20.04
|
||||
- ubuntu:22.04
|
||||
- ubuntu:24.04
|
||||
|
||||
# RHEL/CentOS/Fedora based
|
||||
- fedora:41
|
||||
- fedora:42
|
||||
- fedora:43
|
||||
- rockylinux:8
|
||||
- rockylinux:9
|
||||
- rockylinux/rockylinux:10
|
||||
- almalinux:8
|
||||
- almalinux:9
|
||||
- almalinux:10
|
||||
|
||||
# OpenSUSE based (we skip Tumbleweed as it has issues with package versions between pattern installs and other dependencies preinstalled into the base container)
|
||||
- opensuse/leap:latest
|
||||
|
||||
# Gentoo-based
|
||||
- gentoo/stage3:latest
|
||||
|
||||
# Arch based
|
||||
- archlinux:latest
|
||||
- cachyos/cachyos:latest
|
||||
- manjarolinux/base:latest
|
||||
|
||||
container:
|
||||
image: ${{ matrix.distribution }}
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Install base dependencies
|
||||
run: |
|
||||
# Attempt to run the package installation up to 10 times to mitigate transient network issues
|
||||
for n in $(seq 1 10); do
|
||||
{
|
||||
echo "Attempt #$n of 10 to install base dependencies:"
|
||||
case "${{ matrix.distribution }}" in
|
||||
*ubuntu*|*debian*)
|
||||
apt-get update
|
||||
apt-get install -y sudo git passwd
|
||||
;;
|
||||
*fedora*|*rockylinux*|*almalinux*)
|
||||
dnf install -y sudo git passwd findutils # findutils=xargs
|
||||
;;
|
||||
*suse*)
|
||||
zypper --non-interactive refresh
|
||||
zypper --non-interactive install sudo git shadow findutils # findutils=xargs
|
||||
;;
|
||||
*gentoo*)
|
||||
emerge-webrsync
|
||||
emerge --noreplace --ask=n sudo dev-vcs/git shadow findutils # findutils=xargs
|
||||
;;
|
||||
*archlinux*|*cachyos*|*manjaro*)
|
||||
pacman -Syu --noconfirm
|
||||
pacman -S --noconfirm sudo git
|
||||
;;
|
||||
esac
|
||||
} && break || sleep 10
|
||||
done
|
||||
|
||||
# Fix PAM configuration for sudo in containers
|
||||
# Fix /etc/shadow permissions - common issue in container environments
|
||||
chmod 640 /etc/shadow || chmod 400 /etc/shadow || true
|
||||
|
||||
# Disable problematic PAM modules that commonly fail in RHEL-like containers
|
||||
sed -i 's/^session.*pam_systemd.so/#&/' /etc/pam.d/sudo || true
|
||||
sed -i 's/^session.*pam_loginuid.so/#&/' /etc/pam.d/sudo || true
|
||||
|
||||
# Ensure proper sudoers configuration
|
||||
echo 'Defaults !requiretty' >> /etc/sudoers
|
||||
echo 'Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"' >> /etc/sudoers
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: recursive
|
||||
path: qmk_firmware
|
||||
|
||||
- name: Create test user
|
||||
run: |
|
||||
# Create a test user for the bootstrap script
|
||||
useradd -m -s /bin/bash -U testuser
|
||||
echo 'testuser:testpassword' | chpasswd || true
|
||||
|
||||
# Configure passwordless sudo
|
||||
echo "root ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers # some distros complain about root not being in sudoers
|
||||
echo "testuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
||||
|
||||
# Test sudo functionality
|
||||
sudo -u testuser whoami || echo "Sudo test failed, but continuing..."
|
||||
|
||||
- name: Move QMK repository to test user home
|
||||
run: |
|
||||
# Add upstream remote to the cloned repository so `qmk doctor` doesn't flag a warning
|
||||
git -C qmk_firmware remote add upstream https://github.com/qmk/qmk_firmware.git
|
||||
# Move the QMK repository to the test user's home directory
|
||||
mv qmk_firmware /home/testuser/qmk_firmware
|
||||
chown -R testuser:testuser /home/testuser/qmk_firmware
|
||||
|
||||
- name: Run bootstrap script
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Ensure the bootstrap script can access sudo
|
||||
sudo -u testuser --preserve-env=GITHUB_TOKEN bash -c "
|
||||
export CONFIRM=1
|
||||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
cd /home/testuser
|
||||
bash /home/testuser/qmk_firmware/util/env-bootstrap.sh
|
||||
"
|
||||
|
||||
- name: Test QMK CLI
|
||||
run: |
|
||||
sudo -u testuser bash -c "
|
||||
export PATH=/home/testuser/.local/bin:\$PATH
|
||||
cd /home/testuser
|
||||
qmk setup -y -H /home/testuser/qmk_firmware # setup implies doctor, no need to run it separately
|
||||
cd /home/testuser/qmk_firmware
|
||||
qmk mass-compile -j $(nproc) -e DUMP_CI_METADATA=yes -f 'keyboard_name==*onekey*' -km reset -p || touch .failed # Compile a bunch of different platforms
|
||||
"
|
||||
|
||||
cd /home/testuser/qmk_firmware
|
||||
./util/ci/generate_failure_markdown.sh > $GITHUB_STEP_SUMMARY || true
|
||||
[ ! -e .failed ] || exit 1
|
||||
|
||||
bootstrap-test-macos:
|
||||
name: Bootstrap (macOS)
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- macos-13 # Intel x64
|
||||
- macos-14 # Apple Silicon ARM64
|
||||
- macos-15 # Apple Silicon ARM64
|
||||
- macos-15-intel # Intel x64
|
||||
- macos-26 # Apple Silicon ARM64
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: recursive
|
||||
|
||||
- name: Run bootstrap script
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Add upstream remote to the cloned repository so `qmk doctor` doesn't flag a warning
|
||||
git remote add upstream https://github.com/qmk/qmk_firmware.git
|
||||
# Run the bootstrap script
|
||||
export CONFIRM=1
|
||||
sh ./util/env-bootstrap.sh
|
||||
|
||||
- name: Test QMK CLI
|
||||
run: |
|
||||
# Add QMK CLI to PATH (bootstrap script installs it to ~/.local/bin on macOS)
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
qmk setup -y -H . # setup implies doctor, no need to run it separately
|
||||
qmk mass-compile -j $(sysctl -n hw.ncpu) -e DUMP_CI_METADATA=yes -f 'keyboard_name==*onekey*' -km reset || touch .failed # Compile a bunch of different platforms
|
||||
|
||||
./util/ci/generate_failure_markdown.sh > $GITHUB_STEP_SUMMARY || true
|
||||
[ ! -e .failed ] || exit 1
|
||||
|
||||
bootstrap-test-windows:
|
||||
name: Bootstrap (Windows)
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
msys-variant:
|
||||
- mingw64
|
||||
- clang64
|
||||
- ucrt64
|
||||
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
|
||||
steps:
|
||||
- name: Install MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.msys-variant }}
|
||||
pacboy: >-
|
||||
git:
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: recursive
|
||||
|
||||
- name: Run bootstrap script
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Add upstream remote to the cloned repository so `qmk doctor` doesn't flag a warning
|
||||
git remote add upstream https://github.com/qmk/qmk_firmware.git
|
||||
# Run the bootstrap script
|
||||
export CONFIRM=1
|
||||
sh ./util/env-bootstrap.sh
|
||||
|
||||
- name: Test QMK CLI
|
||||
run: |
|
||||
# Add QMK CLI to PATH (bootstrap script installs it to /opt/uv/tools/bin on Windows MSYS2)
|
||||
export PATH="/opt/uv/tools/bin:$PATH"
|
||||
qmk setup -y -H . # setup implies doctor, no need to run it separately
|
||||
qmk mass-compile -j $(nproc) -e DUMP_CI_METADATA=yes -f 'keyboard_name==*onekey*' -km reset || touch .failed # Compile a bunch of different platforms
|
||||
|
||||
./util/ci/generate_failure_markdown.sh > $GITHUB_STEP_SUMMARY || true
|
||||
[ ! -e .failed ] || exit 1
|
||||
|
||||
6
.github/workflows/ci_build_major_branch.yml
vendored
@@ -45,7 +45,7 @@ jobs:
|
||||
git config --global --add safe.directory '*'
|
||||
|
||||
- name: Checkout QMK Firmware
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Determine concurrency
|
||||
id: generate_slice_length
|
||||
@@ -82,12 +82,12 @@ jobs:
|
||||
git config --global --add safe.directory '*'
|
||||
|
||||
- name: Checkout QMK Firmware
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Download firmwares
|
||||
uses: actions/download-artifact@v5
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
pattern: firmware-*
|
||||
path: .
|
||||
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
git config --global --add safe.directory '*'
|
||||
|
||||
- name: Checkout QMK Firmware
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Generate build targets
|
||||
id: generate_targets
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
echo "targets=$(jq -c 'keys' targets.json)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload targets json
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: targets-${{ inputs.keymap }}
|
||||
path: targets.json
|
||||
@@ -89,10 +89,10 @@ jobs:
|
||||
git config --global --add safe.directory '*'
|
||||
|
||||
- name: Checkout QMK Firmware
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Get target definitions
|
||||
uses: actions/download-artifact@v5
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: targets-${{ inputs.keymap }}
|
||||
path: .
|
||||
@@ -112,7 +112,7 @@ jobs:
|
||||
qmk mass-compile -t -j $NCPUS -e DUMP_CI_METADATA=yes $(jq -r '.["${{ matrix.target }}"].targets' targets.json) || touch .failed
|
||||
|
||||
- name: Upload binaries
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: firmware-${{ inputs.keymap }}-${{ matrix.target }}
|
||||
if-no-files-found: ignore
|
||||
@@ -136,17 +136,17 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout QMK Firmware
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Download firmwares
|
||||
uses: actions/download-artifact@v5
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
pattern: firmware-${{ inputs.keymap }}-*
|
||||
path: .
|
||||
merge-multiple: true
|
||||
|
||||
- name: Upload all firmwares
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: firmware-${{ inputs.keymap }}
|
||||
if-no-files-found: ignore
|
||||
|
||||
2
.github/workflows/cli.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
- name: Disable safe.directory check
|
||||
run : git config --global --add safe.directory '*'
|
||||
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
|
||||
2
.github/workflows/develop_update.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
if: github.repository == 'qmk/qmk_firmware'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
token: ${{ secrets.QMK_BOT_TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
4
.github/workflows/docs.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
||||
container: ghcr.io/qmk/qmk_cli
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
|
||||
- name: Deploy
|
||||
if: ${{ github.event_name == 'push' && github.repository == 'qmk/qmk_firmware' }}
|
||||
uses: JamesIves/github-pages-deploy-action@v4.7.3
|
||||
uses: JamesIves/github-pages-deploy-action@v4.7.4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: gh-pages
|
||||
|
||||
2
.github/workflows/feature_branch_update.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
- riot
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
token: ${{ secrets.QMK_BOT_TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
2
.github/workflows/format.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
- name: Disable safe.directory check
|
||||
run : git config --global --add safe.directory '*'
|
||||
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
2
.github/workflows/format_push.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
- name: Disable safe.directory check
|
||||
run : git config --global --add safe.directory '*'
|
||||
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
2
.github/workflows/lint.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
- name: Disable safe.directory check
|
||||
run : git config --global --add safe.directory '*'
|
||||
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
2
.github/workflows/regen.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
- name: Disable safe.directory check
|
||||
run : git config --global --add safe.directory '*'
|
||||
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Run qmk generators
|
||||
run: |
|
||||
|
||||
2
.github/workflows/regen_push.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
- name: Disable safe.directory check
|
||||
run : git config --global --add safe.directory '*'
|
||||
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Run qmk generators
|
||||
run: |
|
||||
|
||||
2
.github/workflows/unit_test.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
container: ghcr.io/qmk/qmk_cli
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install dependencies
|
||||
|
||||
5
.gitignore
vendored
@@ -95,6 +95,11 @@ tags
|
||||
*.mpeg
|
||||
*.ttf
|
||||
*.otf
|
||||
# Un-ignore limited image file formats in docs
|
||||
!docs/public/**.gif
|
||||
!docs/public/**.jpg
|
||||
!docs/public/**.jpeg
|
||||
!docs/public/**.png
|
||||
|
||||
# Things Travis sees
|
||||
/.vs
|
||||
|
||||
@@ -4,7 +4,7 @@ QMK presents itself to the host as a regular HID keyboard device, and as such re
|
||||
|
||||
There are two notable exceptions: the Caterina bootloader, usually seen on Pro Micros, and the HalfKay bootloader shipped with PJRC Teensys, appear as a serial port and a generic HID device respectively, and so do not require a driver.
|
||||
|
||||
We recommend the use of the [Zadig](https://zadig.akeo.ie/) utility. If you have set up the development environment with MSYS2, the `qmk_install.sh` script will have already installed the drivers for you.
|
||||
We recommend the use of the [Zadig](https://zadig.akeo.ie/) utility. If you have set up the development environment with MSYS2, the QMK CLI installation script will have already installed the drivers for you.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -22,7 +22,7 @@ If Zadig lists one or more devices with the `HidUsb` driver, your keyboard is pr
|
||||
|
||||
If the arrow appears green, select the driver, and click **Install Driver**. See the [list of known bootloaders](#list-of-known-bootloaders) for the correct driver to install.
|
||||
|
||||

|
||||

|
||||
|
||||
Finally, unplug and replug the keyboard to make sure the new driver has been loaded. If you are using the QMK Toolbox to flash, exit and restart it too, as it can sometimes fail to recognize the driver change.
|
||||
|
||||
@@ -30,15 +30,15 @@ Finally, unplug and replug the keyboard to make sure the new driver has been loa
|
||||
|
||||
If you find that you can no longer type with the keyboard, you may have accidentally replaced the driver for the keyboard itself instead of for the bootloader. This can happen when the keyboard is not in the bootloader mode. You can easily confirm this in Zadig - a healthy keyboard has the `HidUsb` driver installed on all of its interfaces:
|
||||
|
||||

|
||||

|
||||
|
||||
Open the Device Manager, select **View → Devices by container**, and look for an entry with your keyboard's name.
|
||||
|
||||

|
||||

|
||||
|
||||
Right-click each entry and hit **Uninstall device**. Make sure to tick **Delete the driver software for this device** first if it appears.
|
||||
|
||||

|
||||

|
||||
|
||||
Click **Action → Scan for hardware changes**. At this point, you should be able to type again. Double check in Zadig that the keyboard device(s) are using the `HidUsb` driver. If so, you're all done, and your board should be functional again! Otherwise, repeat this process until Zadig reports the correct driver.
|
||||
|
||||
@@ -54,11 +54,11 @@ Open the Device Manager, select **View → Devices by container**, and look for
|
||||
|
||||
Find the `Inf name` value in the Details tab of the device properties. This should generally be something like `oemXX.inf`:
|
||||
|
||||

|
||||

|
||||
|
||||
Then, open a new Command Prompt window as an Administrator (type in `cmd` into the Start menu and press Ctrl+Shift+Enter). Run `pnputil /enum-drivers` to verify the `Inf name` matches the `Published Name` field of one of the entries:
|
||||
|
||||

|
||||

|
||||
|
||||
Run `pnputil /delete-driver oemXX.inf /uninstall`. This will delete the driver and remove it from any devices using it. Note that this will not uninstall the device itself.
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ As its name implies Direct Pin works by connecting one switch per pin. The other
|
||||
|
||||
Here is a schematic showing how we connect a single button to pin A3 on a ProMicro:
|
||||
|
||||

|
||||

|
||||
|
||||
Once you have wired your switches you can assign keycodes to each pin and build a firmware by selecting the MCU you are using from the Keyboard dropdown. Use this link to show only Easy Maker Direct Pin:
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ Pro Micro (Atmega32u4), make sure to include `CONFIG_USB_ACM=y`. Other devices m
|
||||
|
||||
Issues encountered when flashing keyboards on Windows are most often due to having the wrong drivers installed for the bootloader, or none at all.
|
||||
|
||||
Re-running the QMK installation script (`./util/qmk_install.sh` from the `qmk_firmware` directory in MSYS2 or WSL) or reinstalling the QMK Toolbox may fix the issue. Alternatively, you can download and run the [`qmk_driver_installer`](https://github.com/qmk/qmk_driver_installer) package manually.
|
||||
Re-running the QMK installation script (`curl -fsSL https://install.qmk.fm | sh`) or reinstalling the QMK Toolbox may fix the issue. Alternatively, you can download and run the [`qmk_driver_installer`](https://github.com/qmk/qmk_driver_installer) package manually.
|
||||
|
||||
If that doesn't work, then you may need to download and run Zadig. See [Bootloader Driver Installation with Zadig](driver_installation_zadig) for more detailed information.
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ Keycodes are actually defined in [quantum/keycode.h](https://github.com/qmk/qmk_
|
||||
There are 3 standard keyboard layouts in use around the world- ANSI, ISO, and JIS. North America primarily uses ANSI, Europe and Africa primarily use ISO, and Japan uses JIS. Regions not mentioned typically use either ANSI or ISO. The keycodes corresponding to these layouts are shown here:
|
||||
|
||||
<!-- Source for this image: https://www.keyboard-layout-editor.com/#/gists/bf431647d1001cff5eff20ae55621e9a -->
|
||||

|
||||

|
||||
|
||||
## How Can I Make Custom Names For Complex Keycodes?
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ The feature maintains a small buffer of recent key presses. On each key press, i
|
||||
|
||||
The tricky part is how to efficiently check the buffer for typos. We don’t want to spend too much memory or time on storing or searching the typos. A good solution is to represent the typos with a trie data structure. A trie is a tree data structure where each node is a letter, and words are formed by following a path to one of the leaves.
|
||||
|
||||

|
||||

|
||||
|
||||
Since we search whether the buffer ends in a typo, we store the trie writing in reverse. The trie is queried starting from the last letter, then second to last letter, and so on, until either a letter doesn’t match or we reach a leaf, meaning a typo was found.
|
||||
|
||||
@@ -279,7 +279,7 @@ All autocorrection data is stored in a single flat array autocorrect_data. Each
|
||||
* 01 ⇒ branching node: a trie node with multiple children.
|
||||
* 10 ⇒ leaf node: a leaf, corresponding to a typo and storing its correction.
|
||||
|
||||

|
||||

|
||||
|
||||
**Branching node**. Each branch is encoded with one byte for the keycode (KC_A–KC_Z) followed by a link to the child node. Links between nodes are 16-bit byte offsets relative to the beginning of the array, serialized in little endian order.
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ In this typical example, the backlight LEDs are all connected in parallel toward
|
||||
A pulldown resistor is also placed between the gate pin and ground to keep it at a defined state when it is not otherwise being driven by the MCU.
|
||||
The values of these resistors are not critical - see [this Electronics StackExchange question](https://electronics.stackexchange.com/q/68748) for more information.
|
||||
|
||||

|
||||

|
||||
|
||||
## API {#api}
|
||||
|
||||
|
||||
@@ -35,12 +35,12 @@ layer.
|
||||
|
||||
Consider a keymap with the following base layer.
|
||||
|
||||

|
||||

|
||||
|
||||
The highlighted key is a momentary layer switch `MO(NAV)`. Holding it accesses a
|
||||
navigation layer.
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
Holding the NAV key is fine for brief use, but awkward to continue holding when
|
||||
|
||||
@@ -55,7 +55,7 @@ Changing the **Hue** cycles around the circle.<br>
|
||||
Changing the **Saturation** moves between the inner and outer sections of the wheel, affecting the intensity of the color.<br>
|
||||
Changing the **Value** sets the overall brightness.<br>
|
||||
|
||||

|
||||

|
||||
|
||||
## Keycodes
|
||||
|
||||
|
||||
@@ -91,11 +91,11 @@ SPLIT_TRANSPORT = custom
|
||||
|
||||
Configuring your layout in a split keyboard works slightly differently to a non-split keyboard. Take for example the following layout. The top left numbers refer to the matrix row and column, and the bottom right are the order of the keys in the layout:
|
||||
|
||||

|
||||

|
||||
|
||||
Since the matrix scanning procedure operates on entire rows, it first populates the left half's rows, then the right half's. Thus, the matrix as QMK views it has double the rows instead of double the columns:
|
||||
|
||||

|
||||

|
||||
|
||||
### Setting Handedness
|
||||
|
||||
@@ -497,7 +497,7 @@ Once you have done that, you will want to solder the diode from the 5V pad to th
|
||||
|
||||
You may need to use the 5V pad from the regulator block above as the pads were too small and placed too closely together to place the Schottky diode properly.
|
||||
|
||||

|
||||

|
||||
|
||||
## Additional Resources
|
||||
|
||||
|
||||
@@ -8,15 +8,15 @@ This guide assumes you're somewhat comfortable with running things at the comman
|
||||
|
||||
Start on the [QMK GitHub page](https://github.com/qmk/qmk_firmware), and you'll see a button in the upper right that says "Fork":
|
||||
|
||||

|
||||

|
||||
|
||||
If you're a part of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button:
|
||||
|
||||

|
||||

|
||||
|
||||
And be sure to select "HTTPS", and select the link and copy it:
|
||||
|
||||

|
||||

|
||||
|
||||
From here, enter `git clone --recurse-submodules ` into the command line, and then paste your link:
|
||||
|
||||
@@ -57,10 +57,10 @@ To https://github.com/whoeveryouare/qmk_firmware.git
|
||||
|
||||
Your changes now exist on your fork on GitHub - if you go back there (`https://github.com/<whoeveryouare>/qmk_firmware`), you can create a "New Pull Request" by clicking this button:
|
||||
|
||||

|
||||

|
||||
|
||||
Here you'll be able to see exactly what you've committed - if it all looks good, you can finalize it by clicking "Create Pull Request":
|
||||
|
||||

|
||||

|
||||
|
||||
After submitting, we may talk to you about your changes, ask that you make changes, and eventually accept it! Thanks for contributing to QMK :)
|
||||
|
||||
@@ -36,12 +36,12 @@ What you want to achieve is one leg from each switch being attached to the corre
|
||||
|
||||
It is fairly simple to plan for an ortholinear keyboard (like a Planck).
|
||||
|
||||

|
||||

|
||||
Image from [RoastPotatoes' "How to hand wire a Planck"](https://blog.roastpotatoes.co/guide/2015/11/04/how-to-handwire-a-planck/)
|
||||
|
||||
But the larger and more complicated your keyboard, the more complex the matrix. [Keyboard Firmware Builder](https://kbfirmware.com/) can help you plan your matrix layout (shown here with a basic fullsize ISO keyboard imported from [Keyboard Layout Editor](https://www.keyboard-layout-editor.com).
|
||||
|
||||

|
||||

|
||||
|
||||
Bear in mind that the number of rows plus the number of columns can not exceed the number of I/O pins on your controller. So the fullsize matrix shown above would be possible on a Proton C or Teensy++, but not on a regular Teensy or Pro Micro.
|
||||
|
||||
@@ -51,14 +51,14 @@ Bear in mind that the number of rows plus the number of columns can not exceed t
|
||||
| :------------ |:-------------:| ------:| ------ |
|
||||
| Pro Micro* | ATmega32u4 | 20 | [link](https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/hardware-overview-pro-micro#Teensy++_2.0) |
|
||||
| Teensy 2.0 | ATmega32u4 | 25 | [link](https://www.pjrc.com/teensy/pinout.html) |
|
||||
| [QMK Proton C](https://qmk.fm/proton-c/) | STM32F303xC | 36 | [link 1](https://i.imgur.com/RhtrAlc.png), [2](https://deskthority.net/wiki/QMK_Proton_C) |
|
||||
| [QMK Proton C](https://qmk.fm/proton-c/) | STM32F303xC | 36 | [link 1](https://qmk.fm/proton-c-pinout.jpg), [2](https://deskthority.net/wiki/QMK_Proton_C) |
|
||||
| Teensy++ 2.0 | AT90USB1286 | 46 | [link](https://www.pjrc.com/teensy/pinout.html#Teensy_2.0) |
|
||||
|
||||
*Elite C is essentially the same as a Pro Micro with a USB-C instead of Micro-USB
|
||||
|
||||
There are also a number of boards designed specifically for handwiring that mount directly to a small number of switches and offer pinouts for the rest. Though these are generally more expensive and may be more difficult to get hold of.
|
||||
|
||||
<img src="https://i.imgur.com/QiA3ta6.jpg" alt="Postage board mini mounted in place" width="500"/>
|
||||
<img src="/QiA3ta6.jpg" alt="Postage board mini mounted in place" width="500"/>
|
||||
|
||||
| Board | Controller | # I/O |
|
||||
| :------------ |:-------------:| ------:|
|
||||
@@ -74,13 +74,13 @@ Established materials and techniques include:
|
||||
|
||||
| Technique | Examples | Pros | Cons | Image
|
||||
| :-----------| :------- | :------ | :--- | :---
|
||||
| Lengths of wire with stripped segments | [Sasha Solomon's Dactyl](https://medium.com/@sachee/building-my-first-keyboard-and-you-can-too-512c0f8a4c5f) and [Cribbit's modern hand wire](https://geekhack.org/index.php?topic=87689.0) | Neat and tidy | Some effort in stripping the wire | 
|
||||
| Short lengths of wire | [u/xicolinguada's ortho build](https://www.reddit.com/r/MechanicalKeyboards/comments/c39k4f/my_first_hand_wired_keyboard_its_not_perfect_but/) | Easier to strip the wire | More difficult to place | 
|
||||
| Magnet/Enamelled wire | [fknraiden's custom board](https://geekhack.org/index.php?topic=74223.0) | Can be directly soldered onto (insulation burns off with heat) | Appearance? | 
|
||||
| Bending the legs of the diodes for the rows | [Matt3o's Brownfox](https://deskthority.net/viewtopic.php?f=7&t=6050) | Fewer solder joints required | Uninsulated | 
|
||||
| Using rigid wiring (e.g. brass tube) | [u/d_stilgar's invisible hardline](https://www.reddit.com/r/MechanicalKeyboards/comments/8aw5j2/invisible_hardline_keyboard_progress_update_april/) and [u/jonasfasler's first attempt](https://www.reddit.com/r/MechanicalKeyboards/comments/de1jyv/my_first_attempt_at_handwiring_a_keyboard/) | Very pretty | More difficult. No physical insulation | 
|
||||
| Bare wire with insulation added after (e.g. kapton tape) | [Matt3o's 65% on his website](https://matt3o.com/hand-wiring-a-custom-keyboard/) | Easier (no wire stripping required) | Not as attractive | 
|
||||
| Copper tape | [ManuForm Dactyl](https://github.com/tshort/dactyl-keyboard) | Very easy | Only really works when your plate/case aligns with the bottom of your switches | 
|
||||
| Lengths of wire with stripped segments | [Sasha Solomon's Dactyl](https://medium.com/@sachee/building-my-first-keyboard-and-you-can-too-512c0f8a4c5f) and [Cribbit's modern hand wire](https://geekhack.org/index.php?topic=87689.0) | Neat and tidy | Some effort in stripping the wire | 
|
||||
| Short lengths of wire | [u/xicolinguada's ortho build](https://www.reddit.com/r/MechanicalKeyboards/comments/c39k4f/my_first_hand_wired_keyboard_its_not_perfect_but/) | Easier to strip the wire | More difficult to place | 
|
||||
| Magnet/Enamelled wire | [fknraiden's custom board](https://geekhack.org/index.php?topic=74223.0) | Can be directly soldered onto (insulation burns off with heat) | Appearance? | 
|
||||
| Bending the legs of the diodes for the rows | [Matt3o's Brownfox](https://deskthority.net/viewtopic.php?f=7&t=6050) | Fewer solder joints required | Uninsulated | 
|
||||
| Using rigid wiring (e.g. brass tube) | [u/d_stilgar's invisible hardline](https://www.reddit.com/r/MechanicalKeyboards/comments/8aw5j2/invisible_hardline_keyboard_progress_update_april/) and [u/jonasfasler's first attempt](https://www.reddit.com/r/MechanicalKeyboards/comments/de1jyv/my_first_attempt_at_handwiring_a_keyboard/) | Very pretty | More difficult. No physical insulation | 
|
||||
| Bare wire with insulation added after (e.g. kapton tape) | [Matt3o's 65% on his website](https://matt3o.com/hand-wiring-a-custom-keyboard/) | Easier (no wire stripping required) | Not as attractive | 
|
||||
| Copper tape | [ManuForm Dactyl](https://github.com/tshort/dactyl-keyboard) | Very easy | Only really works when your plate/case aligns with the bottom of your switches | 
|
||||
|
||||
|
||||
Note that these methods can be combined. Prepare your lengths of wire before moving on to soldering.
|
||||
@@ -97,11 +97,11 @@ There are a lot of soldering guides and tips available elsewhere but here are so
|
||||
|
||||
To ensure a strong solder joint you want a good amount of contact between the solder and the two pieces of metal you are connecting. A good way of doing this (though not required) is looping around pins or twisting wires together before applying solder.
|
||||
|
||||
<img src="https://i.imgur.com/eHJjmnU.jpg" alt="Looped around rod" width="200"/> <img src="https://i.imgur.com/8nbxmmr.jpg?1" alt="Looped diode leg" width="200"/>
|
||||
<img src="/eHJjmnU.jpg" alt="Looped around rod" width="400"/>
|
||||
|
||||
If your diodes are on a packaging strip and need a bend in them (either the start of a loop or for connecting to its neighbour) this can easily done by bending it over something straight like the edge of a box, table, or ruler. This also helps keep track of the direction of the diode as all the bends will be on the same side.
|
||||
|
||||
<img src="https://i.imgur.com/oITudbX.jpg" alt="Bent diode legs" width="200"/>
|
||||
<img src="/oITudbX.jpg" alt="Bent diode legs" width="400"/>
|
||||
|
||||
If your iron has temperature control, set it to 315ºC (600ºF).
|
||||
|
||||
@@ -164,7 +164,7 @@ Cut wires to the length of the distance from the a point on each column/row to t
|
||||
|
||||
Ribbon cable can be used to keep this extra tidy. You may also want to consider routing the wires beneath the existing columns/rows.
|
||||
|
||||
<img src="https://i.imgur.com/z2QlKfB.jpg" alt="Ribbon Cable" width="350"/>
|
||||
<img src="/z2QlKfB.jpg" alt="Ribbon Cable" width="600"/>
|
||||
|
||||
As you solder the wires to the controller make a note of which row/column is going to which pin on the controller as we'll use this data to setup the matrix when we create the firmware.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# QMK Configurator
|
||||
|
||||
[](https://config.qmk.fm/)
|
||||
[](https://config.qmk.fm/)
|
||||
|
||||
The [QMK Configurator](https://config.qmk.fm) is an online graphical user interface that generates QMK Firmware `.hex` or `.bin` files.
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@ Building locally has a much shorter turnaround time than waiting for GitHub Acti
|
||||
|
||||
A basic skeleton External Userspace repository can be found [here](https://github.com/qmk/qmk_userspace). If you wish to keep your keymaps on GitHub (strongly recommended!), you can fork the repository and use it as a base:
|
||||
|
||||

|
||||

|
||||
|
||||
Going ahead with your fork will copy it to your account, at which point you can clone it to your local machine and begin adding your keymaps:
|
||||
|
||||

|
||||

|
||||
|
||||
```sh
|
||||
cd $HOME
|
||||
@@ -99,8 +99,8 @@ All firmware builds you've added to the External Userspace build targets will be
|
||||
|
||||
GitHub Actions can be used to automatically build your keymaps whenever you push changes to your External Userspace repository. If you have set up your list of build targets, this is as simple as enabling workflows in the GitHub repository settings:
|
||||
|
||||

|
||||

|
||||
|
||||
Any push will result in compilation of all configured builds, and once completed a new release containing the newly-minted firmware files will be created on GitHub, which you can subsequently download and flash to your keyboard:
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -50,90 +50,64 @@ You will need to install [MSYS2](https://www.msys2.org). Once installed, close a
|
||||
Install the QMK CLI by running:
|
||||
|
||||
```sh
|
||||
pacman --needed --noconfirm --disable-download-timeout -S git mingw-w64-x86_64-python-qmk
|
||||
curl -fsSL https://install.qmk.fm | sh
|
||||
```
|
||||
|
||||
::::
|
||||
|
||||
==== macOS
|
||||
|
||||
QMK maintains a Homebrew tap and formula which will automatically install the CLI and all necessary dependencies.
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
You will need to install Homebrew. Follow the instructions on https://brew.sh.
|
||||
|
||||
::: tip
|
||||
If you are using an Apple Silicon machine, the installation process will take significantly longer because GitHub actions do not have native runners to build binary packages for the ARM and AVR toolchains.
|
||||
:::
|
||||
|
||||
#### Installation
|
||||
|
||||
Install the QMK CLI by running:
|
||||
|
||||
```sh
|
||||
brew install qmk/qmk/qmk
|
||||
curl -fsSL https://install.qmk.fm | sh
|
||||
```
|
||||
|
||||
==== Linux/WSL
|
||||
|
||||
#### Installation
|
||||
|
||||
::: info
|
||||
Many Linux distributions are supported, but not all. Mainstream distributions will have best success -- if possible, choose either Debian or its derivatives (such as Ubuntu, or Mint), CentOS or its derivatives (such as Fedora, or Rocky Linux), and Arch or its derivatives (such as Manjaro, or CachyOS).
|
||||
:::
|
||||
|
||||
Install the QMK CLI by running:
|
||||
|
||||
```sh
|
||||
curl -fsSL https://install.qmk.fm | sh
|
||||
```
|
||||
|
||||
::: tip
|
||||
**Note for WSL users**: By default, the installation process will clone the QMK repository into your WSL home directory, but if you have cloned manually, ensure that it is located inside the WSL instance instead of the Windows filesystem (ie. not in `/mnt`), as accessing it is currently [extremely slow](https://github.com/microsoft/WSL/issues/4197).
|
||||
:::
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
You will need to install Git and Python. It's very likely that you already have both, but if not, one of the following commands should install them:
|
||||
|
||||
* Debian / Ubuntu / Devuan: `sudo apt install -y git python3-pip`
|
||||
* Fedora / Red Hat / CentOS: `sudo yum -y install git python3-pip`
|
||||
* Arch / Manjaro: `sudo pacman --needed --noconfirm -S git python-pip libffi`
|
||||
* Void: `sudo xbps-install -y git python3-pip`
|
||||
* Solus: `sudo eopkg -y install git python3`
|
||||
* Sabayon: `sudo equo install dev-vcs/git dev-python/pip`
|
||||
* Gentoo: `sudo emerge dev-vcs/git dev-python/pip`
|
||||
|
||||
#### Installation
|
||||
|
||||
Install the QMK CLI by running:
|
||||
|
||||
```sh
|
||||
python3 -m pip install --user qmk
|
||||
```
|
||||
|
||||
Alternatively, install the QMK CLI as a [uv](https://docs.astral.sh/uv/) managed tool, kept isolated in a virtual environment (requires uv to be installed):
|
||||
|
||||
```sh
|
||||
uv tool install qmk
|
||||
```
|
||||
|
||||
#### Community Packages
|
||||
|
||||
These packages are maintained by community members, so may not be up to date or completely functional. If you encounter problems, please report them to their respective maintainers.
|
||||
|
||||
On Arch-based distros you can install the CLI from the official repositories (NOTE: at the time of writing this package marks some dependencies as optional that should not be):
|
||||
|
||||
```sh
|
||||
sudo pacman -S qmk
|
||||
```
|
||||
|
||||
You can also try the `qmk-git` package from AUR:
|
||||
|
||||
```sh
|
||||
yay -S qmk-git
|
||||
```
|
||||
::: warning
|
||||
Any QMK packages provided by your distribution's package manager are almost certainly out of date. It is strongly suggested the installation script above is used instead.
|
||||
:::
|
||||
|
||||
==== FreeBSD
|
||||
|
||||
#### Installation
|
||||
|
||||
::: warning
|
||||
FreeBSD support is provided on a best-effort basis by the community instead of the QMK maintainers. It is strongly suggested that you use either Windows, macOS, or a supported distribution of Linux instead.
|
||||
:::
|
||||
|
||||
Install the FreeBSD package for QMK CLI by running:
|
||||
|
||||
```sh
|
||||
pkg install -g "py*-qmk"
|
||||
```
|
||||
|
||||
NOTE: remember to follow the instructions printed at the end of installation (use `pkg info -Dg "py*-qmk"` to show them again).
|
||||
::: info NOTE
|
||||
Remember to follow the instructions printed at the end of installation (use `pkg info -Dg "py*-qmk"` to show them again).
|
||||
:::
|
||||
|
||||
:::::
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ Once both plugins are installed, restart Eclipse as prompted.
|
||||
* Select the _AVR-GCC Toolchain_;
|
||||
* Keep the rest as-is and click <kbd>Finish</kbd>
|
||||
|
||||

|
||||

|
||||
|
||||
3. The project will now be loaded and indexed. Its files can be browsed easily through the _Project Explorer_ on the left.
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ You'll need to perform some modifications to the file above in order to target y
|
||||
* `"armToolchainPath"`: _[Optional]_ The path to the ARM toolchain installation location on Windows -- under normal circumstances Linux/macOS will auto-detect this correctly and will not need to be specified.
|
||||
|
||||
::: warning
|
||||
Windows builds of QMK Firmware are generally compiled using QMK MSYS, and the path to gdb's location (`C:\\QMK_MSYS\\mingw64\\bin`) needs to be specified under `armToolchainPath` for it to be detected. You may also need to change the GDB path to point at `C:\\QMK_MSYS\\mingw64\\bin\\gdb-multiarch.exe` in the VSCode Cortex-Debug user settings: 
|
||||
Windows builds of QMK Firmware are generally compiled using QMK MSYS, and the path to gdb's location (`C:\\QMK_MSYS\\mingw64\\bin`) needs to be specified under `armToolchainPath` for it to be detected. You may also need to change the GDB path to point at `C:\\QMK_MSYS\\mingw64\\bin\\gdb-multiarch.exe` in the VSCode Cortex-Debug user settings: 
|
||||
:::
|
||||
|
||||
The following modifications must be made to the keyboard's `rules.mk` file to enable debug information and disable optimisations -- this will ensure breakpoints and variable viewing works correctly:
|
||||
|
||||
@@ -7,7 +7,7 @@ The WeAct Blackpill is a popular choice for handwired boards, as it offers a pow
|
||||
* [WeAct GitHub for F4x1 Blackpill](https://github.com/WeActStudio/WeActStudio.MiniSTM32F4x1)
|
||||
* Unfortunately, due to supply issues official WeAct F411 based blackpills may not be available.
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## Pin Usage Limitations
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
The Proton C is an Arm STM32F303xC based drop-in replacement for the Pro Micro.
|
||||
|
||||
<img src="https://i.imgur.com/GdsN1Rdh.jpg" alt="Proton C" />
|
||||
<img src="https://qmk.fm/proton-c.jpg" alt="Proton C" width="800"/>
|
||||
|
||||
#### Features
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ The following table shows the current driver status for peripherals on RP2040 MC
|
||||
|
||||
## GPIO
|
||||
|
||||
<img alt="Raspberry Pi Pico pinout" src="https://i.imgur.com/nLaiYDE.jpg" width="48%"/>
|
||||
<img alt="Sparkfun RP2040 Pro Micro pinout" src="https://i.imgur.com/1TPAhrs.jpg" width="48%"/>
|
||||
<img alt="Raspberry Pi Pico pinout" src="/nLaiYDE.jpg" width="48%"/>
|
||||
<img alt="Sparkfun RP2040 Pro Micro pinout" src="/1TPAhrs.jpg" width="48%"/>
|
||||
|
||||
::: warning
|
||||
The GPIO pins of the RP2040 are not 5V tolerant!
|
||||
|
||||
BIN
docs/public/0GNIYY0.jpg
Normal file
|
After Width: | Height: | Size: 95 KiB |
BIN
docs/public/1TPAhrs.jpg
Normal file
|
After Width: | Height: | Size: 115 KiB |
BIN
docs/public/2wUZNWk.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
docs/public/3RrSjzW.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
docs/public/4wjJzBU.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
docs/public/5wsh5wM.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
docs/public/8Toomz4.jpg
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
docs/public/AvXZShD.jpg
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
docs/public/BPEC5n5.jpg
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
docs/public/BmAvoUC.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
docs/public/Bu4mk9m.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
docs/public/CWYmsk8.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
docs/public/CnASmPo.jpg
Normal file
|
After Width: | Height: | Size: 282 KiB |
BIN
docs/public/DkEhj9x.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
docs/public/DxMHpJ8.jpg
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
docs/public/EGrPM1L.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
docs/public/EVkxOt1.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
docs/public/FRShcLD.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
docs/public/HL5DP8H.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
docs/public/Hx0E5kC.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
docs/public/JKngtTw.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
docs/public/JcDhZll.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
docs/public/N1NYcSz.jpg
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
docs/public/Ojydlaj.jpg
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
docs/public/QeY6kMQ.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
docs/public/QiA3ta6.jpg
Normal file
|
After Width: | Height: | Size: 160 KiB |
BIN
docs/public/RFyNMlL.jpg
Normal file
|
After Width: | Height: | Size: 163 KiB |
BIN
docs/public/UlJ4ZDP.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
docs/public/aEs2RuA.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
docs/public/aTnG8TV.jpg
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
docs/public/anw9cOL.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
docs/public/b4b7KDb.jpg
Normal file
|
After Width: | Height: | Size: 281 KiB |
BIN
docs/public/b8VgXzx.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
docs/public/eGO0ohO.jpg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
docs/public/eHJjmnU.jpg
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
docs/public/fmDvDzR.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
docs/public/hcegguh.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
docs/public/mBe5vkL.jpg
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
docs/public/nCgeolTh.png
Normal file
|
After Width: | Height: | Size: 197 KiB |
BIN
docs/public/nLaiYDE.jpg
Normal file
|
After Width: | Height: | Size: 217 KiB |
BIN
docs/public/o7WLvBl.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
docs/public/oHYR1yW.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
docs/public/oITudbX.jpg
Normal file
|
After Width: | Height: | Size: 434 KiB |
BIN
docs/public/vkYVo66.jpg
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
docs/public/z2QlKfB.jpg
Normal file
|
After Width: | Height: | Size: 255 KiB |
BIN
docs/public/zmwOL5P.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
@@ -189,15 +189,25 @@ Currently, the Configurator does not support key rotation or non-rectangular key
|
||||
|
||||
For ISO Enter keys, QMK custom is to display it as a rectangular key, 1.25u wide and 2u high, aligned so its right edge is aligned with the right edge of the alphanumeric key block.
|
||||
|
||||

|
||||

|
||||
*A 60% keyboard in standard ISO layout, as rendered by QMK Configurator.*
|
||||
|
||||
#### Vertically-offset keys
|
||||
|
||||
For vertically-offset keys, place them in KLE as if they were not offset, then edit the Y-values as needed in the converted JSON file
|
||||
|
||||

|
||||

|
||||
*An 1800-layout keyboard as rendered in Keyboard Layout Editor, without the vertical offset applied to the arrow keys.*
|
||||
|
||||

|
||||
*A Unix diff file, showing the changes needed to vertically-offset the arrow keys in our keyboard's JSON file.*
|
||||
```diff
|
||||
-{"label": "\u2191", "x", 14.25, "y": 5},
|
||||
+{"label": "\u2191", "x", 14.25, "y": 5.25},
|
||||
...
|
||||
-{"label": "\u2190", "x", 13.25, "y": 6},
|
||||
-{"label": "\u2193", "x", 14.25, "y": 6},
|
||||
-{"label": "\u2192", "x", 15.25, "y": 6},
|
||||
+{"label": "\u2190", "x", 13.25, "y": 6.25},
|
||||
+{"label": "\u2193", "x", 14.25, "y": 6.25},
|
||||
+{"label": "\u2192", "x", 15.25, "y": 6.25},
|
||||
```
|
||||
*A diff showing the changes needed to vertically-offset the arrow keys in our keyboard's JSON file.*
|
||||
|
||||
@@ -51,7 +51,7 @@ Matrix Scanning runs many times per second. The exact rate varies but typically
|
||||
|
||||
Once we know the state of every switch on our keyboard we have to map that to a keycode. In QMK this is done by making use of C macros to allow us to separate the definition of the physical layout from the definition of keycodes.
|
||||
|
||||
At the keyboard level we define a C macro (typically named `LAYOUT()`) which maps our keyboard's matrix to physical keys. Sometimes the matrix does not have a switch in every location, and we can use this macro to pre-populate those with KC_NO, making the keymap definition easier to work with. Here's an example `LAYOUT()` macro for a numpad:
|
||||
At the keyboard level, QMK will generate a macro (typically named `LAYOUT()`) from our configuration file `info.json`, which then maps our keyboard's matrix to physical keys. Sometimes the matrix does not have a switch in every location, and QMK will use this macro to pre-populate those with KC_NO, making the keymap definition easier to work with. Here's an example `LAYOUT()` macro for a numpad:
|
||||
|
||||
```c
|
||||
#define LAYOUT( \
|
||||
@@ -71,7 +71,7 @@ At the keyboard level we define a C macro (typically named `LAYOUT()`) which map
|
||||
|
||||
Notice how the second block of our `LAYOUT()` macro matches the Matrix Scanning array above? This macro is what will map the matrix scanning array to keycodes. However, if you look at a 17 key numpad you'll notice that it has 3 places where the matrix could have a switch but doesn't, due to larger keys. We have populated those spaces with `KC_NO` so that our keymap definition doesn't have to.
|
||||
|
||||
You can also use this macro to handle unusual matrix layouts, for example the [Alice](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/keyboards/sneakbox/aliceclone/aliceclone.h#L24). Explaining that is outside the scope of this document.
|
||||
This macro can handle unusual matrix layouts, for example the [Alice](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/keyboards/sneakbox/aliceclone/aliceclone.h#L24). Explaining that is outside the scope of this document.
|
||||
|
||||
##### Keycode Assignment
|
||||
|
||||
|
||||
@@ -15,8 +15,9 @@ static bool dummy_comms_start(painter_device_t device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static void dummy_comms_stop(painter_device_t device) {
|
||||
static bool dummy_comms_stop(painter_device_t device) {
|
||||
// No-op.
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t dummy_comms_send(painter_device_t device, const void *data, uint32_t byte_count) {
|
||||
|
||||
@@ -35,7 +35,9 @@ uint32_t qp_comms_i2c_send_data(painter_device_t device, const void *data, uint3
|
||||
return qp_comms_i2c_send_raw(device, data, byte_count);
|
||||
}
|
||||
|
||||
void qp_comms_i2c_stop(painter_device_t device) {}
|
||||
bool qp_comms_i2c_stop(painter_device_t device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Command+Data I2C support
|
||||
@@ -43,9 +45,9 @@ void qp_comms_i2c_stop(painter_device_t device) {}
|
||||
static const uint8_t cmd_byte = 0x00;
|
||||
static const uint8_t data_byte = 0x40;
|
||||
|
||||
void qp_comms_i2c_cmddata_send_command(painter_device_t device, uint8_t cmd) {
|
||||
bool qp_comms_i2c_cmddata_send_command(painter_device_t device, uint8_t cmd) {
|
||||
uint8_t buf[2] = {cmd_byte, cmd};
|
||||
qp_comms_i2c_send_raw(device, &buf, 2);
|
||||
return qp_comms_i2c_send_raw(device, &buf, 2);
|
||||
}
|
||||
|
||||
uint32_t qp_comms_i2c_cmddata_send_data(painter_device_t device, const void *data, uint32_t byte_count) {
|
||||
@@ -58,7 +60,7 @@ uint32_t qp_comms_i2c_cmddata_send_data(painter_device_t device, const void *dat
|
||||
return byte_count;
|
||||
}
|
||||
|
||||
void qp_comms_i2c_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) {
|
||||
bool qp_comms_i2c_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) {
|
||||
uint8_t buf[32];
|
||||
for (size_t i = 0; i < sequence_len;) {
|
||||
uint8_t command = sequence[i];
|
||||
@@ -67,12 +69,17 @@ void qp_comms_i2c_bulk_command_sequence(painter_device_t device, const uint8_t *
|
||||
buf[0] = cmd_byte;
|
||||
buf[1] = command;
|
||||
memcpy(&buf[2], &sequence[i + 3], num_bytes);
|
||||
qp_comms_i2c_send_raw(device, buf, num_bytes + 2);
|
||||
if (!qp_comms_i2c_send_raw(device, buf, num_bytes + 2)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (delay > 0) {
|
||||
wait_ms(delay);
|
||||
}
|
||||
i += (3 + num_bytes);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const painter_comms_with_command_vtable_t i2c_comms_cmddata_vtable = {
|
||||
|
||||
@@ -19,7 +19,7 @@ typedef struct qp_comms_i2c_config_t {
|
||||
bool qp_comms_i2c_init(painter_device_t device);
|
||||
bool qp_comms_i2c_start(painter_device_t device);
|
||||
uint32_t qp_comms_i2c_send_data(painter_device_t device, const void* data, uint32_t byte_count);
|
||||
void qp_comms_i2c_stop(painter_device_t device);
|
||||
bool qp_comms_i2c_stop(painter_device_t device);
|
||||
|
||||
extern const painter_comms_with_command_vtable_t i2c_comms_cmddata_vtable;
|
||||
|
||||
|
||||
@@ -45,11 +45,12 @@ uint32_t qp_comms_spi_send_data(painter_device_t device, const void *data, uint3
|
||||
return byte_count - bytes_remaining;
|
||||
}
|
||||
|
||||
void qp_comms_spi_stop(painter_device_t device) {
|
||||
bool qp_comms_spi_stop(painter_device_t device) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_config_t *comms_config = (qp_comms_spi_config_t *)driver->comms_config;
|
||||
spi_stop();
|
||||
gpio_write_pin_high(comms_config->chip_select_pin);
|
||||
return true;
|
||||
}
|
||||
|
||||
const painter_comms_vtable_t spi_comms_vtable = {
|
||||
@@ -97,14 +98,15 @@ uint32_t qp_comms_spi_dc_reset_send_data(painter_device_t device, const void *da
|
||||
return qp_comms_spi_send_data(device, data, byte_count);
|
||||
}
|
||||
|
||||
void qp_comms_spi_dc_reset_send_command(painter_device_t device, uint8_t cmd) {
|
||||
bool qp_comms_spi_dc_reset_send_command(painter_device_t device, uint8_t cmd) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
|
||||
gpio_write_pin_low(comms_config->dc_pin);
|
||||
spi_write(cmd);
|
||||
return true;
|
||||
}
|
||||
|
||||
void qp_comms_spi_dc_reset_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) {
|
||||
bool qp_comms_spi_dc_reset_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
|
||||
for (size_t i = 0; i < sequence_len;) {
|
||||
@@ -126,6 +128,8 @@ void qp_comms_spi_dc_reset_bulk_command_sequence(painter_device_t device, const
|
||||
}
|
||||
i += (3 + num_bytes);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const painter_comms_with_command_vtable_t spi_comms_with_dc_vtable = {
|
||||
|
||||
@@ -22,7 +22,7 @@ typedef struct qp_comms_spi_config_t {
|
||||
bool qp_comms_spi_init(painter_device_t device);
|
||||
bool qp_comms_spi_start(painter_device_t device);
|
||||
uint32_t qp_comms_spi_send_data(painter_device_t device, const void* data, uint32_t byte_count);
|
||||
void qp_comms_spi_stop(painter_device_t device);
|
||||
bool qp_comms_spi_stop(painter_device_t device);
|
||||
|
||||
extern const painter_comms_vtable_t spi_comms_vtable;
|
||||
|
||||
@@ -39,9 +39,9 @@ typedef struct qp_comms_spi_dc_reset_config_t {
|
||||
} qp_comms_spi_dc_reset_config_t;
|
||||
|
||||
bool qp_comms_spi_dc_reset_init(painter_device_t device);
|
||||
void qp_comms_spi_dc_reset_send_command(painter_device_t device, uint8_t cmd);
|
||||
bool qp_comms_spi_dc_reset_send_command(painter_device_t device, uint8_t cmd);
|
||||
uint32_t qp_comms_spi_dc_reset_send_data(painter_device_t device, const void* data, uint32_t byte_count);
|
||||
void qp_comms_spi_dc_reset_bulk_command_sequence(painter_device_t device, const uint8_t* sequence, size_t sequence_len);
|
||||
bool qp_comms_spi_dc_reset_bulk_command_sequence(painter_device_t device, const uint8_t* sequence, size_t sequence_len);
|
||||
|
||||
extern const painter_comms_with_command_vtable_t spi_comms_with_dc_vtable;
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@ __attribute__((weak)) bool qp_gc9107_init(painter_device_t device, painter_rotat
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
qp_comms_bulk_command_sequence(device, gc9107_init_sequence, sizeof(gc9107_init_sequence));
|
||||
if (!qp_comms_bulk_command_sequence(device, gc9107_init_sequence, sizeof(gc9107_init_sequence))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Configure the rotation (i.e. the ordering and direction of memory writes in GRAM)
|
||||
const uint8_t madctl[] = {
|
||||
@@ -41,9 +43,7 @@ __attribute__((weak)) bool qp_gc9107_init(painter_device_t device, painter_rotat
|
||||
[QP_ROTATION_180] = GC9XXX_MADCTL_BGR | GC9XXX_MADCTL_MX | GC9XXX_MADCTL_MY,
|
||||
[QP_ROTATION_270] = GC9XXX_MADCTL_BGR | GC9XXX_MADCTL_MV | GC9XXX_MADCTL_MY,
|
||||
};
|
||||
qp_comms_command_databyte(device, GC9XXX_SET_MEM_ACS_CTL, madctl[rotation]);
|
||||
|
||||
return true;
|
||||
return qp_comms_command_databyte(device, GC9XXX_SET_MEM_ACS_CTL, madctl[rotation]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -45,7 +45,9 @@ __attribute__((weak)) bool qp_gc9a01_init(painter_device_t device, painter_rotat
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
qp_comms_bulk_command_sequence(device, gc9a01_init_sequence, sizeof(gc9a01_init_sequence));
|
||||
if (!qp_comms_bulk_command_sequence(device, gc9a01_init_sequence, sizeof(gc9a01_init_sequence))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Configure the rotation (i.e. the ordering and direction of memory writes in GRAM)
|
||||
const uint8_t madctl[] = {
|
||||
@@ -54,9 +56,7 @@ __attribute__((weak)) bool qp_gc9a01_init(painter_device_t device, painter_rotat
|
||||
[QP_ROTATION_180] = GC9XXX_MADCTL_BGR | GC9XXX_MADCTL_MX | GC9XXX_MADCTL_MY,
|
||||
[QP_ROTATION_270] = GC9XXX_MADCTL_BGR | GC9XXX_MADCTL_MV | GC9XXX_MADCTL_MY,
|
||||
};
|
||||
qp_comms_command_databyte(device, GC9XXX_SET_MEM_ACS_CTL, madctl[rotation]);
|
||||
|
||||
return true;
|
||||
return qp_comms_command_databyte(device, GC9XXX_SET_MEM_ACS_CTL, madctl[rotation]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -41,7 +41,9 @@ __attribute__((weak)) bool qp_ili9163_init(painter_device_t device, painter_rota
|
||||
ILI9XXX_CMD_DISPLAY_ON, 20, 0
|
||||
};
|
||||
// clang-format on
|
||||
qp_comms_bulk_command_sequence(device, ili9163_init_sequence, sizeof(ili9163_init_sequence));
|
||||
if (!qp_comms_bulk_command_sequence(device, ili9163_init_sequence, sizeof(ili9163_init_sequence))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Configure the rotation (i.e. the ordering and direction of memory writes in GRAM)
|
||||
const uint8_t madctl[] = {
|
||||
@@ -50,9 +52,7 @@ __attribute__((weak)) bool qp_ili9163_init(painter_device_t device, painter_rota
|
||||
[QP_ROTATION_180] = ILI9XXX_MADCTL_BGR | ILI9XXX_MADCTL_MX | ILI9XXX_MADCTL_MY,
|
||||
[QP_ROTATION_270] = ILI9XXX_MADCTL_BGR | ILI9XXX_MADCTL_MV | ILI9XXX_MADCTL_MY,
|
||||
};
|
||||
qp_comms_command_databyte(device, ILI9XXX_SET_MEM_ACS_CTL, madctl[rotation]);
|
||||
|
||||
return true;
|
||||
return qp_comms_command_databyte(device, ILI9XXX_SET_MEM_ACS_CTL, madctl[rotation]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -48,7 +48,9 @@ __attribute__((weak)) bool qp_ili9341_init(painter_device_t device, painter_rota
|
||||
ILI9XXX_CMD_DISPLAY_ON, 20, 0
|
||||
};
|
||||
// clang-format on
|
||||
qp_comms_bulk_command_sequence(device, ili9341_init_sequence, sizeof(ili9341_init_sequence));
|
||||
if (!qp_comms_bulk_command_sequence(device, ili9341_init_sequence, sizeof(ili9341_init_sequence))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Configure the rotation (i.e. the ordering and direction of memory writes in GRAM)
|
||||
const uint8_t madctl[] = {
|
||||
@@ -57,9 +59,7 @@ __attribute__((weak)) bool qp_ili9341_init(painter_device_t device, painter_rota
|
||||
[QP_ROTATION_180] = ILI9XXX_MADCTL_BGR | ILI9XXX_MADCTL_MX | ILI9XXX_MADCTL_MY,
|
||||
[QP_ROTATION_270] = ILI9XXX_MADCTL_BGR | ILI9XXX_MADCTL_MV | ILI9XXX_MADCTL_MY,
|
||||
};
|
||||
qp_comms_command_databyte(device, ILI9XXX_SET_MEM_ACS_CTL, madctl[rotation]);
|
||||
|
||||
return true;
|
||||
return qp_comms_command_databyte(device, ILI9XXX_SET_MEM_ACS_CTL, madctl[rotation]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -37,7 +37,9 @@ bool qp_ili9486_init(painter_device_t device, painter_rotation_t rotation) {
|
||||
ILI9XXX_SET_INVERSION_CTL, 0, 1, 0x02,
|
||||
};
|
||||
// clang-format on
|
||||
qp_comms_bulk_command_sequence(device, ili9486_init_sequence, sizeof(ili9486_init_sequence));
|
||||
if (!qp_comms_bulk_command_sequence(device, ili9486_init_sequence, sizeof(ili9486_init_sequence))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Configure the rotation (i.e. the ordering and direction of memory writes in GRAM)
|
||||
const uint8_t madctl[] = {
|
||||
@@ -62,22 +64,22 @@ bool qp_ili9486_init(painter_device_t device, painter_rotation_t rotation) {
|
||||
ILI9XXX_CMD_DISPLAY_ON, 5, 0,
|
||||
};
|
||||
// clang-format on
|
||||
qp_comms_bulk_command_sequence(device, rotation_sequence, sizeof(rotation_sequence));
|
||||
|
||||
return true;
|
||||
return qp_comms_bulk_command_sequence(device, rotation_sequence, sizeof(rotation_sequence));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Driver vtable
|
||||
|
||||
// waveshare variant needs some tweaks due to shift registers
|
||||
static void qp_comms_spi_dc_reset_send_command_odd_cs_pulse(painter_device_t device, uint8_t cmd) {
|
||||
static bool qp_comms_spi_dc_reset_send_command_odd_cs_pulse(painter_device_t device, uint8_t cmd) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
|
||||
|
||||
gpio_write_pin_low(comms_config->spi_config.chip_select_pin);
|
||||
qp_comms_spi_dc_reset_send_command(device, cmd);
|
||||
gpio_write_pin_high(comms_config->spi_config.chip_select_pin);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static uint32_t qp_comms_spi_send_data_odd_cs_pulse(painter_device_t device, const void *data, uint32_t byte_count) {
|
||||
@@ -124,7 +126,7 @@ static uint32_t qp_ili9486_send_data_toggling(painter_device_t device, const uin
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void qp_comms_spi_send_command_sequence_odd_cs_pulse(painter_device_t device, const uint8_t *sequence, size_t sequence_len) {
|
||||
static bool qp_comms_spi_send_command_sequence_odd_cs_pulse(painter_device_t device, const uint8_t *sequence, size_t sequence_len) {
|
||||
for (size_t i = 0; i < sequence_len;) {
|
||||
uint8_t command = sequence[i];
|
||||
uint8_t delay = sequence[i + 1];
|
||||
@@ -140,6 +142,8 @@ static void qp_comms_spi_send_command_sequence_odd_cs_pulse(painter_device_t dev
|
||||
}
|
||||
i += (3 + num_bytes);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool qp_ili9486_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) {
|
||||
|
||||
@@ -41,7 +41,9 @@ __attribute__((weak)) bool qp_ili9488_init(painter_device_t device, painter_rota
|
||||
ILI9XXX_CMD_DISPLAY_ON, 20, 0
|
||||
};
|
||||
// clang-format on
|
||||
qp_comms_bulk_command_sequence(device, ili9488_init_sequence, sizeof(ili9488_init_sequence));
|
||||
if (!qp_comms_bulk_command_sequence(device, ili9488_init_sequence, sizeof(ili9488_init_sequence))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Configure the rotation (i.e. the ordering and direction of memory writes in GRAM)
|
||||
const uint8_t madctl[] = {
|
||||
@@ -50,9 +52,7 @@ __attribute__((weak)) bool qp_ili9488_init(painter_device_t device, painter_rota
|
||||
[QP_ROTATION_180] = ILI9XXX_MADCTL_BGR | ILI9XXX_MADCTL_MX,
|
||||
[QP_ROTATION_270] = ILI9XXX_MADCTL_BGR | ILI9XXX_MADCTL_MV,
|
||||
};
|
||||
qp_comms_command_databyte(device, ILI9XXX_SET_MEM_ACS_CTL, madctl[rotation]);
|
||||
|
||||
return true;
|
||||
return qp_comms_command_databyte(device, ILI9XXX_SET_MEM_ACS_CTL, madctl[rotation]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "qp_surface.h"
|
||||
#include "qp_surface_internal.h"
|
||||
|
||||
typedef void (*ld7032_driver_comms_send_command_and_data_func)(painter_device_t device, uint8_t cmd, uint8_t data);
|
||||
typedef bool (*ld7032_driver_comms_send_command_and_data_func)(painter_device_t device, uint8_t cmd, uint8_t data);
|
||||
typedef uint32_t (*ld7032_driver_comms_send_command_and_databuf_func)(painter_device_t device, uint8_t cmd, const void *data, uint32_t byte_count);
|
||||
|
||||
typedef struct ld7032_comms_with_command_vtable_t {
|
||||
@@ -25,12 +25,13 @@ typedef struct ld7032_comms_with_command_vtable_t {
|
||||
// LD7032 Internal API
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ld7032_comms_i2c_send_command_and_data(painter_device_t device, uint8_t cmd, uint8_t data) {
|
||||
#ifdef QUANTUM_PAINTER_LD7032_I2C_ENABLE
|
||||
bool ld7032_comms_i2c_send_command_and_data(painter_device_t device, uint8_t cmd, uint8_t data) {
|
||||
uint8_t buf[2] = {cmd, data};
|
||||
qp_comms_i2c_send_data(device, buf, 2);
|
||||
return qp_comms_i2c_send_data(device, buf, 2);
|
||||
}
|
||||
|
||||
void ld7032_comms_i2c_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) {
|
||||
bool ld7032_comms_i2c_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) {
|
||||
uint8_t buf[32];
|
||||
for (size_t i = 0; i < sequence_len;) {
|
||||
uint8_t command = sequence[i];
|
||||
@@ -38,12 +39,16 @@ void ld7032_comms_i2c_bulk_command_sequence(painter_device_t device, const uint8
|
||||
uint8_t num_bytes = sequence[i + 2];
|
||||
buf[0] = command;
|
||||
memcpy(&buf[1], &sequence[i + 3], num_bytes);
|
||||
qp_comms_i2c_send_data(device, buf, num_bytes + 1);
|
||||
if (!qp_comms_i2c_send_data(device, buf, num_bytes + 1)) {
|
||||
return false;
|
||||
}
|
||||
if (delay > 0) {
|
||||
wait_ms(delay);
|
||||
}
|
||||
i += (3 + num_bytes);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t ld7032_comms_i2c_send_command_and_databuf(painter_device_t device, uint8_t cmd, const void *data, uint32_t byte_count) {
|
||||
@@ -53,6 +58,7 @@ uint32_t ld7032_comms_i2c_send_command_and_databuf(painter_device_t device, uint
|
||||
memcpy(&buf[1], data, byte_count);
|
||||
return qp_comms_send(device, buf, byte_count + 1);
|
||||
}
|
||||
#endif // QUANTUM_PAINTER_LD7032_I2C_ENABLE
|
||||
|
||||
// Power control
|
||||
bool qp_ld7032_power(painter_device_t device, bool power_on) {
|
||||
@@ -201,7 +207,9 @@ __attribute__((weak)) bool qp_ld7032_init(painter_device_t device, painter_rotat
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
qp_comms_bulk_command_sequence(device, ld7032_init_sequence, sizeof(ld7032_init_sequence));
|
||||
if (!qp_comms_bulk_command_sequence(device, ld7032_init_sequence, sizeof(ld7032_init_sequence))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t display_y_start = 40 - driver->oled.base.panel_height;
|
||||
uint8_t display_x_start = (128 - driver->oled.base.panel_width) / 2;
|
||||
@@ -223,7 +231,9 @@ __attribute__((weak)) bool qp_ld7032_init(painter_device_t device, painter_rotat
|
||||
ld7032_memory_setup[13] = ld7032_memory_setup[4] + 1;
|
||||
ld7032_memory_setup[17] = driver->oled.base.panel_height;
|
||||
|
||||
qp_comms_bulk_command_sequence(device, ld7032_memory_setup, sizeof(ld7032_memory_setup));
|
||||
if (!qp_comms_bulk_command_sequence(device, ld7032_memory_setup, sizeof(ld7032_memory_setup))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t write_direction = 0;
|
||||
switch (rotation) {
|
||||
@@ -245,7 +255,9 @@ __attribute__((weak)) bool qp_ld7032_init(painter_device_t device, painter_rotat
|
||||
painter_driver_t * pdriver = (painter_driver_t *)device;
|
||||
ld7032_comms_with_command_vtable_t *comms_vtable = (ld7032_comms_with_command_vtable_t *)pdriver->comms_vtable;
|
||||
|
||||
comms_vtable->send_command_data(device, LD7032_WRITE_DIRECTION, write_direction);
|
||||
if (!comms_vtable->send_command_data(device, LD7032_WRITE_DIRECTION, write_direction)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
qp_ld7032_power(device, true);
|
||||
|
||||
|
||||
@@ -71,8 +71,7 @@ __attribute__((weak)) bool qp_sh1106_init(painter_device_t device, painter_rotat
|
||||
sh1106_init_sequence[20] = 0x02;
|
||||
}
|
||||
|
||||
qp_comms_bulk_command_sequence(device, sh1106_init_sequence, sizeof(sh1106_init_sequence));
|
||||
return true;
|
||||
return qp_comms_bulk_command_sequence(device, sh1106_init_sequence, sizeof(sh1106_init_sequence));
|
||||
}
|
||||
|
||||
// Screen flush
|
||||
|
||||
@@ -73,8 +73,7 @@ __attribute__((weak)) bool qp_sh1107_init(painter_device_t device, painter_rotat
|
||||
sh1107_init_sequence[20] = 0x02;
|
||||
}
|
||||
|
||||
qp_comms_bulk_command_sequence(device, sh1107_init_sequence, sizeof(sh1107_init_sequence));
|
||||
return true;
|
||||
return qp_comms_bulk_command_sequence(device, sh1107_init_sequence, sizeof(sh1107_init_sequence));
|
||||
}
|
||||
|
||||
// Screen flush
|
||||
|
||||
@@ -44,7 +44,9 @@ __attribute__((weak)) bool qp_ssd1351_init(painter_device_t device, painter_rota
|
||||
SSD1351_DISPLAYON, 5, 0,
|
||||
};
|
||||
// clang-format on
|
||||
qp_comms_bulk_command_sequence(device, ssd1351_init_sequence, sizeof(ssd1351_init_sequence));
|
||||
if (!qp_comms_bulk_command_sequence(device, ssd1351_init_sequence, sizeof(ssd1351_init_sequence))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Configure the rotation (i.e. the ordering and direction of memory writes in GRAM)
|
||||
const uint8_t madctl[] = {
|
||||
@@ -53,10 +55,10 @@ __attribute__((weak)) bool qp_ssd1351_init(painter_device_t device, painter_rota
|
||||
[QP_ROTATION_180] = SSD1351_MADCTL_BGR | SSD1351_MADCTL_MX,
|
||||
[QP_ROTATION_270] = SSD1351_MADCTL_BGR | SSD1351_MADCTL_MV,
|
||||
};
|
||||
qp_comms_command_databyte(device, SSD1351_SETREMAP, madctl[rotation]);
|
||||
qp_comms_command_databyte(device, SSD1351_STARTLINE, (rotation == QP_ROTATION_0 || rotation == QP_ROTATION_90) ? driver->base.panel_height : 0);
|
||||
|
||||
return true;
|
||||
if (!qp_comms_command_databyte(device, SSD1351_SETREMAP, madctl[rotation])) {
|
||||
return false;
|
||||
}
|
||||
return qp_comms_command_databyte(device, SSD1351_STARTLINE, (rotation == QP_ROTATION_0 || rotation == QP_ROTATION_90) ? driver->base.panel_height : 0);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -63,7 +63,9 @@ __attribute__((weak)) bool qp_st7735_init(painter_device_t device, painter_rotat
|
||||
ST77XX_CMD_DISPLAY_ON, 20, 0
|
||||
};
|
||||
// clang-format on
|
||||
qp_comms_bulk_command_sequence(device, st7735_init_sequence, sizeof(st7735_init_sequence));
|
||||
if (!qp_comms_bulk_command_sequence(device, st7735_init_sequence, sizeof(st7735_init_sequence))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Configure the rotation (i.e. the ordering and direction of memory writes in GRAM)
|
||||
const uint8_t madctl[] = {
|
||||
@@ -72,7 +74,9 @@ __attribute__((weak)) bool qp_st7735_init(painter_device_t device, painter_rotat
|
||||
[QP_ROTATION_180] = ST77XX_MADCTL_BGR | ST77XX_MADCTL_MX | ST77XX_MADCTL_MY,
|
||||
[QP_ROTATION_270] = ST77XX_MADCTL_BGR | ST77XX_MADCTL_MV | ST77XX_MADCTL_MY,
|
||||
};
|
||||
qp_comms_command_databyte(device, ST77XX_SET_MADCTL, madctl[rotation]);
|
||||
if (!qp_comms_command_databyte(device, ST77XX_SET_MADCTL, madctl[rotation])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef ST7735_NO_AUTOMATIC_VIEWPORT_OFFSETS
|
||||
st7735_automatic_viewport_offsets(device, rotation);
|
||||
|
||||
@@ -60,7 +60,9 @@ __attribute__((weak)) bool qp_st7789_init(painter_device_t device, painter_rotat
|
||||
ST77XX_CMD_DISPLAY_ON, 20, 0
|
||||
};
|
||||
// clang-format on
|
||||
qp_comms_bulk_command_sequence(device, st7789_init_sequence, sizeof(st7789_init_sequence));
|
||||
if (!qp_comms_bulk_command_sequence(device, st7789_init_sequence, sizeof(st7789_init_sequence))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Configure the rotation (i.e. the ordering and direction of memory writes in GRAM)
|
||||
const uint8_t madctl[] = {
|
||||
@@ -69,7 +71,9 @@ __attribute__((weak)) bool qp_st7789_init(painter_device_t device, painter_rotat
|
||||
[QP_ROTATION_180] = ST77XX_MADCTL_RGB | ST77XX_MADCTL_MX | ST77XX_MADCTL_MY,
|
||||
[QP_ROTATION_270] = ST77XX_MADCTL_RGB | ST77XX_MADCTL_MV | ST77XX_MADCTL_MY,
|
||||
};
|
||||
qp_comms_command_databyte(device, ST77XX_SET_MADCTL, madctl[rotation]);
|
||||
if (!qp_comms_command_databyte(device, ST77XX_SET_MADCTL, madctl[rotation])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef ST7789_NO_AUTOMATIC_VIEWPORT_OFFSETS
|
||||
st7789_automatic_viewport_offsets(device, rotation);
|
||||
|
||||