Merge branch 'zmkfirmware:main' into main

This commit is contained in:
WSTRN 2024-04-04 00:58:00 +11:00 committed by GitHub
commit d0597e9f40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
351 changed files with 3241 additions and 833 deletions

View file

@ -1,4 +1,4 @@
FROM docker.io/zmkfirmware/zmk-dev-arm:3.2 FROM docker.io/zmkfirmware/zmk-dev-arm:3.5
COPY .bashrc tmp COPY .bashrc tmp
RUN mv /tmp/.bashrc ~/.bashrc RUN mv /tmp/.bashrc ~/.bashrc

View file

@ -35,7 +35,7 @@ jobs:
test: ${{ fromJSON(needs.collect-tests.outputs.test-dirs) }} test: ${{ fromJSON(needs.collect-tests.outputs.test-dirs) }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: docker.io/zmkfirmware/zmk-build-arm:3.2 image: docker.io/zmkfirmware/zmk-build-arm:3.5
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -69,7 +69,7 @@ jobs:
run: make everything run: make everything
- name: Test ${{ matrix.test }} - name: Test ${{ matrix.test }}
working-directory: app working-directory: app
run: BSIM_COMPONENTS_PATH="${GITHUB_WORKSPACE}/tools/bsim/components/" BSIM_OUT_PATH="${GITHUB_WORKSPACE}/tools/bsim/" ./run-ble-test.sh tests/ble/${{ matrix.test }} run: BSIM_COMPONENTS_PATH="${GITHUB_WORKSPACE}/tools/bsim/components" BSIM_OUT_PATH="${GITHUB_WORKSPACE}/tools/bsim" ./run-ble-test.sh tests/ble/${{ matrix.test }}
- name: Archive artifacts - name: Archive artifacts
if: ${{ always() }} if: ${{ always() }}
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View file

@ -65,16 +65,23 @@ jobs:
board: ${{ matrix.board }} board: ${{ matrix.board }}
shield: ${{ matrix.shield }} shield: ${{ matrix.shield }}
artifact_name: ${{ matrix.artifact-name }} artifact_name: ${{ matrix.artifact-name }}
snippet: ${{ matrix.snippet }}
run: | run: |
if [ -e zephyr/module.yml ]; then if [ -e zephyr/module.yml ]; then
export zmk_load_arg=" -DZMK_EXTRA_MODULES='${GITHUB_WORKSPACE}'" export zmk_load_arg=" -DZMK_EXTRA_MODULES='${GITHUB_WORKSPACE}'"
export new_tmp_dir=$(mktemp -d) new_tmp_dir="${TMPDIR:-/tmp}/zmk-config"
mkdir -p "${new_tmp_dir}"
echo "base_dir=${new_tmp_dir}" >> $GITHUB_ENV echo "base_dir=${new_tmp_dir}" >> $GITHUB_ENV
else else
echo "base_dir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV echo "base_dir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
fi fi
if [ -n "${snippet}" ]; then
extra_west_args="-S \"${snippet}\""
fi
echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV
echo "extra_west_args=${extra_west_args}" >> $GITHUB_ENV
echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}${zmk_load_arg}" >> $GITHUB_ENV echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}${zmk_load_arg}" >> $GITHUB_ENV
echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV
echo "artifact_name=${artifact_name:-${shield:+$shield-}${board}-zmk}" >> $GITHUB_ENV echo "artifact_name=${artifact_name:-${shield:+$shield-}${board}-zmk}" >> $GITHUB_ENV
@ -119,7 +126,7 @@ jobs:
- name: West Build (${{ env.display_name }}) - name: West Build (${{ env.display_name }})
working-directory: ${{ env.base_dir }} working-directory: ${{ env.base_dir }}
shell: sh -x {0} shell: sh -x {0}
run: west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" -- -DZMK_CONFIG=${{ env.base_dir }}/${{ inputs.config_path }} ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }} run: west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" ${{ env.extra_west_args }} -- -DZMK_CONFIG=${{ env.base_dir }}/${{ inputs.config_path }} ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}
- name: ${{ env.display_name }} Kconfig file - name: ${{ env.display_name }} Kconfig file
run: | run: |

View file

@ -17,7 +17,7 @@ jobs:
if: ${{ always() }} if: ${{ always() }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: docker.io/zmkfirmware/zmk-build-arm:3.2 image: docker.io/zmkfirmware/zmk-build-arm:3.5
needs: compile-matrix needs: compile-matrix
strategy: strategy:
matrix: matrix:

View file

@ -18,7 +18,7 @@ jobs:
validate-metadata: validate-metadata:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: docker.io/zmkfirmware/zmk-dev-arm:3.2 image: docker.io/zmkfirmware/zmk-dev-arm:3.5
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install dependencies - name: Install dependencies

View file

@ -35,7 +35,7 @@ jobs:
test: ${{ fromJSON(needs.collect-tests.outputs.test-dirs) }} test: ${{ fromJSON(needs.collect-tests.outputs.test-dirs) }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: docker.io/zmkfirmware/zmk-build-arm:3.2 image: docker.io/zmkfirmware/zmk-build-arm:3.5
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4

7
.gitignore vendored
View file

@ -5,7 +5,14 @@
/zephyr /zephyr
/zmk-config /zmk-config
/build /build
# macOS
*.DS_Store *.DS_Store
# Python
__pycache__ __pycache__
.python-version .python-version
.venv .venv
# clangd
app/.cache/

View file

@ -86,6 +86,12 @@ documentation to areas not currently covered are greatly appreciated.
ZMK uses `prettier` to format documentation files. You can run prettier with `npm run prettier:format`. ZMK uses `prettier` to format documentation files. You can run prettier with `npm run prettier:format`.
You can setup git to run prettier automatically when you commit by installing the pre-commit hooks: `pip3 install pre-commit`, `pre-commit install`. You can setup git to run prettier automatically when you commit by installing the pre-commit hooks: `pip3 install pre-commit`, `pre-commit install`.
### Linting
This repository utilizes ESLint for code linting to ensure consistent code style and identify potential errors or bugs early in the development process.
You can run ESLint with `npm run lint` to verify your changes.
## Code Contributions ## Code Contributions
### Development Setup ### Development Setup

View file

@ -11,6 +11,9 @@ project(zmk)
zephyr_linker_sources(SECTIONS include/linker/zmk-behaviors.ld) zephyr_linker_sources(SECTIONS include/linker/zmk-behaviors.ld)
zephyr_linker_sources(RODATA include/linker/zmk-events.ld) zephyr_linker_sources(RODATA include/linker/zmk-events.ld)
zephyr_syscall_header(${APPLICATION_SOURCE_DIR}/include/drivers/behavior.h)
zephyr_syscall_header(${APPLICATION_SOURCE_DIR}/include/drivers/ext_power.h)
# Add your source file to the "app" target. This must come after # Add your source file to the "app" target. This must come after
# find_package(Zephyr) which defines the target. # find_package(Zephyr) which defines the target.
target_include_directories(app PRIVATE include) target_include_directories(app PRIVATE include)
@ -18,11 +21,14 @@ target_sources(app PRIVATE src/stdlib.c)
target_sources(app PRIVATE src/activity.c) target_sources(app PRIVATE src/activity.c)
target_sources(app PRIVATE src/behavior.c) target_sources(app PRIVATE src/behavior.c)
target_sources(app PRIVATE src/kscan.c) target_sources(app PRIVATE src/kscan.c)
target_sources_ifdef(CONFIG_ZMK_KSCAN_SIDEBAND_BEHAVIORS app PRIVATE src/kscan_sideband_behaviors.c)
target_sources(app PRIVATE src/matrix_transform.c) target_sources(app PRIVATE src/matrix_transform.c)
target_sources(app PRIVATE src/sensors.c) target_sources(app PRIVATE src/sensors.c)
target_sources_ifdef(CONFIG_ZMK_WPM app PRIVATE src/wpm.c) target_sources_ifdef(CONFIG_ZMK_WPM app PRIVATE src/wpm.c)
target_sources(app PRIVATE src/event_manager.c) target_sources(app PRIVATE src/event_manager.c)
target_sources_ifdef(CONFIG_ZMK_PM app PRIVATE src/pm.c)
target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/ext_power_generic.c) target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/ext_power_generic.c)
target_sources_ifdef(CONFIG_ZMK_GPIO_KEY_WAKEUP_TRIGGER app PRIVATE src/gpio_key_wakeup_trigger.c)
target_sources(app PRIVATE src/events/activity_state_changed.c) target_sources(app PRIVATE src/events/activity_state_changed.c)
target_sources(app PRIVATE src/events/position_state_changed.c) target_sources(app PRIVATE src/events/position_state_changed.c)
target_sources(app PRIVATE src/events/sensor_event.c) target_sources(app PRIVATE src/events/sensor_event.c)
@ -31,6 +37,7 @@ target_sources_ifdef(CONFIG_ZMK_WPM app PRIVATE src/events/wpm_state_changed.c)
target_sources_ifdef(CONFIG_USB_DEVICE_STACK app PRIVATE src/events/usb_conn_state_changed.c) target_sources_ifdef(CONFIG_USB_DEVICE_STACK app PRIVATE src/events/usb_conn_state_changed.c)
target_sources(app PRIVATE src/behaviors/behavior_reset.c) target_sources(app PRIVATE src/behaviors/behavior_reset.c)
target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/behaviors/behavior_ext_power.c) target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/behaviors/behavior_ext_power.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SOFT_OFF app PRIVATE src/behaviors/behavior_soft_off.c)
if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL) if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources(app PRIVATE src/hid.c) target_sources(app PRIVATE src/hid.c)
target_sources_ifdef(CONFIG_ZMK_MOUSE app PRIVATE src/mouse.c) target_sources_ifdef(CONFIG_ZMK_MOUSE app PRIVATE src/mouse.c)
@ -92,5 +99,6 @@ target_sources_ifdef(CONFIG_ZMK_LOW_PRIORITY_WORK_QUEUE app PRIVATE src/workqueu
target_sources(app PRIVATE src/main.c) target_sources(app PRIVATE src/main.c)
add_subdirectory(src/display/) add_subdirectory(src/display/)
add_subdirectory_ifdef(CONFIG_SETTINGS src/settings/)
zephyr_cc_option(-Wfatal-errors) zephyr_cc_option(-Wfatal-errors)

View file

@ -37,6 +37,17 @@ config BT_DIS_MODEL
config BT_DIS_MANUF config BT_DIS_MANUF
default "ZMK Project" default "ZMK Project"
# Hardware specific overrides
if SOC_SERIES_NRF52X
# Default on for our usage until boards implement retained bootmode.
config NRF_STORE_REBOOT_TYPE_GPREGRET
bool
default y
endif
menu "HID" menu "HID"
choice ZMK_HID_REPORT_TYPE choice ZMK_HID_REPORT_TYPE
@ -166,17 +177,11 @@ config ZMK_BLE_EXPERIMENTAL_FEATURES
config ZMK_BLE_PASSKEY_ENTRY config ZMK_BLE_PASSKEY_ENTRY
bool "Require passkey entry on the keyboard to complete pairing" bool "Require passkey entry on the keyboard to complete pairing"
default n
select RING_BUFFER select RING_BUFFER
config BT_SMP_ALLOW_UNAUTH_OVERWRITE config BT_SMP_ALLOW_UNAUTH_OVERWRITE
imply ZMK_BLE_PASSKEY_ENTRY imply ZMK_BLE_PASSKEY_ENTRY
choice BT_LL_SW_LLCP_IMPL
default BT_LL_SW_LLCP_LEGACY if !ZMK_BLE_EXPERIMENTAL_CONN
endchoice
config BT_CTLR_PHY_2M config BT_CTLR_PHY_2M
default n if ZMK_BLE_EXPERIMENTAL_CONN default n if ZMK_BLE_EXPERIMENTAL_CONN
@ -210,7 +215,6 @@ config ZMK_BLE_MOUSE_REPORT_QUEUE_SIZE
config ZMK_BLE_CLEAR_BONDS_ON_START config ZMK_BLE_CLEAR_BONDS_ON_START
bool "Configuration that clears all bond information from the keyboard on startup." bool "Configuration that clears all bond information from the keyboard on startup."
default n
# HID GATT notifications sent this way are *not* picked up by Linux, and possibly others. # HID GATT notifications sent this way are *not* picked up by Linux, and possibly others.
config BT_GATT_NOTIFY_MULTIPLE config BT_GATT_NOTIFY_MULTIPLE
@ -367,7 +371,6 @@ menu "Mouse Options"
config ZMK_MOUSE config ZMK_MOUSE
bool "Enable ZMK mouse emulation" bool "Enable ZMK mouse emulation"
default n
#Mouse Options #Mouse Options
endmenu endmenu
@ -376,17 +379,33 @@ menu "Power Management"
config ZMK_BATTERY_REPORTING config ZMK_BATTERY_REPORTING
bool "Battery level detection/reporting" bool "Battery level detection/reporting"
default n
select SENSOR select SENSOR
select ZMK_LOW_PRIORITY_WORK_QUEUE select ZMK_LOW_PRIORITY_WORK_QUEUE
imply BT_BAS if ZMK_BLE imply BT_BAS if ZMK_BLE
if ZMK_BATTERY_REPORTING
choice ZMK_BATTERY_REPORTING_FETCH_MODE
prompt "Battery Reporting Fetch Mode"
config ZMK_BATTERY_REPORTING_FETCH_MODE_STATE_OF_CHARGE
bool "State of charge"
config ZMK_BATTERY_REPORTING_FETCH_MODE_LITHIUM_VOLTAGE
bool "Lithium Voltage"
endchoice
endif
config ZMK_IDLE_TIMEOUT config ZMK_IDLE_TIMEOUT
int "Milliseconds of inactivity before entering idle state (OLED shutoff, etc)" int "Milliseconds of inactivity before entering idle state (OLED shutoff, etc)"
default 30000 default 30000
config ZMK_SLEEP config ZMK_SLEEP
bool "Enable deep sleep support" bool "Enable deep sleep support"
depends on HAS_POWEROFF
select POWEROFF
select ZMK_PM_DEVICE_SUSPEND_RESUME
imply USB imply USB
if ZMK_SLEEP if ZMK_SLEEP
@ -405,6 +424,26 @@ config ZMK_EXT_POWER
bool "Enable support to control external power output" bool "Enable support to control external power output"
default y default y
config ZMK_PM
bool
config ZMK_PM_DEVICE_SUSPEND_RESUME
bool
select ZMK_PM
config ZMK_PM_SOFT_OFF
bool "Soft-off support"
depends on HAS_POWEROFF
select ZMK_PM
select PM_DEVICE
select ZMK_PM_DEVICE_SUSPEND_RESUME
select POWEROFF
config ZMK_GPIO_KEY_WAKEUP_TRIGGER
bool "Hardware supported wakeup (GPIO)"
default y
depends on DT_HAS_ZMK_GPIO_KEY_WAKEUP_TRIGGER_ENABLED && ZMK_PM_SOFT_OFF
#Power Management #Power Management
endmenu endmenu
@ -481,6 +520,21 @@ config ZMK_KSCAN_EVENT_QUEUE_SIZE
endif # ZMK_KSCAN endif # ZMK_KSCAN
config ZMK_KSCAN_SIDEBAND_BEHAVIORS
bool
default y
depends on DT_HAS_ZMK_KSCAN_SIDEBAND_BEHAVIORS_ENABLED
select KSCAN
if ZMK_KSCAN_SIDEBAND_BEHAVIORS
config ZMK_KSCAN_SIDEBAND_BEHAVIORS_INIT_PRIORITY
int "Keyboard scan sideband behaviors driver init priority"
# The default kscan init priority is 90, so be sure we are initialized later.
default 95
endif # ZMK_KSCAN_SIDEBAND_BEHAVIORS
menu "Logging" menu "Logging"
config ZMK_LOGGING_MINIMAL config ZMK_LOGGING_MINIMAL
@ -561,6 +615,22 @@ endmenu
if SETTINGS if SETTINGS
config ZMK_SETTINGS_RESET_ON_START
bool "Delete all persistent settings when the keyboard boots"
if ZMK_SETTINGS_RESET_ON_START
config ZMK_SETTINGS_RESET_ON_START_INIT_PRIORITY
int "Settings Reset ON Start Initialization Priority"
default 60
help
Initialization priority for the settings reset on start. Must be lower priority/
higher value than FLASH_INIT_PRIORITY if using the NVS/Flash settings backend.
endif
config ZMK_SETTINGS_SAVE_DEBOUNCE config ZMK_SETTINGS_SAVE_DEBOUNCE
int "Milliseconds to debounce settings saves" int "Milliseconds to debounce settings saves"
default 60000 default 60000
@ -594,9 +664,6 @@ endmenu
#ZMK #ZMK
endmenu endmenu
config HEAP_MEM_POOL_SIZE
default 8192 if ZMK_DISPLAY
config KERNEL_BIN_NAME config KERNEL_BIN_NAME
default "zmk" default "zmk"
@ -611,7 +678,6 @@ config FPU
config ZMK_WPM config ZMK_WPM
bool "Calculate WPM" bool "Calculate WPM"
default n
config ZMK_KEYMAP_SENSORS config ZMK_KEYMAP_SENSORS
bool "Enable Keymap Sensors support" bool "Enable Keymap Sensors support"

View file

@ -12,9 +12,13 @@ config ZMK_BEHAVIOR_MOUSE_KEY_PRESS
depends on DT_HAS_ZMK_BEHAVIOR_MOUSE_KEY_PRESS_ENABLED depends on DT_HAS_ZMK_BEHAVIOR_MOUSE_KEY_PRESS_ENABLED
imply ZMK_MOUSE imply ZMK_MOUSE
config ZMK_BEHAVIOR_SOFT_OFF
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_SOFT_OFF_ENABLED && ZMK_PM_SOFT_OFF
config ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON config ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON
bool bool
default n
config ZMK_BEHAVIOR_SENSOR_ROTATE config ZMK_BEHAVIOR_SENSOR_ROTATE
bool bool

View file

@ -10,6 +10,7 @@
/{ /{
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -10,6 +10,7 @@
/{ /{
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -5,4 +5,5 @@
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -0,0 +1,9 @@
file_format: "1"
id: blackpill_f401cc
name: BlackPill F401CC
type: board
arch: arm
outputs:
- usb
url: https://github.com/WeActStudio/WeActStudio.MiniSTM32F4x1
exposes: [blackpill]

View file

@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -70,18 +70,6 @@
status = "okay"; status = "okay";
}; };
&i2c0 {
compatible = "nordic,nrf-twi";
sda-pin = <17>;
scl-pin = <20>;
};
&uart0 {
compatible = "nordic,nrf-uarte";
tx-pin = <6>;
rx-pin = <8>;
};
&usbd { &usbd {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart { cdc_acm_uart: cdc_acm_uart {

View file

@ -81,6 +81,8 @@
kscan0: kscan_0 { kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
col-gpios col-gpios

View file

@ -30,6 +30,8 @@
kscan0: kscan_0 { kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
col-gpios col-gpios

View file

@ -1,4 +1,5 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -34,6 +34,8 @@
kscan0: kscan_0 { kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
col-gpios col-gpios

View file

@ -57,6 +57,13 @@ config IL0323
config ZMK_DISPLAY_BLANK_ON_IDLE config ZMK_DISPLAY_BLANK_ON_IDLE
default n default n
# Needed for the IL0323 driver which allocs memory to clear the display
config HEAP_MEM_POOL_SIZE
default 1024
config LV_Z_MEM_POOL_SIZE
default 4096
endif # ZMK_DISPLAY endif # ZMK_DISPLAY
menuconfig CUSTOM_WIDGET_BATTERY_STATUS menuconfig CUSTOM_WIDGET_BATTERY_STATUS

View file

@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -58,9 +58,9 @@
// | SHFT | | | | | | | _ | + | { | } | "|" | ~ | // | SHFT | | | | | | | _ | + | { | } | "|" | ~ |
// | GUI | | SPC | | ENT | | ALT | // | GUI | | SPC | | ENT | | ALT |
bindings = < bindings = <
&kp TAB &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp BSPC &kp TAB &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &kp BSPC
&kp LCTRL &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE &kp LCTRL &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE
&kp LSHFT &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE &kp LSHFT &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE
&kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT &kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT
>; >;
}; };

View file

@ -15,6 +15,7 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -44,7 +44,7 @@ CONFIG_ZMK_BLE=y
# enable display drivers # enable display drivers
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048 CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096
CONFIG_LV_Z_BITS_PER_PIXEL=1 CONFIG_LV_Z_BITS_PER_PIXEL=1
CONFIG_LV_COLOR_DEPTH_1=y CONFIG_LV_COLOR_DEPTH_1=y
CONFIG_LV_DPI_DEF=145 CONFIG_LV_DPI_DEF=145

View file

@ -15,6 +15,7 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -39,12 +39,12 @@ CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y
CONFIG_ZMK_USB=y CONFIG_ZMK_USB=n
CONFIG_ZMK_BLE=y CONFIG_ZMK_BLE=y
# enable display drivers # enable display drivers
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048 CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096
CONFIG_LV_Z_BITS_PER_PIXEL=1 CONFIG_LV_Z_BITS_PER_PIXEL=1
CONFIG_LV_COLOR_DEPTH_1=y CONFIG_LV_COLOR_DEPTH_1=y
CONFIG_LV_DPI_DEF=145 CONFIG_LV_DPI_DEF=145

View file

@ -15,6 +15,7 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -40,7 +40,7 @@ CONFIG_ZMK_BLE=y
# enable display drivers # enable display drivers
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048 CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096
CONFIG_LV_Z_BITS_PER_PIXEL=1 CONFIG_LV_Z_BITS_PER_PIXEL=1
CONFIG_LV_COLOR_DEPTH_1=y CONFIG_LV_COLOR_DEPTH_1=y
CONFIG_LV_DPI_DEF=145 CONFIG_LV_DPI_DEF=145

View file

@ -15,6 +15,7 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -35,12 +35,12 @@ CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y
CONFIG_ZMK_USB=y CONFIG_ZMK_USB=n
CONFIG_ZMK_BLE=y CONFIG_ZMK_BLE=y
# enable display drivers # enable display drivers
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048 CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096
CONFIG_LV_Z_BITS_PER_PIXEL=1 CONFIG_LV_Z_BITS_PER_PIXEL=1
CONFIG_LV_COLOR_DEPTH_1=y CONFIG_LV_COLOR_DEPTH_1=y
CONFIG_LV_DPI_DEF=145 CONFIG_LV_DPI_DEF=145

View file

@ -6,12 +6,12 @@
*/ */
#include <zephyr/kernel.h> #include <zephyr/kernel.h>
#include <zephyr/bluetooth/services/bas.h>
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <zmk/display.h> #include <zmk/display.h>
#include <zmk/battery.h>
#include "battery_status.h" #include "battery_status.h"
#include <zmk/usb.h> #include <zmk/usb.h>
#include <zmk/events/usb_conn_state_changed.h> #include <zmk/events/usb_conn_state_changed.h>
@ -66,8 +66,10 @@ void battery_status_update_cb(struct battery_status_state state) {
} }
static struct battery_status_state battery_status_get_state(const zmk_event_t *eh) { static struct battery_status_state battery_status_get_state(const zmk_event_t *eh) {
const struct zmk_battery_state_changed *ev = as_zmk_battery_state_changed(eh);
return (struct battery_status_state) { return (struct battery_status_state) {
.level = zmk_battery_state_of_charge(), .level = (ev != NULL) ? ev->state_of_charge : zmk_battery_state_of_charge(),
#if IS_ENABLED(CONFIG_USB_DEVICE_STACK) #if IS_ENABLED(CONFIG_USB_DEVICE_STACK)
.usb_present = zmk_usb_is_powered(), .usb_present = zmk_usb_is_powered(),
#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK) */ #endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK) */

View file

@ -6,7 +6,6 @@
*/ */
#include <zephyr/kernel.h> #include <zephyr/kernel.h>
#include <zephyr/bluetooth/services/bas.h>
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);

View file

@ -5,9 +5,6 @@ CONFIG_SOC_STM32F303XC=y
# 72MHz system clock # 72MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000 CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000
# enable pinmux
CONFIG_PINMUX=y
# enable GPIO # enable GPIO
CONFIG_GPIO=y CONFIG_GPIO=y

View file

@ -112,6 +112,9 @@
&usb { &usb {
status = "okay"; status = "okay";
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
pinctrl-names = "default";
cdc_acm_uart: cdc_acm_uart { cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart"; compatible = "zephyr,cdc-acm-uart";
}; };
@ -121,6 +124,10 @@
status = "okay"; status = "okay";
}; };
&clk_hsi48 {
status = "okay";
};
&pll { &pll {
prediv = <1>; prediv = <1>;
mul = <6>; mul = <6>;

View file

@ -14,14 +14,14 @@
#define SYM_L 4 #define SYM_L 4
// Using layer taps on thumbs, having quick tap as well helps w/ repeating space/backspace // Using layer taps on thumbs, having quick tap as well helps w/ repeating space/backspace
&lt { quick_tap_ms = <200>; }; &lt { quick-tap-ms = <200>; };
/ { / {
behaviors { behaviors {
hm: homerow_mods { hm: homerow_mods {
compatible = "zmk,behavior-hold-tap"; compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>; #binding-cells = <2>;
tapping_term_ms = <200>; tapping-term-ms = <200>;
flavor = "tap-preferred"; flavor = "tap-preferred";
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
}; };

View file

@ -6,7 +6,7 @@ CONFIG_SOC_STM32F072XB=y
# 48MHz system clock # 48MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000 CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000
# enable PINMUX # enable PINCTRL
CONFIG_PINCTRL=y CONFIG_PINCTRL=y
# enable GPIO # enable GPIO

View file

@ -2,5 +2,5 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -34,6 +34,8 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
debounce-press-ms = <4>; debounce-press-ms = <4>;
debounce-release-ms = <20>; debounce-release-ms = <20>;

View file

@ -1,6 +1,3 @@
if(CONFIG_PINMUX)
zephyr_library() zephyr_library()
zephyr_library_sources(pinmux.c) zephyr_library_sources(pinmux.c)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers) zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
endif()

View file

@ -21,9 +21,6 @@ endif # USB
config BT_CTLR config BT_CTLR
default BT default BT
config PINMUX
default y
choice BOARD_MIKOTO_CHARGER_CURRENT choice BOARD_MIKOTO_CHARGER_CURRENT
default BOARD_MIKOTO_CHARGER_CURRENT_100MA default BOARD_MIKOTO_CHARGER_CURRENT_100MA
endchoice endchoice

View file

@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -11,8 +11,7 @@
#include <zephyr/sys/sys_io.h> #include <zephyr/sys/sys_io.h>
#include <zephyr/devicetree.h> #include <zephyr/devicetree.h>
static int pinmux_mikoto_init(const struct device *port) { static int pinmux_mikoto_init(void) {
ARG_UNUSED(port);
#if CONFIG_BOARD_MIKOTO_520 #if CONFIG_BOARD_MIKOTO_520
const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0)); const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0));

View file

@ -3,5 +3,6 @@
set(OPENOCD_NRF5_SUBFAMILY nrf52) set(OPENOCD_NRF5_SUBFAMILY nrf52)
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake)

View file

@ -42,6 +42,7 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) R
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -1,6 +1,3 @@
if(CONFIG_PINMUX)
zephyr_library() zephyr_library()
zephyr_library_sources(pinmux.c) zephyr_library_sources(pinmux.c)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers) zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
endif()

View file

@ -18,9 +18,6 @@ endif # USB_DEVICE_STACK
config BT_CTLR config BT_CTLR
default BT default BT
config PINMUX
default y
if BOARD_NRFMICRO_13 || BOARD_NRFMICRO_13_52833 if BOARD_NRFMICRO_13 || BOARD_NRFMICRO_13_52833
config BOARD_NRFMICRO_CHARGER config BOARD_NRFMICRO_CHARGER

View file

@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -31,6 +31,7 @@
EXT_POWER { EXT_POWER {
compatible = "zmk,ext-power-generic"; compatible = "zmk,ext-power-generic";
control-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; control-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
init-delay-ms = <50>;
}; };
}; };

View file

@ -31,6 +31,7 @@
EXT_POWER { EXT_POWER {
compatible = "zmk,ext-power-generic"; compatible = "zmk,ext-power-generic";
control-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; control-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
init-delay-ms = <50>;
}; };
}; };

View file

@ -32,6 +32,7 @@
EXT_POWER { EXT_POWER {
compatible = "zmk,ext-power-generic"; compatible = "zmk,ext-power-generic";
control-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; control-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
init-delay-ms = <50>;
}; };
vbatt: vbatt { vbatt: vbatt {

View file

@ -32,6 +32,7 @@
EXT_POWER { EXT_POWER {
compatible = "zmk,ext-power-generic"; compatible = "zmk,ext-power-generic";
control-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; control-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
init-delay-ms = <50>;
}; };
vbatt: vbatt { vbatt: vbatt {

View file

@ -11,9 +11,7 @@
#include <zephyr/sys/sys_io.h> #include <zephyr/sys/sys_io.h>
#include <zephyr/devicetree.h> #include <zephyr/devicetree.h>
static int pinmux_nrfmicro_init(const struct device *port) { static int pinmux_nrfmicro_init(void) {
ARG_UNUSED(port);
#if (CONFIG_BOARD_NRFMICRO_13 || CONFIG_BOARD_NRFMICRO_13_52833) #if (CONFIG_BOARD_NRFMICRO_13 || CONFIG_BOARD_NRFMICRO_13_52833)
const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0)); const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0));
#if CONFIG_BOARD_NRFMICRO_CHARGER #if CONFIG_BOARD_NRFMICRO_CHARGER

View file

@ -2,5 +2,6 @@
set(OPENOCD_NRF5_SUBFAMILY nrf52) set(OPENOCD_NRF5_SUBFAMILY nrf52)
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake)

View file

@ -44,6 +44,20 @@
; ;
}; };
encoder: encoder {
compatible = "alps,ec11";
a-gpios = <&gpiob 12 GPIO_PULL_UP>;
b-gpios = <&gpiob 13 GPIO_PULL_UP>;
steps = <80>;
status = "disabled";
};
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder>;
triggers-per-rotation = <20>;
};
layout_grid_transform: layout_grid_transform:
keymap_transform_0 { keymap_transform_0 {
compatible = "zmk,matrix-transform"; compatible = "zmk,matrix-transform";

View file

@ -7,6 +7,11 @@
#include <behaviors.dtsi> #include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/keys.h>
/* Uncomment this block if using an encoder */
//&encoder {
// status = "okay";
//};
/ { / {
keymap { keymap {
compatible = "zmk,keymap"; compatible = "zmk,keymap";
@ -23,6 +28,7 @@
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SLASH &kp RET &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SLASH &kp RET
&trans &kp LCTL &kp LALT &kp LGUI &mo 1 &trans &kp SPACE &mo 2 &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans &kp LCTL &kp LALT &kp LGUI &mo 1 &trans &kp SPACE &mo 2 &kp LEFT &kp DOWN &kp UP &kp RIGHT
>; >;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
}; };
lower { lower {

View file

@ -5,6 +5,7 @@ type: board
arch: arm arch: arm
features: features:
- keys - keys
- encoder
outputs: outputs:
- usb - usb
url: https://olkb.com/collections/planck url: https://olkb.com/collections/planck

View file

@ -5,9 +5,6 @@ CONFIG_SOC_STM32F303XC=y
# 72MHz system clock # 72MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000 CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000
# enable pinmux
CONFIG_PINMUX=y
CONFIG_PINCTRL=y CONFIG_PINCTRL=y
# enable GPIO # enable GPIO
@ -17,3 +14,7 @@ CONFIG_GPIO=y
CONFIG_CLOCK_CONTROL=y CONFIG_CLOCK_CONTROL=y
CONFIG_ZMK_USB=y CONFIG_ZMK_USB=y
# Uncomment these two lines to add support for encoder to your firmware
#CONFIG_EC11=y
#CONFIG_EC11_TRIGGER_OWN_THREAD=y

View file

@ -1,6 +1,3 @@
if(CONFIG_PINMUX)
zephyr_library() zephyr_library()
zephyr_library_sources(pinmux.c) zephyr_library_sources(pinmux.c)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers) zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
endif()

View file

@ -16,7 +16,4 @@ endif # USB_DEVICE_STACK
config BT_CTLR config BT_CTLR
default BT default BT
config PINMUX
default y
endif # BOARD_PUCHI_BLE_v1 endif # BOARD_PUCHI_BLE_v1

View file

@ -2,5 +2,5 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -11,9 +11,7 @@
#include <zephyr/sys/sys_io.h> #include <zephyr/sys/sys_io.h>
#include <zephyr/devicetree.h> #include <zephyr/devicetree.h>
static int pinmux_puchi_ble_init(const struct device *port) { static int pinmux_puchi_ble_init(void) {
ARG_UNUSED(port);
#if CONFIG_BOARD_PUCHI_BLE_v1 #if CONFIG_BOARD_PUCHI_BLE_v1
const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0)); const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0));
#if CONFIG_BOARD_PUCHI_BLE_CHARGER #if CONFIG_BOARD_PUCHI_BLE_CHARGER

View file

@ -3,5 +3,6 @@
set(OPENOCD_NRF5_SUBFAMILY nrf52) set(OPENOCD_NRF5_SUBFAMILY nrf52)
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake)

View file

@ -37,6 +37,7 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -0,0 +1,6 @@
CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_UART_INTERRUPT_DRIVEN=n
CONFIG_ZMK_USB=y
CONFIG_ZMK_KSCAN_MATRIX_POLLING=y

View file

@ -0,0 +1,50 @@
/*
* Copyright (c) 2024 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/ {
blackpill: connector {
compatible = "blackpill";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map
= <2 0 &gpioc 13 0> /* PC13 */
, <3 0 &gpioc 14 0> /* PC14 */
, <4 0 &gpioc 15 0> /* PC15 */
, <10 0 &gpioa 0 0> /* PA0 */
, <11 0 &gpioa 1 0> /* PA1 */
, <12 0 &gpioa 2 0> /* PA2 */
, <13 0 &gpioa 3 0> /* PA3 */
, <14 0 &gpioa 4 0> /* PA4 */
, <15 0 &gpioa 5 0> /* PA5 */
, <16 0 &gpioa 6 0> /* PA6 */
, <17 0 &gpioa 7 0> /* PA7 */
, <18 0 &gpiob 0 0> /* PB0 */
, <19 0 &gpiob 1 0> /* PB1 */
, <20 0 &gpiob 2 0> /* PB2 */
, <21 0 &gpiob 10 0> /* PB10 */
, <25 0 &gpiob 12 0> /* PB12 */
, <26 0 &gpiob 13 0> /* PB13 */
, <27 0 &gpiob 14 0> /* PB14 */
, <28 0 &gpiob 15 0> /* PB15 */
, <29 0 &gpioa 8 0> /* PA8 */
, <30 0 &gpioa 9 0> /* PA9 */
, <31 0 &gpioa 10 0> /* PA10 */
, <38 0 &gpioa 15 0> /* PA15 */
, <39 0 &gpiob 3 0> /* PB3 */
, <40 0 &gpiob 4 0> /* PB4 */
, <41 0 &gpiob 5 0> /* PB5 */
, <42 0 &gpiob 6 0> /* PB6 */
, <43 0 &gpiob 7 0> /* PB7 */
, <45 0 &gpiob 8 0> /* PB8 */
, <46 0 &gpiob 9 0> /* PB9 */
;
};
};
blackpill_i2c: &i2c1 {};
blackpill_spi: &spi1 {};
blackpill_serial: &usart1 {};

View file

@ -3,5 +3,4 @@ CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n CONFIG_UART_CONSOLE=n
CONFIG_UART_INTERRUPT_DRIVEN=n CONFIG_UART_INTERRUPT_DRIVEN=n
CONFIG_ZMK_USB=y CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=n
CONFIG_ZMK_KSCAN_MATRIX_POLLING=y CONFIG_ZMK_KSCAN_MATRIX_POLLING=y

View file

@ -3,5 +3,4 @@ CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n CONFIG_UART_CONSOLE=n
CONFIG_UART_INTERRUPT_DRIVEN=n CONFIG_UART_INTERRUPT_DRIVEN=n
CONFIG_ZMK_USB=y CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=n
CONFIG_ZMK_KSCAN_MATRIX_POLLING=y CONFIG_ZMK_KSCAN_MATRIX_POLLING=y

View file

@ -27,6 +27,8 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-direct"; compatible = "zmk,kscan-gpio-direct";
wakeup-source;
input-gpios = input-gpios =
<&pro_micro 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, <&pro_micro 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, <&pro_micro 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,

View file

@ -28,6 +28,7 @@ RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(6,0) RC(6,1) RC(6,2)
kscan0: kscan_0 { kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
col-gpios col-gpios

View file

@ -28,6 +28,7 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -13,6 +13,8 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -13,6 +13,8 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -44,6 +44,8 @@
kscan0: kscan_0 { kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
col-gpios col-gpios

View file

@ -26,6 +26,7 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-direct"; compatible = "zmk,kscan-gpio-direct";
wakeup-source;
input-gpios input-gpios
= <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> = <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>

View file

@ -15,7 +15,7 @@
&mt { &mt {
flavor = "tap-preferred"; flavor = "tap-preferred";
tapping_term_ms = <140>; tapping-term-ms = <140>;
}; };
/ { / {

View file

@ -11,6 +11,8 @@
kscan0: kscan_0 { kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
col-gpios col-gpios

View file

@ -21,9 +21,6 @@ config I2C
config SSD1306 config SSD1306
default y default y
config SSD1306_REVERSE_MODE
default y
endif # ZMK_DISPLAY endif # ZMK_DISPLAY
if LVGL if LVGL
@ -31,7 +28,7 @@ if LVGL
config LV_Z_VDB_SIZE config LV_Z_VDB_SIZE
default 64 default 64
config LV_Z_DPI config LV_DPI_DEF
default 148 default 148
config LV_Z_BITS_PER_PIXEL config LV_Z_BITS_PER_PIXEL

View file

@ -47,6 +47,7 @@ RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios
@ -76,6 +77,7 @@ RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10
segment-remap; segment-remap;
com-invdir; com-invdir;
com-sequential; com-sequential;
inversion-on;
prechargep = <0x22>; prechargep = <0x22>;
}; };
}; };

View file

@ -46,9 +46,9 @@
// | SHFT | | | | | | | _ | + | { | } | "|" | ~ | // | SHFT | | | | | | | _ | + | { | } | "|" | ~ |
// | GUI | | SPC | | ENT | | ALT | // | GUI | | SPC | | ENT | | ALT |
bindings = < bindings = <
&kp TAB &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp BSPC &kp TAB &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &kp BSPC
&kp LCTRL &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE &kp LCTRL &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE
&kp LSHFT &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE &kp LSHFT &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE
&kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT &kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT
>; >;
}; };

View file

@ -27,6 +27,8 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-direct"; compatible = "zmk,kscan-gpio-direct";
wakeup-source;
input-gpios input-gpios
= <&pro_micro 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> = <&pro_micro 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> , <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>

View file

@ -13,6 +13,8 @@
kscan0: kscan_0 { kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
col-gpios col-gpios
@ -42,12 +44,13 @@
compatible = "alps,ec11"; compatible = "alps,ec11";
a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <2>; steps = <80>;
status = "okay"; status = "okay";
}; };
sensors { sensors: sensors {
compatible = "zmk,keymap-sensors"; compatible = "zmk,keymap-sensors";
sensors = <&encoder>; sensors = <&encoder>;
triggers-per-rotation = <20>;
}; };
}; };

View file

@ -26,6 +26,8 @@
kscan0: kscan_0 { kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
col-gpios col-gpios

View file

@ -24,9 +24,6 @@ config I2C
config SSD1306 config SSD1306
default y default y
config SSD1306_REVERSE_MODE
default y
endif # ZMK_DISPLAY endif # ZMK_DISPLAY
if LVGL if LVGL
@ -34,7 +31,7 @@ if LVGL
config LV_Z_VDB_SIZE config LV_Z_VDB_SIZE
default 64 default 64
config LV_Z_DPI config LV_DPI_DEF
default 148 default 148
config LV_Z_BITS_PER_PIXEL config LV_Z_BITS_PER_PIXEL

View file

@ -26,6 +26,7 @@ RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7)
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios
@ -53,6 +54,7 @@ RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7)
segment-remap; segment-remap;
com-invdir; com-invdir;
com-sequential; com-sequential;
inversion-on;
prechargep = <0x22>; prechargep = <0x22>;
}; };
}; };

View file

@ -35,6 +35,7 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,13) RC(4,12
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";

View file

@ -14,6 +14,7 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";

View file

@ -30,6 +30,7 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) /**/ RC(3,6) RC(3,9
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -32,6 +32,7 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,7) RC(4,8) RC(4,9
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -13,14 +13,14 @@
#define SYM_L 3 #define SYM_L 3
// Using layer taps on thumbs, having quick tap as well helps w/ repeating space/backspace // Using layer taps on thumbs, having quick tap as well helps w/ repeating space/backspace
&lt { quick_tap_ms = <200>; }; &lt { quick-tap-ms = <200>; };
/ { / {
behaviors { behaviors {
hm: homerow_mods { hm: homerow_mods {
compatible = "zmk,behavior-hold-tap"; compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>; #binding-cells = <2>;
tapping_term_ms = <225>; tapping-term-ms = <225>;
flavor = "tap-preferred"; flavor = "tap-preferred";
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
}; };

View file

@ -29,6 +29,8 @@
kscan0: kscan_0 { kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "row2col"; diode-direction = "row2col";
col-gpios col-gpios

View file

@ -32,6 +32,7 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,2) RC(4,9) RC(3,6) RC(3,7)
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -36,10 +36,10 @@
// | | | | | | | | | | | _ | + | { | } | "|" | // | | | | | | | | | | | _ | + | { | } | "|" |
// | | | | | | | | // | | | | | | | |
bindings = < bindings = <
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12
&kp GRAVE &kp EXCL &kp AT &kp HASH &kp DOLLAR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp TILDE &kp GRAVE &kp EXCL &kp AT &kp HASH &kp DOLLAR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &kp TILDE
&trans &trans &trans &trans &trans &trans &trans &trans &trans &kp MINUS &kp KP_PLUS &kp LBRC &kp RBRC &kp PIPE &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp MINUS &kp PLUS &kp LBRC &kp RBRC &kp PIPE
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>; >;
}; };

View file

@ -62,6 +62,7 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -13,8 +13,8 @@
#define RSE 2 #define RSE 2
#define ADJ 3 #define ADJ 3
&lt { quick_tap_ms = <200>; }; &lt { quick-tap-ms = <200>; };
&mt { quick_tap_ms = <200>; }; &mt { quick-tap-ms = <200>; };
/ { / {
keymap { keymap {

View file

@ -67,6 +67,7 @@
kscan0: kscan { kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row"; diode-direction = "col2row";
row-gpios row-gpios

View file

@ -22,9 +22,6 @@ config I2C
config SSD1306 config SSD1306
default y default y
config SSD1306_REVERSE_MODE
default y
endif # ZMK_DISPLAY endif # ZMK_DISPLAY
if LVGL if LVGL
@ -32,7 +29,7 @@ if LVGL
config LV_Z_VDB_SIZE config LV_Z_VDB_SIZE
default 64 default 64
config LV_Z_DPI config LV_DPI_DEF
default 148 default 148
config LV_Z_BITS_PER_PIXEL config LV_Z_BITS_PER_PIXEL

Some files were not shown because too many files have changed in this diff Show more