This commit is contained in:
David Barr 2020-11-16 16:44:19 +00:00
commit 46db1763b9
438 changed files with 44972 additions and 7553 deletions

4
.clang-format Normal file
View file

@ -0,0 +1,4 @@
BasedOnStyle: LLVM
IndentWidth: 4
ColumnLimit: 100
SortIncludes: false

8
.devcontainer/.bashrc Normal file
View file

@ -0,0 +1,8 @@
export LS_OPTIONS='-F --color=auto'
alias ls='ls $LS_OPTIONS'
if [ "${CODESPACES}" = "true" ]; then
export WORKSPACE_DIR="$HOME/workspace/zmk"
fi
if [ -f "$WORKSPACE_DIR/zephyr/zephyr-env.sh" ]; then
source "$WORKSPACE_DIR/zephyr/zephyr-env.sh"
fi

11
.devcontainer/Dockerfile Normal file
View file

@ -0,0 +1,11 @@
FROM zmkfirmware/zephyr-west-action-arm
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get install --no-install-recommends -y \
ssh \
gpg && \
rm -rf /var/lib/apt/lists/*
COPY .bashrc tmp
RUN mv /tmp/.bashrc ~/.bashrc

View file

@ -0,0 +1,11 @@
{
"name": "ZMK Development",
"dockerFile": "Dockerfile",
"extensions": ["ms-vscode.cpptools"],
"runArgs": ["--security-opt", "label=disable"],
"containerEnv": {"WORKSPACE_DIR": "${containerWorkspaceFolder}"},
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
}

6
.gitattributes vendored Normal file
View file

@ -0,0 +1,6 @@
* text=auto
# Always use Unix-style line endings for Bash scripts so they work in
# Docker on Windows.
.bashrc text eol=lf
*.sh text eol=lf

View file

@ -1,4 +1,10 @@
on: [push, pull_request] on:
push:
paths:
- "app/**"
pull_request:
paths:
- "app/**"
name: Build name: Build
@ -10,13 +16,22 @@ jobs:
matrix: matrix:
board: [proton_c, nice_nano, bluemicro840_v1, nrfmicro_13] board: [proton_c, nice_nano, bluemicro840_v1, nrfmicro_13]
shield: shield:
- boardsource3x4
- corne_left - corne_left
- corne_right - corne_right
- kyria_left - kyria_left
- kyria_right - kyria_right
- lily58_left - lily58_left
- lily58_right - lily58_right
- iris_left
- iris_right
- reviung41
- romac - romac
- romac_plus
- settings_reset
- quefrency_left
- quefrency_right
- nibble
include: include:
- board: proton_c - board: proton_c
shield: clueboard_california shield: clueboard_california
@ -69,7 +84,7 @@ jobs:
args: 'build "-s app -b ${{ matrix.board }} -- -DSHIELD=${{ matrix.shield }}"' args: 'build "-s app -b ${{ matrix.board }} -- -DSHIELD=${{ matrix.shield }}"'
- name: Archive Build - name: Archive Build
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
if: ${{ matrix.board == 'nice_nano' }} if: ${{ matrix.board != 'proton_c' }}
with: with:
name: "${{ matrix.board }}-${{ matrix.shield }}-zmk-uf2" name: "${{ matrix.board }}-${{ matrix.shield }}-zmk-uf2"
path: build/zephyr/zmk.uf2 path: build/zephyr/zmk.uf2

29
.github/workflows/clang-format-lint.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: clang-format-lint
on:
push:
paths:
- "app/boards/**/*.c"
- "app/include/**/*.h"
- "app/src/**"
- "app/drivers/**/*.c"
- "app/drivers/**/*.h"
pull_request:
paths:
- "app/boards/**/*.c"
- "app/include/**/*.h"
- "app/src/**"
- "app/drivers/**/*.c"
- "app/drivers/**/*.h"
jobs:
build:
runs-on: ubuntu-latest
name: clang-format lint
steps:
- uses: actions/checkout@v2
- uses: DoozyX/clang-format-lint-action@v0.9
with:
source: "./app"
extensions: "h,c"

35
.github/workflows/doc-checks.yml vendored Normal file
View file

@ -0,0 +1,35 @@
name: doc-checks
on:
push:
paths:
- "docs/**"
pull_request:
paths:
- "docs/**"
jobs:
lint:
runs-on: ubuntu-latest
name: ESLint
steps:
- uses: actions/checkout@v2
- uses: bahmutov/npm-install@v1
with:
working-directory: docs
- name: ESLint
run: npm run lint
working-directory: docs
prettier:
runs-on: ubuntu-latest
name: Prettier
steps:
- uses: actions/checkout@v2
- uses: bahmutov/npm-install@v1
with:
working-directory: docs
- name: Prettier Check
run: npm run prettier:check
working-directory: docs

View file

@ -1,4 +1,12 @@
on: [push, pull_request] on:
push:
paths:
- "app/tests/**"
- "app/src/**"
pull_request:
paths:
- "app/tests/**"
- "app/src/**"
name: Test name: Test

2
.gitignore vendored
View file

@ -3,4 +3,6 @@
/modules /modules
/tools /tools
/zephyr /zephyr
/zmk-config
/build /build
*.DS_Store

11
AUTHORS Normal file
View file

@ -0,0 +1,11 @@
# The ZMK Project consists of many contributors. This file includes individuals
# who have contributed significant changes to the project. To be added to here,
# please submit a PR to the project repo.
Peter Johanson (@petejohanson)
Innovaker (@innovaker)
Nick Winans (@Nicell)
Okke Formsma (@okke-formsma)
Cody McGinnis (@BrainWart)
Kurtis Lew (@kurtis-lew)
Richard Jones (@bmcgavin)
Kevin Chen (@chenkevinh)

120
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,120 @@
# Contributing To ZMK
Thanks for taking an interest in contributing to ZMK! After reading through the documentation, if
you have any questions, please come join us on the
[ZMK Discord Server][discord-invite].
## Code of Conduct
All community members are expected to abide by the [Code of Conduct][code-of-conduct].
For any and all conduct inquiries or concerns, please contact conduct@zmkfirmware.dev.
[code-of-conduct]: https://github.com/zmkfirmware/zmk/blob/main/CODE_OF_CONDUCT.md
## How Can I Contribute
There are many different ways that you can contribute to ZMK, several of which require no coding
abilities. These include:
- Chat Support
- Issue Reporting/Commenting
- Testing
- Documentation
- Code Contributions
## Chat Support
Providing user support on the [ZMK Discord Server][discord-invite] is a great way to help the
project. In particular, answering questions in the [#help](https://discord.com/channels/719497620560543766/719909884769992755) channel is incredibly appreciated.
## Issue Reporting/Commenting
Often, you might encounter unexpected behavior when building, flashing, or running the ZMK
firmware. Submitting or commenting on issues on GitHub is a great way to contribute to the
ZMK project.
### Before Submitting a Report
- Review the [Frequently Asked Questions](https://zmkfirmware.dev/docs/faq).
- Check the [Troubleshooting Guide](https://zmkfirmware.dev/docs/troubleshooting) for answers.
- Search the [open issues](https://github.com/zmkfirmware/zmk/issues) for an existing report that
matches your problem.
### Opening A Report
To open a report:
- Head to https://github.com/zmkfirmware/zmk/issues/new
- Provide an accurate summary of the issue in the title.
- Provide as much detail as you can about the issue including:
- What [board/shield](https://zmkfirmware.dev/docs/faq#what-is-a-board) you are using.
- A link to the user repository, if you used it to build your firmware.
- Exact steps to reproduce the problem.
- Any relevant screenshots or [logs](https://zmkfirmware.dev/docs/dev-guide-usb-logging)
## Testing
The `help wanted` label will be added to any [pull requests](https://github.com/zmkfirmware/zmk/pulls?q=is%3Aopen+is%3Apr+label%3A%22help+wanted%22)
or [issues](https://github.com/zmkfirmware/zmk/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
where user testing can assist the ZMK contributors to verify fixes, confirm
bugs, etc.
When providing testing feedback, please provide:
- Exact steps used to test
- Any hardware details relevant to testing
- Pass/fail summary for testing.
- Full details of any failures, including:
- Logs
- Screenshots
## Documentation
Quality documentation is a huge part of what makes a successful project. Contributions to add
documentation to areas not currently covered are greatly appreciated.
### Contributing
- The documentation site can be found in the main ZMK repo, in the
[docs/](https://github.com/zmkfirmware/zmk/tree/main/docs) subdirectory.
- The documentation is maintained using [Docusaurus V2](https://v2.docusaurus.io/docs/).
- To get started, from the `docs/` directory, run `npm ci` and then `npm start`.
- Enhancements should be submitted as pull requests to the `main` branch of ZMK.
## Code Contributions
### Development Setup
To get your development environment setup going, start at the
[basic setup](https://zmkfirmware.dev/docs/dev-setup) docs, and make sure you can build and flash
your own locally built firmware.
### Formatting
ZMK uses `clang-format` to ensure consist formatting for our source code. Before submitting your
changes, make sure you've manually run `clang-format`, or have your IDE configured to auto-format
on save.
### Commit Messages
The ZMK project is working towards, but not yet enforcing, the use of
[conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) for commit messages.
Further documentation and details will be provided here soon.
### Pull Requests
When opening a pull request with your changes, please:
- Submit the PR to the `main` branch of the
[`zmkfirmware/zmk`](https://github.com/zmkfirmware/zmk) repository.
- Use a descriptive title that summarizes the change.
- In the description, include:
- References to any open issues fixed by the PR.
- Feature added by the PR
- Bugs fixed by the PR.
- Testing you've performed locally.
- Requested testing by reviewers or testers.
- Screenshots or logs that support understanding the change.
[discord-invite]: https://zmkfirmware.dev/community/discord/invite

View file

@ -5,7 +5,7 @@
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
This project is a complete work in progress, with only basic things functioning. The goal is to explore a new MK firmware This project is a complete work in progress, with only basic things functioning. The goal is to explore a new MK firmware
with a less restritive license and better BLE support, built on top of the [Zephyr™ Project](https://www.zephyrproject.org/) with a less restrictive license and better BLE support, built on top of the [Zephyr™ Project](https://www.zephyrproject.org/)
Check out the website to learn more: https://zmkfirmware.dev/ Check out the website to learn more: https://zmkfirmware.dev/

View file

@ -23,38 +23,48 @@ zephyr_linker_sources(RODATA include/linker/zmk-events.ld)
# 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)
target_sources_ifdef(CONFIG_ZMK_SLEEP app PRIVATE src/power.c)
target_sources(app PRIVATE src/kscan.c) target_sources(app PRIVATE src/kscan.c)
target_sources(app PRIVATE src/matrix_transform.c) target_sources(app PRIVATE src/matrix_transform.c)
target_sources(app PRIVATE src/hid.c) target_sources(app PRIVATE src/hid.c)
target_sources(app PRIVATE src/sensors.c) target_sources(app PRIVATE src/sensors.c)
target_sources_ifdef(CONFIG_ZMK_DISPLAY app PRIVATE src/display.c) target_sources_ifdef(CONFIG_ZMK_DISPLAY app PRIVATE src/display.c)
target_sources(app PRIVATE src/event_manager.c) target_sources(app PRIVATE src/event_manager.c)
target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/ext_power_generic.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/keycode_state_changed.c) target_sources(app PRIVATE src/events/keycode_state_changed.c)
target_sources(app PRIVATE src/events/modifiers_state_changed.c) target_sources(app PRIVATE src/events/modifiers_state_changed.c)
target_sources(app PRIVATE src/events/sensor_event.c) target_sources(app PRIVATE src/events/sensor_event.c)
target_sources(app PRIVATE src/behaviors/behavior_key_press.c) target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/events/ble_active_profile_changed.c)
target_sources(app PRIVATE src/behaviors/behavior_reset.c) target_sources_ifdef(CONFIG_USB app PRIVATE src/events/usb_conn_state_changed.c)
target_sources(app PRIVATE src/behaviors/behavior_hold_tap.c) if (NOT CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL)
target_sources(app PRIVATE src/behaviors/behavior_momentary_layer.c) target_sources(app PRIVATE src/behaviors/behavior_key_press.c)
target_sources(app PRIVATE src/behaviors/behavior_toggle_layer.c) target_sources(app PRIVATE src/behaviors/behavior_reset.c)
target_sources(app PRIVATE src/behaviors/behavior_transparent.c) target_sources(app PRIVATE src/behaviors/behavior_hold_tap.c)
target_sources(app PRIVATE src/behaviors/behavior_none.c) target_sources(app PRIVATE src/behaviors/behavior_momentary_layer.c)
target_sources(app PRIVATE src/behaviors/behavior_sensor_rotate_key_press.c) target_sources(app PRIVATE src/behaviors/behavior_outputs.c)
target_sources(app PRIVATE src/keymap.c) target_sources(app PRIVATE src/behaviors/behavior_toggle_layer.c)
target_sources(app PRIVATE src/behaviors/behavior_transparent.c)
target_sources(app PRIVATE src/behaviors/behavior_none.c)
target_sources(app PRIVATE src/behaviors/behavior_sensor_rotate_key_press.c)
target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/behaviors/behavior_ext_power.c)
target_sources(app PRIVATE src/keymap.c)
endif()
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/behaviors/behavior_rgb_underglow.c) target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/behaviors/behavior_rgb_underglow.c)
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/behaviors/behavior_bt.c)
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/ble.c) target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/ble.c)
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/ble_unpair_combo.c) target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/battery.c)
target_sources_ifdef(CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL app PRIVATE src/split_listener.c) target_sources_ifdef(CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL app PRIVATE src/split_listener.c)
target_sources_ifdef(CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL app PRIVATE src/split/bluetooth/service.c) target_sources_ifdef(CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL app PRIVATE src/split/bluetooth/service.c)
target_sources_ifdef(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL app PRIVATE src/split/bluetooth/central.c) target_sources_ifdef(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL app PRIVATE src/split/bluetooth/central.c)
target_sources_ifdef(CONFIG_ZMK_KSCAN_MOCK_DRIVER app PRIVATE src/kscan_mock.c) target_sources_ifdef(CONFIG_ZMK_KSCAN_MOCK_DRIVER app PRIVATE src/kscan_mock.c)
target_sources_ifdef(CONFIG_ZMK_KSCAN_COMPOSITE_DRIVER app PRIVATE src/kscan_composite.c) target_sources_ifdef(CONFIG_ZMK_KSCAN_COMPOSITE_DRIVER app PRIVATE src/kscan_composite.c)
target_sources_ifdef(CONFIG_ZMK_USB app PRIVATE src/usb_hid.c) target_sources_ifdef(CONFIG_USB app PRIVATE src/usb.c)
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/hog.c) target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/hog.c)
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/rgb_underglow.c) target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/rgb_underglow.c)
target_sources(app PRIVATE src/endpoints.c) target_sources(app PRIVATE src/endpoints.c)
target_sources(app PRIVATE src/hid_listener.c) target_sources(app PRIVATE src/hid_listener.c)
target_sources_ifdef(CONFIG_SETTINGS app PRIVATE src/settings.c)
target_sources(app PRIVATE src/main.c) target_sources(app PRIVATE src/main.c)
zephyr_cc_option(-Wfatal-errors) zephyr_cc_option(-Wfatal-errors)

View file

@ -1,5 +1,9 @@
mainmenu "ZMK Firmware" mainmenu "ZMK Firmware"
menu "ZMK"
menu "Basic Keyboard Setup"
config ZMK_KEYBOARD_NAME config ZMK_KEYBOARD_NAME
string "Keyboard Name" string "Keyboard Name"
@ -9,13 +13,18 @@ config USB_DEVICE_PRODUCT
config BT_DEVICE_NAME config BT_DEVICE_NAME
default ZMK_KEYBOARD_NAME default ZMK_KEYBOARD_NAME
config ZMK_KSCAN_EVENT_QUEUE_SIZE config USB_DEVICE_VID
int "Size of the event queue for KSCAN events to buffer events" default 0x1D50
default 4
config USB_DEVICE_PID
default 0x615E
config USB_DEVICE_MANUFACTURER
default "ZMK Project"
menu "HID Output Types" menu "HID Output Types"
menuconfig ZMK_USB config ZMK_USB
bool "USB" bool "USB"
select USB select USB
select USB_DEVICE_STACK select USB_DEVICE_STACK
@ -23,35 +32,33 @@ menuconfig ZMK_USB
if ZMK_USB if ZMK_USB
config ZMK_USB_INIT_PRIORITY
int "Init Priority"
default 50
config USB_NUMOF_EP_WRITE_RETRIES config USB_NUMOF_EP_WRITE_RETRIES
default 10 default 10
#ZMK_USB
endif endif
menuconfig ZMK_BLE config ZMK_BLE
bool "BLE (HID over GATT)" bool "BLE (HID over GATT)"
select BT select BT
select BT_SMP select BT_SMP
select BT_SMP_SC_PAIR_ONLY select BT_SMP_SC_PAIR_ONLY
select BT_SMP_APP_PAIRING_ACCEPT
select BT_PERIPHERAL select BT_PERIPHERAL
select BT_GATT_DIS select BT_GATT_DIS
select BT_GATT_BAS select BT_GATT_BAS
select BT_SETTINGS
select SETTINGS select SETTINGS
# select BT_SETTINGS
if ZMK_BLE if ZMK_BLE
config ZMK_BLE_INIT_PRIORITY
int "Init Priority"
default 50
config SYSTEM_WORKQUEUE_STACK_SIZE config SYSTEM_WORKQUEUE_STACK_SIZE
default 2048 default 2048
config ZMK_BLE_CLEAR_BONDS_ON_START
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
default n default n
@ -63,19 +70,12 @@ config ZMK_BLE_PASSKEY_ENTRY
bool "Experimental: Requiring typing passkey from host to pair BLE connection" bool "Experimental: Requiring typing passkey from host to pair BLE connection"
default n default n
#ZMK_BLE
endif endif
#HID Output Types
endmenu endmenu
config ZMK_DISPLAY
bool "ZMK display support"
default n
select DISPLAY
select LVGL
select LVGL_THEMES
select LVGL_THEME_MONO
select LVGL_OBJ_LABEL
menu "Split Support" menu "Split Support"
config ZMK_SPLIT config ZMK_SPLIT
@ -101,17 +101,6 @@ config ZMK_SPLIT_BLE_ROLE_CENTRAL
select BT_CENTRAL select BT_CENTRAL
select BT_GATT_CLIENT select BT_GATT_CLIENT
if ZMK_SPLIT_BLE_ROLE_CENTRAL
config BT_MAX_CONN
default 5
config BT_MAX_PAIRED
# Bump this everywhere once we support switching active connections!
default 2
endif
config ZMK_SPLIT_BLE_ROLE_PERIPHERAL config ZMK_SPLIT_BLE_ROLE_PERIPHERAL
bool "Peripheral" bool "Peripheral"
@ -120,48 +109,81 @@ if ZMK_SPLIT_BLE_ROLE_PERIPHERAL
config ZMK_USB config ZMK_USB
default n default n
config BT_MAX_PAIRED
default 1
config BT_MAX_CONN config BT_MAX_CONN
default 5 default 1
config BT_GAP_AUTO_UPDATE_CONN_PARAMS config BT_GAP_AUTO_UPDATE_CONN_PARAMS
default n default n
#ZMK_SPLIT_BLE_ROLE_PERIPHERAL
endif endif
#ZMK_SPLIT_BLE_ROLE
endchoice endchoice
#ZMK_SPLIT_BLE
endif endif
#ZMK_SPLIT
endif endif
if ZMK_BLE
if ZMK_SPLIT_BLE && ZMK_SPLIT_BLE_ROLE_CENTRAL
config BT_MAX_CONN
default 6
config BT_MAX_PAIRED
default 6
#ZMK_SPLIT_BLE && ZMK_SPLIT_BLE_ROLE_CENTRAL
endif
if !ZMK_SPLIT_BLE
config BT_MAX_CONN
default 5
config BT_MAX_PAIRED
default 5
#!ZMK_SPLIT_BLE
endif
#ZMK_BLE
endif
#Split Support
endmenu endmenu
#Basic Keyboard Setup
config ZMK_KSCAN_MOCK_DRIVER
bool "Enable mock kscan driver to simulate key presses"
default n
config ZMK_KSCAN_COMPOSITE_DRIVER
bool "Enable composite kscan driver to combine kscan devices"
default n
menu "ZMK Actions"
config ZMK_ACTION_MOD_TAP
bool "Enable the Mod-Tap Action"
endmenu endmenu
menu "ZMK Lighting" menu "Display/LED Options"
menuconfig ZMK_RGB_UNDERGLOW config ZMK_DISPLAY
bool "ZMK display support"
default n
select DISPLAY
select LVGL
select LVGL_THEMES
select LVGL_THEME_MONO
select LVGL_OBJ_LABEL
config ZMK_RGB_UNDERGLOW
bool "RGB Adressable LED Underglow" bool "RGB Adressable LED Underglow"
select LED_STRIP select LED_STRIP
if ZMK_RGB_UNDERGLOW if ZMK_RGB_UNDERGLOW
# This default value cuts down on tons of excess .conf files, if you're using GPIO, manually disable this
config SPI
default y
config ZMK_RGB_UNDERGLOW_HUE_STEP config ZMK_RGB_UNDERGLOW_HUE_STEP
int "RGB underglow hue step in degrees of 360" int "RGB underglow hue step in degrees of 360"
default 10 default 10
@ -174,8 +196,111 @@ config ZMK_RGB_UNDERGLOW_BRT_STEP
int "RGB underglow brightness step in percent" int "RGB underglow brightness step in percent"
default 10 default 10
config ZMK_RGB_UNDERGLOW_HUE_START
int "RGB underglow start hue value from 0-359"
default 0
config ZMK_RGB_UNDERGLOW_SAT_START
int "RGB underglow start saturations value from 0-100"
default 100
config ZMK_RGB_UNDERGLOW_BRT_START
int "RGB underglow start brightness value from 0-100"
default 100
config ZMK_RGB_UNDERGLOW_SPD_START
int "RGB underglow start animation speed value from 1-5"
default 3
config ZMK_RGB_UNDERGLOW_EFF_START
int "RGB underglow start effect int value related to the effect enum list"
default 0
config ZMK_RGB_UNDERGLOW_ON_START
bool "Whether RGB underglow starts on by default"
default y
#ZMK_RGB_UNDERGLOW
endif endif
#Display/LED Options
endmenu
menu "Power Management"
config ZMK_SLEEP
bool "Enable deep sleep support"
imply USB
if ZMK_SLEEP
config SYS_POWER_DEEP_SLEEP_STATES
default y
choice SYS_PM_POLICY
default SYS_PM_POLICY_APP
endchoice
config ZMK_IDLE_SLEEP_TIMEOUT
int "Milliseconds to wait to sleep when going idle"
default 900000
#ZMK_SLEEP
endif
config ZMK_EXT_POWER
bool "Enable support to control external power output"
default y
#Power Management
endmenu
menu "Advanced"
menu "Initialization Priorities"
if USB
config ZMK_USB_INIT_PRIORITY
int "USB Init Priority"
default 50
#USB
endif
if ZMK_BLE || ZMK_SPLIT_BLE
config ZMK_BLE_INIT_PRIORITY
int "BLE Init Priority"
default 50
#ZMK_BLE || ZMK_SPLIT_BLE
endif
#Initialization Priorities
endmenu
menu "KSCAN Settings"
config ZMK_KSCAN_EVENT_QUEUE_SIZE
int "Size of the event queue for KSCAN events to buffer events"
default 4
config ZMK_KSCAN_MOCK_DRIVER
bool "Enable mock kscan driver to simulate key presses"
default n
config ZMK_KSCAN_COMPOSITE_DRIVER
bool "Enable composite kscan driver to combine kscan devices"
default n
#KSCAN Settings
endmenu
#Advanced
endmenu
#ZMK
endmenu endmenu
config HEAP_MEM_POOL_SIZE config HEAP_MEM_POOL_SIZE

View file

@ -27,4 +27,7 @@ config ZMK_BLE
config ZMK_USB config ZMK_USB
default y default y
config ZMK_BATTERY_VOLTAGE_DIVIDER
default y
endif # BOARD_BLUEMICRO840_V1 endif # BOARD_BLUEMICRO840_V1

View file

@ -14,9 +14,6 @@
chosen { chosen {
zephyr,code-partition = &code_partition; zephyr,code-partition = &code_partition;
// zephyr,console = &uart0;
//zephyr,bt-mon-uart = &uart0;
//zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
}; };
@ -29,6 +26,28 @@
}; };
}; };
ext-power {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
};
vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 7>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 806000)>;
};
};
&adc {
status = "okay";
};
&gpiote {
status = "okay";
}; };
&gpio0 { &gpio0 {
@ -49,10 +68,10 @@
compatible = "nordic,nrf-uarte"; compatible = "nordic,nrf-uarte";
status = "okay"; status = "okay";
current-speed = <115200>; current-speed = <115200>;
tx-pin = <39>; tx-pin = <19>;
rx-pin = <34>; rx-pin = <21>;
rts-pin = <33>; rts-pin = <23>;
cts-pin = <12>; cts-pin = <25>;
}; };
&usbd { &usbd {
@ -70,27 +89,32 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
boot_partition: partition@0 { sd_partition: partition@0 {
label = "adafruit_boot"; label = "softdevice";
reg = <0x000000000 0x0000C000>; reg = <0x00000000 0x00026000>;
}; };
code_partition: partition@26000 { code_partition: partition@26000 {
label = "code_partition"; label = "code_partition";
reg = <0x00026000 0x000d2000>; reg = <0x00026000 0x000c6000>;
}; };
/* /*
* The flash starting at 0x000f8000 and ending at * The flash starting at 0x000ec000 and ending at
* 0x000fffff is reserved for use by the application. * 0x000f3fff is reserved for use by the application.
*/ */
/* /*
* Storage partition will be used by FCB/LittleFS/NVS * Storage partition will be used by FCB/LittleFS/NVS
* if enabled. * if enabled.
*/ */
storage_partition: partition@f8000 { storage_partition: partition@ec000 {
label = "storage"; label = "storage";
reg = <0x000f8000 0x00008000>; reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
}; };
}; };
}; };

View file

@ -0,0 +1,7 @@
# SPDX-License-Identifier: MIT
if(CONFIG_PINMUX)
zephyr_library()
zephyr_library_sources(pinmux.c)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
endif()

View file

@ -0,0 +1,6 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_DZ60RGB_REV1
bool "DZ60RGB Keyboard"
depends on SOC_STM32F303XC

View file

@ -0,0 +1,14 @@
# DZ60RGB keyboard configuration
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
if BOARD_DZ60RGB_REV1
config ZMK_KEYBOARD_NAME
default "DZ60RGB Rev 1"
config ZMK_USB
default y
endif # BOARD_DZ60RGB_REV1

View file

@ -0,0 +1,7 @@
# SPDX-License-Identifier: MIT
board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse")
board_runner_args(jlink "--device=STM32F303CC" "--speed=4000")
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -0,0 +1,88 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/dts-v1/;
#include <st/f3/stm32f303Xc.dtsi>
#include <dt-bindings/zmk/matrix-transform.h>
/ {
model = "DZ60RGB, Rev 1";
compatible = "dz60rgb,rev1", "st,stm32f303";
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <14>;
rows = <5>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13)
RC(2,0) 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) RC(2,11) RC(2,13)
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,13)
RC(4,0) RC(4,1) RC(4,2) RC(4,5) RC(4,8) RC(4,9) RC(4,10) RC(4,11) RC(4,13)
>;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
row-gpios
= <&gpioa 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpiob 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpiob 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpiob 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpiob 12 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
col-gpios
= <&gpioa 6 GPIO_ACTIVE_HIGH>
, <&gpioa 7 GPIO_ACTIVE_HIGH>
, <&gpiob 0 GPIO_ACTIVE_HIGH>
, <&gpiob 13 GPIO_ACTIVE_HIGH>
, <&gpiob 15 GPIO_ACTIVE_HIGH>
, <&gpioa 8 GPIO_ACTIVE_HIGH>
, <&gpioa 15 GPIO_ACTIVE_HIGH>
, <&gpiob 3 GPIO_ACTIVE_HIGH>
, <&gpiob 4 GPIO_ACTIVE_HIGH>
, <&gpiob 5 GPIO_ACTIVE_HIGH>
, <&gpiob 8 GPIO_ACTIVE_HIGH>
, <&gpiob 9 GPIO_ACTIVE_HIGH>
, <&gpioc 13 GPIO_ACTIVE_HIGH>
, <&gpioc 14 GPIO_ACTIVE_HIGH>
;
};
};
&usb {
status = "okay";
};
&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* Set 6Kb of storage at the end of the 256Kb of flash */
storage_partition: partition@3e800 {
label = "storage";
reg = <0x0003e800 0x00001800>;
};
};
};

View file

@ -0,0 +1,25 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | "|" |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
// | SHIFT | Z | X | C | V | B | N | M | , | . | SHIFT(/) | ^ | DEL |
// | CTL | WIN | ALT | SPACE | ALT | MO(1) | <- | v | -> |
// ------------------------------------------------------------------------------------------
bindings = <
&kp ESC &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0 &kp MINUS &kp EQL &kp BKSP
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH
&kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SCLN &kp QUOT &kp RET
&kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp CMMA &kp DOT &mt MOD_RSFT FSLH &kp UARW &kp DEL
&kp LCTL &kp LGUI &kp LALT &kp SPC &kp RALT &mo 1 &kp LARW &kp DARW &kp RARW
>;
};
};
};

View file

@ -0,0 +1,19 @@
identifier: DZ60RGB_rev1
name: DZ60RGBREV1
type: keyboard
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 40
supported:
- gpio
- i2c
- counter
- spi
- usb_device
- lsm303dlhc
- nvs
- can
- kscan

View file

@ -0,0 +1,27 @@
# SPDX-License-Identifier: MIT
CONFIG_SOC_SERIES_STM32F3X=y
CONFIG_SOC_STM32F303XC=y
# 72MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000
# enable pinmux
CONFIG_PINMUX=y
# enable GPIO
CONFIG_GPIO=y
# clock configuration
CONFIG_CLOCK_CONTROL=y
# Clock configuration for Cube Clock control driver
CONFIG_CLOCK_STM32_HSE_CLOCK=8000000
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# use HSE as PLL input
CONFIG_CLOCK_STM32_PLL_SRC_HSE=y
# produce 72MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_PREDIV=1
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=2
CONFIG_CLOCK_STM32_APB2_PRESCALER=1

View file

@ -0,0 +1,67 @@
/*
* Copyright (c) 2017 I-SENSE group of ICCS
*
* SPDX-License-Identifier: MIT
*/
#include <kernel.h>
#include <device.h>
#include <init.h>
#include <drivers/pinmux.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>
/* pin assignments for STM32F3DISCOVERY board */
static const struct pin_config pinconf[] = {
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usart1), okay) && CONFIG_SERIAL
{STM32_PIN_PC4, STM32F3_PINMUX_FUNC_PC4_USART1_TX},
{STM32_PIN_PC5, STM32F3_PINMUX_FUNC_PC5_USART1_RX},
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usart2), okay) && CONFIG_SERIAL
{STM32_PIN_PA2, STM32F3_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F3_PINMUX_FUNC_PA3_USART2_RX},
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C
{STM32_PIN_PB6, STM32F3_PINMUX_FUNC_PB6_I2C1_SCL},
{STM32_PIN_PB7, STM32F3_PINMUX_FUNC_PB7_I2C1_SDA},
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C
{STM32_PIN_PA9, STM32F3_PINMUX_FUNC_PA9_I2C2_SCL},
{STM32_PIN_PA10, STM32F3_PINMUX_FUNC_PA10_I2C2_SDA},
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI
#ifdef CONFIG_SPI_STM32_USE_HW_SS
{STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS},
#endif /* CONFIG_SPI_STM32_USE_HW_SS */
{STM32_PIN_PA5, STM32F3_PINMUX_FUNC_PA5_SPI1_SCK},
{STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO},
{STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI},
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI
#ifdef CONFIG_SPI_STM32_USE_HW_SS
{STM32_PIN_PB12, STM32F3_PINMUX_FUNC_PB12_SPI2_NSS},
#endif /* CONFIG_SPI_STM32_USE_HW_SS */
{STM32_PIN_PB13, STM32F3_PINMUX_FUNC_PB13_SPI2_SCK},
{STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO},
{STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI},
#endif
#ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F3_PINMUX_FUNC_PA11_USB_DM},
{STM32_PIN_PA12, STM32F3_PINMUX_FUNC_PA12_USB_DP},
#endif /* CONFIG_USB_DC_STM32 */
#if DT_NODE_HAS_STATUS(DT_NODELABEL(can1), okay) && CONFIG_CAN
{STM32_PIN_PD0, STM32F3_PINMUX_FUNC_PD0_CAN1_RX},
{STM32_PIN_PD1, STM32F3_PINMUX_FUNC_PD1_CAN1_TX},
#endif
};
static int pinmux_stm32_init(struct device *port) {
ARG_UNUSED(port);
stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));
return 0;
}
SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1, CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);

View file

@ -25,4 +25,7 @@ config ZMK_BLE
config ZMK_USB config ZMK_USB
default y default y
config ZMK_BATTERY_VOLTAGE_DIVIDER
default y
endif # BOARD_NICE_NANO endif # BOARD_NICE_NANO

View file

@ -14,9 +14,6 @@
chosen { chosen {
zephyr,code-partition = &code_partition; zephyr,code-partition = &code_partition;
// zephyr,console = &uart0;
//zephyr,bt-mon-uart = &uart0;
//zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
}; };
@ -29,6 +26,27 @@
}; };
}; };
ext-power {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
};
vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 2>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 806000)>;
};
};
&adc {
status = "okay";
};
&gpiote {
status = "okay";
}; };
&gpio0 { &gpio0 {
@ -49,10 +67,10 @@
compatible = "nordic,nrf-uarte"; compatible = "nordic,nrf-uarte";
status = "okay"; status = "okay";
current-speed = <115200>; current-speed = <115200>;
tx-pin = <39>; tx-pin = <19>;
rx-pin = <34>; rx-pin = <21>;
rts-pin = <33>; rts-pin = <23>;
cts-pin = <12>; cts-pin = <25>;
}; };
&usbd { &usbd {
@ -70,27 +88,32 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
boot_partition: partition@0 { sd_partition: partition@0 {
label = "adafruit_boot"; label = "softdevice";
reg = <0x000000000 0x0000C000>; reg = <0x00000000 0x00026000>;
}; };
code_partition: partition@26000 { code_partition: partition@26000 {
label = "code_partition"; label = "code_partition";
reg = <0x00026000 0x000d2000>; reg = <0x00026000 0x000c6000>;
}; };
/* /*
* The flash starting at 0x000f8000 and ending at * The flash starting at 0x000ec000 and ending at
* 0x000fffff is reserved for use by the application. * 0x000f3fff is reserved for use by the application.
*/ */
/* /*
* Storage partition will be used by FCB/LittleFS/NVS * Storage partition will be used by FCB/LittleFS/NVS
* if enabled. * if enabled.
*/ */
storage_partition: partition@f8000 { storage_partition: partition@ec000 {
label = "storage"; label = "storage";
reg = <0x000f8000 0x00008000>; reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
}; };
}; };
}; };

View file

@ -0,0 +1,13 @@
#
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/../tools/uf2/utils/uf2conv.py
-c
-b 0x26000
-f 0xADA52840
-o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.uf2
${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
)

View file

@ -0,0 +1,10 @@
#
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default y
depends on BOARD_NRF52840_M2

View file

@ -0,0 +1,10 @@
# Maker Diary nrf52840 M.2 board configuration
#
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
config BOARD_NRF52840_M2
bool "nrf52480_m2"
depends on SOC_NRF52840_QIAA

View file

@ -0,0 +1,30 @@
#
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
if BOARD_NRF52840_M2
config BOARD
default "nrf52480_m2"
if USB
config USB_NRFX
default y
config USB_DEVICE_STACK
default y
endif # USB
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
endif # BOARD_NRF52840_M2

View file

@ -0,0 +1,9 @@
#
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)

View file

@ -0,0 +1,107 @@
/*
* Copyright (c) 2020 The ZMK Contributors
* SPDX-License-Identifier: MIT
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
/ {
model = "Makerdiary nRF52840 M.2 module";
compatible = "makerdiary,nrf52840_m2";
chosen {
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
leds {
compatible = "gpio-leds";
red_led: led_0 {
gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
label = "Red LED";
};
green_led: led_1 {
gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
label = "Green LED";
};
blue_led: led_2 {
gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};
};
&adc {
status = "okay";
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&uart0 {
compatible = "nordic,nrf-uarte";
status = "okay";
current-speed = <115200>;
tx-pin = <19>;
rx-pin = <21>;
rts-pin = <23>;
cts-pin = <25>;
};
&usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
sd_partition: partition@0 {
label = "softdevice";
reg = <0x00000000 0x00026000>;
};
code_partition: partition@26000 {
label = "code_partition";
reg = <0x00026000 0x000c6000>;
};
/*
* The flash starting at 0x000ec000 and ending at
* 0x000f3fff is reserved for use by the application.
*/
/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@ec000 {
label = "storage";
reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
};
};
};

View file

@ -0,0 +1,15 @@
identifier: nrf52840_m2
name: Makerdiary nRF52840 M.2 module
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- adc
- usb_device
- ble
- ieee802154
- pwm
- watchdog

View file

@ -0,0 +1,23 @@
#
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_NRF52840_M2=y
# Enable MPU
CONFIG_ARM_MPU=y
# enable GPIO
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y

View file

@ -1,6 +1,6 @@
# nrfmicro board configuration # nrfmicro board configuration
# Copyright (c) 2020 Okke Formsma, joric # Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
config BOARD_NRFMICRO_11 config BOARD_NRFMICRO_11

View file

@ -1,6 +1,6 @@
# Electronut Labs Papyr board configuration # Electronut Labs Papyr board configuration
# Copyright (c) 2020 Okke Formsma, joric # Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
if BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13 if BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13
@ -35,6 +35,9 @@ if BOARD_NRFMICRO_13
config BOARD_NRFMICRO_CHARGER config BOARD_NRFMICRO_CHARGER
default y default y
config ZMK_BATTERY_VOLTAGE_DIVIDER
default y
endif # BOARD_NRFMICRO_13 endif # BOARD_NRFMICRO_13
endif # BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13 endif # BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020 Okke Formsma, joric * Copyright (c) 2020 The ZMK Contributors
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020 Okke Formsma, joric * Copyright (c) 2020 The ZMK Contributors
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020 Okke Formsma, joric * Copyright (c) 2020 The ZMK Contributors
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
*/ */
@ -26,6 +26,15 @@
}; };
}; };
ext-power {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
};
};
&gpiote {
status = "okay";
}; };
&gpio0 { &gpio0 {
@ -46,10 +55,10 @@
compatible = "nordic,nrf-uarte"; compatible = "nordic,nrf-uarte";
status = "okay"; status = "okay";
current-speed = <115200>; current-speed = <115200>;
tx-pin = <39>; tx-pin = <19>;
rx-pin = <34>; rx-pin = <21>;
rts-pin = <33>; rts-pin = <23>;
cts-pin = <12>; cts-pin = <25>;
}; };
&usbd { &usbd {
@ -67,27 +76,32 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
boot_partition: partition@0 { sd_partition: partition@0 {
label = "adafruit_boot"; label = "softdevice";
reg = <0x000000000 0x0000C000>; reg = <0x00000000 0x00026000>;
}; };
code_partition: partition@26000 { code_partition: partition@26000 {
label = "code_partition"; label = "code_partition";
reg = <0x00026000 0x000d2000>; reg = <0x00026000 0x000c6000>;
}; };
/* /*
* The flash starting at 0x000f8000 and ending at * The flash starting at 0x000ec000 and ending at
* 0x000fffff is reserved for use by the application. * 0x000f3fff is reserved for use by the application.
*/ */
/* /*
* Storage partition will be used by FCB/LittleFS/NVS * Storage partition will be used by FCB/LittleFS/NVS
* if enabled. * if enabled.
*/ */
storage_partition: partition@f8000 { storage_partition: partition@ec000 {
label = "storage"; label = "storage";
reg = <0x000f8000 0x00008000>; reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
}; };
}; };
}; };

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020 Okke Formsma, joric * Copyright (c) 2020 The ZMK Contributors
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
*/ */
@ -26,6 +26,15 @@
}; };
}; };
ext-power {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
};
};
&gpiote {
status = "okay";
}; };
&gpio0 { &gpio0 {
@ -46,10 +55,10 @@
compatible = "nordic,nrf-uarte"; compatible = "nordic,nrf-uarte";
status = "okay"; status = "okay";
current-speed = <115200>; current-speed = <115200>;
tx-pin = <39>; tx-pin = <19>;
rx-pin = <34>; rx-pin = <21>;
rts-pin = <33>; rts-pin = <23>;
cts-pin = <12>; cts-pin = <25>;
}; };
&usbd { &usbd {
@ -67,27 +76,32 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
boot_partition: partition@0 { sd_partition: partition@0 {
label = "adafruit_boot"; label = "softdevice";
reg = <0x000000000 0x0000C000>; reg = <0x00000000 0x00026000>;
}; };
code_partition: partition@26000 { code_partition: partition@26000 {
label = "code_partition"; label = "code_partition";
reg = <0x00026000 0x000d2000>; reg = <0x00026000 0x000c6000>;
}; };
/* /*
* The flash starting at 0x000f8000 and ending at * The flash starting at 0x000ec000 and ending at
* 0x000fffff is reserved for use by the application. * 0x000f3fff is reserved for use by the application.
*/ */
/* /*
* Storage partition will be used by FCB/LittleFS/NVS * Storage partition will be used by FCB/LittleFS/NVS
* if enabled. * if enabled.
*/ */
storage_partition: partition@f8000 { storage_partition: partition@ec000 {
label = "storage"; label = "storage";
reg = <0x000f8000 0x00008000>; reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
}; };
}; };
}; };

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020 Okke Formsma, joric * Copyright (c) 2020 The ZMK Contributors
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
*/ */
@ -26,6 +26,27 @@
}; };
}; };
ext-power {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
};
vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 2>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 820000)>;
};
};
&adc {
status = "okay";
};
&gpiote {
status = "okay";
}; };
&gpio0 { &gpio0 {
@ -46,10 +67,10 @@
compatible = "nordic,nrf-uarte"; compatible = "nordic,nrf-uarte";
status = "okay"; status = "okay";
current-speed = <115200>; current-speed = <115200>;
tx-pin = <39>; tx-pin = <19>;
rx-pin = <34>; rx-pin = <21>;
rts-pin = <33>; rts-pin = <23>;
cts-pin = <12>; cts-pin = <25>;
}; };
&usbd { &usbd {
@ -67,27 +88,32 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
boot_partition: partition@0 { sd_partition: partition@0 {
label = "adafruit_boot"; label = "softdevice";
reg = <0x000000000 0x0000C000>; reg = <0x00000000 0x00026000>;
}; };
code_partition: partition@26000 { code_partition: partition@26000 {
label = "code_partition"; label = "code_partition";
reg = <0x00026000 0x000d2000>; reg = <0x00026000 0x000c6000>;
}; };
/* /*
* The flash starting at 0x000f8000 and ending at * The flash starting at 0x000ec000 and ending at
* 0x000fffff is reserved for use by the application. * 0x000f3fff is reserved for use by the application.
*/ */
/* /*
* Storage partition will be used by FCB/LittleFS/NVS * Storage partition will be used by FCB/LittleFS/NVS
* if enabled. * if enabled.
*/ */
storage_partition: partition@f8000 { storage_partition: partition@ec000 {
label = "storage"; label = "storage";
reg = <0x000f8000 0x00008000>; reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
}; };
}; };
}; };

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020 Okke Formsma, joric * Copyright (c) 2020 The ZMK Contributors
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
*/ */
@ -11,31 +11,19 @@
#include <sys/sys_io.h> #include <sys/sys_io.h>
#include <devicetree.h> #include <devicetree.h>
static int pinmux_nrfmicro_init(struct device *port) static int pinmux_nrfmicro_init(struct device *port) {
{ ARG_UNUSED(port);
ARG_UNUSED(port);
struct device *p1 = device_get_binding("GPIO_1");
#if CONFIG_BOARD_NRFMICRO_13 #if CONFIG_BOARD_NRFMICRO_13
struct device *p0 = device_get_binding("GPIO_0"); struct device *p0 = device_get_binding("GPIO_0");
// enable EXT_VCC (use 0 for nRFMicro 1.3, use 1 for nRFMicro 1.1)
gpio_pin_configure(p1, 9, GPIO_OUTPUT);
gpio_pin_set(p1, 9, 0);
#if CONFIG_BOARD_NRFMICRO_CHARGER #if CONFIG_BOARD_NRFMICRO_CHARGER
gpio_pin_configure(p0, 5, GPIO_OUTPUT); gpio_pin_configure(p0, 5, GPIO_OUTPUT);
gpio_pin_set(p0, 5, 0); gpio_pin_set(p0, 5, 0);
#else #else
gpio_pin_configure(p0, 5, GPIO_INPUT); gpio_pin_configure(p0, 5, GPIO_INPUT);
#endif #endif
#else
// enable EXT_VCC (use 0 for nRFMicro 1.3, use 1 for nRFMicro 1.1)
gpio_pin_configure(p1, 9, GPIO_OUTPUT);
gpio_pin_set(p1, 9, 1);
#endif #endif
return 0; return 0;
} }
SYS_INIT(pinmux_nrfmicro_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); SYS_INIT(pinmux_nrfmicro_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);

View file

@ -1,6 +1,6 @@
# Planck V6 board configuration # Planck V6 board configuration
# Copyright (c) 2020 Peter Johanson # Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
config BOARD_PLANCK_REV6 config BOARD_PLANCK_REV6

View file

@ -1,6 +1,6 @@
# Planck keyboard configuration # Planck keyboard configuration
# Copyright (c) 2020 Peter Johanson # Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
if BOARD_PLANCK_REV6 if BOARD_PLANCK_REV6
@ -11,4 +11,7 @@ config ZMK_KEYBOARD_NAME
config ZMK_USB config ZMK_USB
default y default y
config ZMK_KSCAN_MATRIX_POLLING
default y
endif # BOARD_PLANCK_REV6 endif # BOARD_PLANCK_REV6

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse")
board_runner_args(jlink "--device=STM32F303VC" "--speed=4000") board_runner_args(jlink "--device=STM32F303VC" "--speed=4000")
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -15,55 +15,53 @@
/* pin assignments for STM32F3DISCOVERY board */ /* pin assignments for STM32F3DISCOVERY board */
static const struct pin_config pinconf[] = { static const struct pin_config pinconf[] = {
#ifdef CONFIG_UART_1 #ifdef CONFIG_UART_1
{STM32_PIN_PC4, STM32F3_PINMUX_FUNC_PC4_USART1_TX}, {STM32_PIN_PC4, STM32F3_PINMUX_FUNC_PC4_USART1_TX},
{STM32_PIN_PC5, STM32F3_PINMUX_FUNC_PC5_USART1_RX}, {STM32_PIN_PC5, STM32F3_PINMUX_FUNC_PC5_USART1_RX},
#endif /* CONFIG_UART_1 */ #endif /* CONFIG_UART_1 */
#ifdef CONFIG_UART_2 #ifdef CONFIG_UART_2
{STM32_PIN_PA2, STM32F3_PINMUX_FUNC_PA2_USART2_TX}, {STM32_PIN_PA2, STM32F3_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F3_PINMUX_FUNC_PA3_USART2_RX}, {STM32_PIN_PA3, STM32F3_PINMUX_FUNC_PA3_USART2_RX},
#endif /* CONFIG_UART_2 */ #endif /* CONFIG_UART_2 */
#ifdef CONFIG_I2C_1 #ifdef CONFIG_I2C_1
{STM32_PIN_PB6, STM32F3_PINMUX_FUNC_PB6_I2C1_SCL}, {STM32_PIN_PB6, STM32F3_PINMUX_FUNC_PB6_I2C1_SCL},
{STM32_PIN_PB7, STM32F3_PINMUX_FUNC_PB7_I2C1_SDA}, {STM32_PIN_PB7, STM32F3_PINMUX_FUNC_PB7_I2C1_SDA},
#endif /* CONFIG_I2C_1 */ #endif /* CONFIG_I2C_1 */
#ifdef CONFIG_I2C_2 #ifdef CONFIG_I2C_2
{STM32_PIN_PA9, STM32F3_PINMUX_FUNC_PA9_I2C2_SCL}, {STM32_PIN_PA9, STM32F3_PINMUX_FUNC_PA9_I2C2_SCL},
{STM32_PIN_PA10, STM32F3_PINMUX_FUNC_PA10_I2C2_SDA}, {STM32_PIN_PA10, STM32F3_PINMUX_FUNC_PA10_I2C2_SDA},
#endif /* CONFIG_I2C_2 */ #endif /* CONFIG_I2C_2 */
#ifdef CONFIG_SPI_1 #ifdef CONFIG_SPI_1
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS}, {STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS},
#endif /* CONFIG_SPI_STM32_USE_HW_SS */ #endif /* CONFIG_SPI_STM32_USE_HW_SS */
{STM32_PIN_PA5, STM32F3_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PA5, STM32F3_PINMUX_FUNC_PA5_SPI1_SCK},
{STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO}, {STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO},
{STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI}, {STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI},
#endif /* CONFIG_SPI_1 */ #endif /* CONFIG_SPI_1 */
#ifdef CONFIG_SPI_2 #ifdef CONFIG_SPI_2
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{STM32_PIN_PB12, STM32F3_PINMUX_FUNC_PB12_SPI2_NSS}, {STM32_PIN_PB12, STM32F3_PINMUX_FUNC_PB12_SPI2_NSS},
#endif /* CONFIG_SPI_STM32_USE_HW_SS */ #endif /* CONFIG_SPI_STM32_USE_HW_SS */
{STM32_PIN_PB13, STM32F3_PINMUX_FUNC_PB13_SPI2_SCK}, {STM32_PIN_PB13, STM32F3_PINMUX_FUNC_PB13_SPI2_SCK},
{STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO}, {STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO},
{STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI}, {STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI},
#endif /* CONFIG_SPI_2 */ #endif /* CONFIG_SPI_2 */
#ifdef CONFIG_USB_DC_STM32 #ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F3_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA11, STM32F3_PINMUX_FUNC_PA11_USB_DM},
{STM32_PIN_PA12, STM32F3_PINMUX_FUNC_PA12_USB_DP}, {STM32_PIN_PA12, STM32F3_PINMUX_FUNC_PA12_USB_DP},
#endif /* CONFIG_USB_DC_STM32 */ #endif /* CONFIG_USB_DC_STM32 */
#ifdef CONFIG_CAN_1 #ifdef CONFIG_CAN_1
{STM32_PIN_PD0, STM32F3_PINMUX_FUNC_PD0_CAN1_RX}, {STM32_PIN_PD0, STM32F3_PINMUX_FUNC_PD0_CAN1_RX},
{STM32_PIN_PD1, STM32F3_PINMUX_FUNC_PD1_CAN1_TX}, {STM32_PIN_PD1, STM32F3_PINMUX_FUNC_PD1_CAN1_TX},
#endif /* CONFIG_CAN_1 */ #endif /* CONFIG_CAN_1 */
}; };
static int pinmux_stm32_init(struct device *port) static int pinmux_stm32_init(struct device *port) {
{ ARG_UNUSED(port);
ARG_UNUSED(port);
stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf)); stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));
return 0; return 0;
} }
SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1, SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1, CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);

View file

@ -20,9 +20,6 @@ CONFIG_CLOCK_STM32_HSE_CLOCK=8000000
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# use HSE as PLL input # use HSE as PLL input
CONFIG_CLOCK_STM32_PLL_SRC_HSE=y CONFIG_CLOCK_STM32_PLL_SRC_HSE=y
# however, the board does not have an external oscillator, so just use
# the 8MHz clock signal coming from integrated STLink
CONFIG_CLOCK_STM32_HSE_BYPASS=y
# produce 72MHz clock at PLL output # produce 72MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_PREDIV=1 CONFIG_CLOCK_STM32_PLL_PREDIV=1
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9 CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9

View file

@ -15,55 +15,53 @@
/* pin assignments for STM32F3DISCOVERY board */ /* pin assignments for STM32F3DISCOVERY board */
static const struct pin_config pinconf[] = { static const struct pin_config pinconf[] = {
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usart1), okay) && CONFIG_SERIAL #if DT_NODE_HAS_STATUS(DT_NODELABEL(usart1), okay) && CONFIG_SERIAL
{STM32_PIN_PC4, STM32F3_PINMUX_FUNC_PC4_USART1_TX}, {STM32_PIN_PC4, STM32F3_PINMUX_FUNC_PC4_USART1_TX},
{STM32_PIN_PC5, STM32F3_PINMUX_FUNC_PC5_USART1_RX}, {STM32_PIN_PC5, STM32F3_PINMUX_FUNC_PC5_USART1_RX},
#endif #endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usart2), okay) && CONFIG_SERIAL #if DT_NODE_HAS_STATUS(DT_NODELABEL(usart2), okay) && CONFIG_SERIAL
{STM32_PIN_PA2, STM32F3_PINMUX_FUNC_PA2_USART2_TX}, {STM32_PIN_PA2, STM32F3_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F3_PINMUX_FUNC_PA3_USART2_RX}, {STM32_PIN_PA3, STM32F3_PINMUX_FUNC_PA3_USART2_RX},
#endif #endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C #if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C
{STM32_PIN_PB6, STM32F3_PINMUX_FUNC_PB6_I2C1_SCL}, {STM32_PIN_PB6, STM32F3_PINMUX_FUNC_PB6_I2C1_SCL},
{STM32_PIN_PB7, STM32F3_PINMUX_FUNC_PB7_I2C1_SDA}, {STM32_PIN_PB7, STM32F3_PINMUX_FUNC_PB7_I2C1_SDA},
#endif #endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C #if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C
{STM32_PIN_PA9, STM32F3_PINMUX_FUNC_PA9_I2C2_SCL}, {STM32_PIN_PA9, STM32F3_PINMUX_FUNC_PA9_I2C2_SCL},
{STM32_PIN_PA10, STM32F3_PINMUX_FUNC_PA10_I2C2_SDA}, {STM32_PIN_PA10, STM32F3_PINMUX_FUNC_PA10_I2C2_SDA},
#endif #endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS}, {STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS},
#endif /* CONFIG_SPI_STM32_USE_HW_SS */ #endif /* CONFIG_SPI_STM32_USE_HW_SS */
{STM32_PIN_PA5, STM32F3_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PA5, STM32F3_PINMUX_FUNC_PA5_SPI1_SCK},
{STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO}, {STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO},
{STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI}, {STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI},
#endif #endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{STM32_PIN_PB12, STM32F3_PINMUX_FUNC_PB12_SPI2_NSS}, {STM32_PIN_PB12, STM32F3_PINMUX_FUNC_PB12_SPI2_NSS},
#endif /* CONFIG_SPI_STM32_USE_HW_SS */ #endif /* CONFIG_SPI_STM32_USE_HW_SS */
{STM32_PIN_PB13, STM32F3_PINMUX_FUNC_PB13_SPI2_SCK}, {STM32_PIN_PB13, STM32F3_PINMUX_FUNC_PB13_SPI2_SCK},
{STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO}, {STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO},
{STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI}, {STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI},
#endif #endif
#ifdef CONFIG_USB_DC_STM32 #ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F3_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA11, STM32F3_PINMUX_FUNC_PA11_USB_DM},
{STM32_PIN_PA12, STM32F3_PINMUX_FUNC_PA12_USB_DP}, {STM32_PIN_PA12, STM32F3_PINMUX_FUNC_PA12_USB_DP},
#endif /* CONFIG_USB_DC_STM32 */ #endif /* CONFIG_USB_DC_STM32 */
#if DT_NODE_HAS_STATUS(DT_NODELABEL(can1), okay) && CONFIG_CAN #if DT_NODE_HAS_STATUS(DT_NODELABEL(can1), okay) && CONFIG_CAN
{STM32_PIN_PD0, STM32F3_PINMUX_FUNC_PD0_CAN1_RX}, {STM32_PIN_PD0, STM32F3_PINMUX_FUNC_PD0_CAN1_RX},
{STM32_PIN_PD1, STM32F3_PINMUX_FUNC_PD1_CAN1_TX}, {STM32_PIN_PD1, STM32F3_PINMUX_FUNC_PD1_CAN1_TX},
#endif #endif
}; };
static int pinmux_stm32_init(struct device *port) static int pinmux_stm32_init(struct device *port) {
{ ARG_UNUSED(port);
ARG_UNUSED(port);
stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf)); stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));
return 0; return 0;
} }
SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1, SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1, CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);

View file

@ -0,0 +1,14 @@
config ZMK_KEYBOARD_NAME
default "cradios"
# Unable to use interrupts as the same pin number is used
# across A & B controllers, and STM32F303CCT6 can't enable
# interrutps for multiple controllers for the same "line"
# for the external interrupts.
config ZMK_KSCAN_GPIO_POLLING
default y

View file

@ -0,0 +1,5 @@
# Copyright (c) 2020 Pete Johanson
# SPDX-License-Identifier: MIT
config SHIELD_CRADIOS
def_bool $(shields_list_contains,cradios)

View file

@ -0,0 +1,9 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_BOARDSOURCE3X4
config ZMK_KEYBOARD_NAME
default "Boardsource 3x4"
endif

View file

@ -0,0 +1,6 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
config SHIELD_BOARDSOURCE3X4
def_bool $(shields_list_contains,boardsource3x4)

View file

@ -0,0 +1,49 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&tog 1 &kp M_PREV &kp M_PLAY &kp M_NEXT
&mo 2 &kp M_VOLD &kp UARW &kp M_VOLU
&mo 3 &kp LARW &kp DARW &kp RARW
>;
};
num_layer {
bindings = <
&trans &kp NUM_7 &kp NUM_8 &kp NUM_9
&trans &kp NUM_4 &kp NUM_5 &kp NUM_6
&lt 3 NUM_0 &kp NUM_1 &kp NUM_2 &kp NUM_3
>;
};
lower_layer {
bindings = <
&bt BT_CLR &none &reset &bootloader
&trans &bt BT_SEL 3 &bt BT_SEL 4 &none
&none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2
>;
};
raise_layer {
bindings = <
&kp 0x68 &kp 0x69 &kp 0x6A &kp 0x6B
&kp 0x6C &kp 0x6D &kp 0x6E &kp 0x6F
&trans &kp 0x70 &kp 0x71 &kp 0x72
>;
};
};
};

View file

@ -0,0 +1,32 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix-transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
row-gpios
= <&pro_micro_a 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_a 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_a 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
col-gpios
= <&pro_micro_d 10 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 16 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 14 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 15 GPIO_ACTIVE_HIGH>
;
};
};

View file

@ -8,7 +8,7 @@ config ZMK_KEYBOARD_NAME
# across A & B controllers, and STM32F303CCT6 can't enable # across A & B controllers, and STM32F303CCT6 can't enable
# interrutps for multiple controllers for the same "line" # interrutps for multiple controllers for the same "line"
# for the external interrupts. # for the external interrupts.
config ZMK_KSCAN_GPIO_POLLING config ZMK_KSCAN_DIRECT_POLLING
default y default y
endif endif

View file

@ -1,3 +1,9 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi> #include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/keys.h>

View file

@ -1,5 +1,5 @@
&spi1 { &spi1 {
compatible = "nordic,nrf-spi"; compatible = "nordic,nrf-spim";
/* Cannot be used together with i2c0. */ /* Cannot be used together with i2c0. */
status = "okay"; status = "okay";
mosi-pin = <6>; mosi-pin = <6>;

View file

@ -1,5 +1,5 @@
# Uncomment the following lines to enable the Corne RGB Underglow # Uncomment the following lines to enable the Corne RGB Underglow
# ZMK_RGB_UNDERGLOW=y # CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y # CONFIG_WS2812_STRIP=y
# Uncomment the following line to enable the Corne OLED Display # Uncomment the following line to enable the Corne OLED Display

View file

@ -58,10 +58,6 @@ 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
}; };
bt_unpair_combo: bt_unpair_combo {
compatible = "zmk,bt-unpair-combo";
};
// TODO: per-key RGB node(s)? // TODO: per-key RGB node(s)?
}; };

View file

@ -1,5 +1,12 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi> #include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
/ { / {
keymap { keymap {
@ -21,14 +28,14 @@
lower_layer { lower_layer {
// ----------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BKSP | // | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BKSP |
// | CTRL | | | | | | | LFT | DWN | UP | RGT | | | // | BTCLR| BT1 | BT2 | BT3 | BT4 | BT5 | | LFT | DWN | UP | RGT | | |
// | SHFT | | | | | | | | | | | | | // | SHFT | | | | | | | | | | | | |
// | GUI | | SPC | | ENT | | ALT | // | GUI | | SPC | | ENT | | ALT |
bindings = < bindings = <
&kp ESC &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0 &kp BKSP &kp ESC &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0 &kp BKSP
&kp LCTL &trans &trans &trans &trans &trans &kp LARW &kp DARW &kp UARW &kp RARW &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 &kp LARW &kp DARW &kp UARW &kp RARW &trans &trans
&kp LSFT &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp LSFT &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&kp LGUI &trans &kp SPC &kp RET &trans &kp RALT &kp LGUI &trans &kp SPC &kp RET &trans &kp RALT
>; >;
}; };

View file

@ -16,7 +16,3 @@
, <&pro_micro_d 14 GPIO_ACTIVE_HIGH> , <&pro_micro_d 14 GPIO_ACTIVE_HIGH>
; ;
}; };
&bt_unpair_combo {
key-positions = <0 38>;
};

View file

@ -20,7 +20,3 @@
, <&pro_micro_a 3 GPIO_ACTIVE_HIGH> , <&pro_micro_a 3 GPIO_ACTIVE_HIGH>
; ;
}; };
&bt_unpair_combo {
key-positions = <11 39>;
};

View file

@ -0,0 +1,23 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_CRADIO_LEFT
config ZMK_KEYBOARD_NAME
default "cradio left"
endif
if SHIELD_CRADIO_RIGHT
config ZMK_KEYBOARD_NAME
default "cradio right"
endif
if SHIELD_CRADIO_RIGHT || SHIELD_CRADIO_LEFT
config ZMK_KSCAN_DIRECT_POLLING
default y
endif

View file

@ -0,0 +1,8 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
config SHIELD_CRADIO_LEFT
def_bool $(shields_list_contains,cradio_left)
config SHIELD_CRADIO_RIGHT
def_bool $(shields_list_contains,cradio_right)

View file

@ -0,0 +1,50 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix-transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
//zmk,matrix_transform = &default_transform;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <34>;
rows = <1>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,21) RC(0,20) RC(0,19) RC(0,18) RC(0,17)
RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,26) RC(0,25) RC(0,24) RC(0,23) RC(0,22)
RC(0,10) RC(0,11) RC(0,12) RC(0,13) RC(0,14) RC(0,31) RC(0,30) RC(0,29) RC(0,28) RC(0,27)
RC(0,15) RC(0,16) RC(0,33) RC(0,32)
>;
kscan0: kscan {
compatible = "zmk,kscan-gpio-direct";
label = "KSCAN";
input-gpios
= <&pro_micro_d 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_a 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_a 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_a 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_a 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_d 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_d 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_d 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_d 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_d 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_d 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_d 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_a 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_d 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_d 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_d 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro_d 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
;
};
};
};

View file

@ -0,0 +1,43 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
&kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SCLN
&kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp CMMA &kp DOT &kp FSLH
&mo 1 &kp LCTL &kp SPC &mo 2
>;
};
upper_layer {
bindings = <
&kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0
&bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &kp H &kp J &kp K &kp L &kp SCLN
&kp LSFT &trans &trans &trans &trans &trans &trans &trans &trans &trans
&mo 1 &kp LCTL &kp SPC &mo 2
>;
};
lower_layer {
bindings = <
&kp BANG &kp ATSN &kp HASH &kp CURU &kp PRCT &kp CRRT &kp AMPS &kp KMLT &kp LPRN &kp RPRN
&trans &trans &trans &trans &trans &kp MINUS &kp EQL &kp LBKT &kp RBKT &kp PIPE
&trans &trans &trans &trans &trans &trans &trans &trans &kp BSLH &kp TILD
&mo 1 &kp LCTL &kp SPC &mo 2
>;
};
};
};

View file

@ -0,0 +1,5 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
CONFIG_ZMK_SPLIT=y
CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y

View file

@ -0,0 +1,7 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "cradio.dtsi"

View file

@ -0,0 +1,5 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
CONFIG_ZMK_SPLIT=y
CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y

View file

@ -0,0 +1,11 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "cradio.dtsi"
&default_transform {
col-offset = <17>;
};

View file

@ -44,8 +44,4 @@ 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)
; ;
}; };
bt_unpair_combo: bt_unpair_combo {
compatible = "zmk,bt-unpair-combo";
};
}; };

View file

@ -1,8 +1,12 @@
# Copyright (c) 2020 Pete Johanson, Kurtis Lew /*
# SPDX-License-Identifier: MIT * Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi> #include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
/ { / {
keymap { keymap {
@ -26,17 +30,17 @@
lower_layer { lower_layer {
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
// | | | | | | | | | | | | | | // | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | |
// | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | // | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |
// | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ | // | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ |
// | | | | | | | | | | | _ | + | { | } | "|" | // | | | | | | | | | | | _ | + | { | } | "|" |
// | | | | | | | | // | | | | | | | |
bindings = < bindings = <
&trans &trans &trans &trans &trans &trans &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 GRAV &kp BANG &kp ATSN &kp HASH &kp CURU &kp PRCT &kp CRRT &kp AMPS &kp KMLT &kp LPRN &kp RPRN &kp TILD &kp GRAV &kp BANG &kp ATSN &kp HASH &kp CURU &kp PRCT &kp CRRT &kp AMPS &kp KMLT &kp LPRN &kp RPRN &kp TILD
&trans &trans &trans &trans &trans &trans &trans &trans &trans &kp MINUS &kp KPLS &kp LCUR &kp RCUR &kp PIPE &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp MINUS &kp KPLS &kp LCUR &kp RCUR &kp PIPE
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>; >;
}; };

View file

@ -16,7 +16,3 @@
, <&pro_micro_d 10 GPIO_ACTIVE_HIGH> , <&pro_micro_d 10 GPIO_ACTIVE_HIGH>
; ;
}; };
&bt_unpair_combo {
key-positions = <0 42>;
};

View file

@ -12,15 +12,11 @@
&kscan0 { &kscan0 {
col-gpios col-gpios
= <&pro_micro_a 1 GPIO_ACTIVE_HIGH> = <&pro_micro_d 10 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 0 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 15 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 14 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 16 GPIO_ACTIVE_HIGH> , <&pro_micro_d 16 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 10 GPIO_ACTIVE_HIGH> , <&pro_micro_d 14 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 15 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 0 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 1 GPIO_ACTIVE_HIGH>
; ;
}; };
&bt_unpair_combo {
key-positions = <11 43>;
};

View file

@ -1,5 +1,5 @@
&spi1 { &spi1 {
compatible = "nordic,nrf-spi"; compatible = "nordic,nrf-spim";
status = "okay"; status = "okay";
mosi-pin = <6>; mosi-pin = <6>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.

View file

@ -1,5 +1,5 @@
&spi1 { &spi1 {
compatible = "nordic,nrf-spi"; compatible = "nordic,nrf-spim";
status = "okay"; status = "okay";
mosi-pin = <6>; mosi-pin = <6>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.

View file

@ -1,5 +1,5 @@
&spi1 { &spi1 {
compatible = "nordic,nrf-spi"; compatible = "nordic,nrf-spim";
status = "okay"; status = "okay";
mosi-pin = <6>; mosi-pin = <6>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.

View file

@ -1,5 +1,5 @@
&spi1 { &spi1 {
compatible = "nordic,nrf-spi"; compatible = "nordic,nrf-spim";
status = "okay"; status = "okay";
mosi-pin = <6>; mosi-pin = <6>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.

View file

@ -81,10 +81,6 @@ RC(2,0) 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)
sensors = <&left_encoder &right_encoder>; sensors = <&left_encoder &right_encoder>;
}; };
bt_unpair_combo: bt_unpair_combo {
compatible = "zmk,bt-unpair-combo";
};
// TODO: RGB node(s) // TODO: RGB node(s)
}; };

View file

@ -1,3 +1,9 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi> #include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/keys.h>
@ -18,7 +24,7 @@
&kp LGUI &kp DEL &kp RET &kp SPC &kp ESC &kp RET &kp SPC &kp TAB &kp BKSP &kp RALT &kp LGUI &kp DEL &kp RET &kp SPC &kp ESC &kp RET &kp SPC &kp TAB &kp BKSP &kp RALT
>; >;
sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD &inc_dec_kp PGUP PGDN>; sensor-bindings = <&inc_dec_kp M_VOLU M_VOLD &inc_dec_kp PGUP PGDN>;
}; };
}; };
}; };

View file

@ -22,7 +22,3 @@
&left_encoder { &left_encoder {
status = "okay"; status = "okay";
}; };
&bt_unpair_combo {
key-positions = <0 44>;
};

View file

@ -27,7 +27,3 @@
&right_encoder { &right_encoder {
status = "okay"; status = "okay";
}; };
&bt_unpair_combo {
key-positions = <11 45>;
};

View file

@ -57,10 +57,6 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7)
compatible = "zmk,keymap-sensors"; compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>; sensors = <&left_encoder>;
}; };
bt_unpair_combo: bt_unpair_combo {
compatible = "zmk,bt-unpair-combo";
};
}; };
&pro_micro_i2c { &pro_micro_i2c {

View file

@ -1,5 +1,13 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi> #include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/ext_power.h>
/ { / {
keymap { keymap {
@ -20,25 +28,25 @@
&kp LALT &kp LGUI &mo 1 &kp SPC &kp RET &mo 2 &kp BKSP &kp RGUI &kp LALT &kp LGUI &mo 1 &kp SPC &kp RET &mo 2 &kp BKSP &kp RGUI
>; >;
sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD>; sensor-bindings = <&inc_dec_kp M_VOLU M_VOLD>;
}; };
lower_layer { lower_layer {
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
// | | | | | | | | | | | | | | // | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | |
// | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | // | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |
// | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ | // | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ |
// | | | | | | | | | | | _ | + | { | } | "|" | // | | | | | | | | | | | _ | + | { | } | "|" |
// | | | | | | | | | | // | | | | | | | | | |
bindings = < bindings = <
&trans &trans &trans &trans &trans &trans &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 GRAV &kp BANG &kp ATSN &kp HASH &kp CURU &kp PRCT &kp CRRT &kp AMPS &kp KMLT &kp LPRN &kp RPRN &kp TILD &kp GRAV &kp BANG &kp ATSN &kp HASH &kp CURU &kp PRCT &kp CRRT &kp AMPS &kp KMLT &kp LPRN &kp RPRN &kp TILD
&trans &trans &trans &trans &trans &trans &trans &trans &trans &kp MINUS &kp KPLS &kp LCUR &kp RCUR &kp PIPE &trans &ext_power EP_ON &ext_power EP_OFF &ext_power EP_TOG &trans &trans &trans &trans &trans &kp MINUS &kp KPLS &kp LCUR &kp RCUR &kp PIPE
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>; >;
sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD>; sensor-bindings = <&inc_dec_kp M_VOLU M_VOLD>;
}; };
raise_layer { raise_layer {
@ -56,7 +64,7 @@
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>; >;
sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD>; sensor-bindings = <&inc_dec_kp M_VOLU M_VOLD>;
}; };
}; };
}; };

View file

@ -20,7 +20,3 @@
&left_encoder { &left_encoder {
status = "okay"; status = "okay";
}; };
&bt_unpair_combo {
key-positions = <0 53>;
};

View file

@ -20,7 +20,3 @@
, <&pro_micro_a 1 GPIO_ACTIVE_HIGH> , <&pro_micro_a 1 GPIO_ACTIVE_HIGH>
; ;
}; };
&bt_unpair_combo {
key-positions = <11 54>;
};

View file

@ -0,0 +1,11 @@
#
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
if SHIELD_M60
config ZMK_KEYBOARD_NAME
default "m60"
endif

View file

@ -0,0 +1,7 @@
#
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
config SHIELD_M60
def_bool $(shields_list_contains,m60)

View file

@ -0,0 +1,42 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
/ {
keymap0: keymap {
compatible = "zmk,keymap";
default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT |
// | CTL | WIN | ALT | SPACE | ALT | MO(1) | WIN | CTRL |
// ------------------------------------------------------------------------------------------
bindings = <
&kp ESC &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0 &kp MINUS &kp EQL &kp BKSP
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH
&kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SCLN &kp QUOT &kp RET
&kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RSFT
&kp LCTL &kp LGUI &kp LALT &kp SPC &kp RALT &mo 1 &kp RGUI &kp RCTL
>;
};
fn_layer {
bindings = <
&kp GRAV &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &bootloader
&trans &bt BT_CLR &none &none &none &none &none &none &none &none &none &none &none &reset
&trans &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &kp LARW &kp DARW &kp UARW &kp RARW &none &none &trans
&trans &none &none &none &none &none &none &none &none &none &none &trans
&trans &trans &trans &trans &trans &trans &trans &trans
>;
};
};
};

View file

@ -0,0 +1,60 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix-transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
row-gpios
= <&gpio0 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 12 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
col-gpios
= <&gpio0 19 GPIO_ACTIVE_HIGH>
, <&gpio0 20 GPIO_ACTIVE_HIGH>
, <&gpio0 21 GPIO_ACTIVE_HIGH>
, <&gpio0 22 GPIO_ACTIVE_HIGH>
, <&gpio0 23 GPIO_ACTIVE_HIGH>
, <&gpio0 24 GPIO_ACTIVE_HIGH>
, <&gpio0 25 GPIO_ACTIVE_HIGH>
, <&gpio0 26 GPIO_ACTIVE_HIGH>
;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <8>;
rows = <8>;
// | MX1 | MX2 | MX3 | MX4 | MX5 | MX6 | MX7 | MX8 | MX9 | MX10 | MX11 | MX12 | MX13 | MX14 |
// | MX15 | MX16 | MX17 | MX18 | MX19 | MX20 | MX21 | MX22 | MX23 | MX24 | MX25 | MX26 | MX27 | MX28 |
// | MX29 | MX30 | MX31 | MX32 | MX33 | MX34 | MX35 | MX36 | MX37 | MX38 | MX39 | MX40 | MX41 |
// | MX42 | MX43 | MX44 | MX45 | MX46 | MX47 | MX48 | MX49 | MX50 | MX51 | MX52 | MX53 |
// | MX54 | MX55 | MX56 | MX57 | MX58 | MX59 | MX60 | MX61 |
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5)
RC(3,3) RC(3,2) RC(3,1) RC(3,0) RC(2,7) RC(2,6) RC(2,5) RC(2,4) RC(2,3) RC(2,2) RC(2,1) RC(2,0) RC(1,7) RC(1,6)
RC(3,4) RC(3,5) RC(3,6) RC(3,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(5,0)
RC(6,4) RC(6,3) RC(6,2) RC(6,1) RC(6,0) RC(5,7) RC(5,6) RC(5,5) RC(5,4) RC(5,3) RC(5,2) RC(5,1)
RC(6,5) RC(6,6) RC(6,7) RC(7,0) RC(7,1) RC(7,2) RC(7,3) RC(7,4)
>;
};
};

View file

@ -0,0 +1,14 @@
# [Makerdiary M60](https://wiki.makerdiary.com/m60)
A 60% ANSI keyboard designed and manufactured by Makerdiary.
http://makerdiary.com
## Features
- Per key RGB LED.
- Uses makerdiary M.2 nRF52840 module
- Matrix wiring
## Hardware Notes
https://wiki.makerdiary.com/m60/developer_guide/hardware/

View file

@ -0,0 +1,60 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_MICRODOX_LEFT
config ZMK_KEYBOARD_NAME
default "Microdox Left"
endif
if SHIELD_MICRODOX_RIGHT
config ZMK_KEYBOARD_NAME
default "Microdox Right"
endif
if SHIELD_MICRODOX_LEFT || SHIELD_MICRODOX_RIGHT
config ZMK_SPLIT
default y
if ZMK_DISPLAY
config I2C
default y
config SSD1306
default y
config SSD1306_REVERSE_MODE
default y
endif # ZMK_DISPLAY
if LVGL
config LVGL_HOR_RES
default 128
config LVGL_VER_RES
default 32
config LVGL_VDB_SIZE
default 64
config LVGL_DPI
default 148
config LVGL_BITS_PER_PIXEL
default 1
choice LVGL_COLOR_DEPTH
default LVGL_COLOR_DEPTH_1
endchoice
endif # LVGL
endif

View file

@ -0,0 +1,8 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
config SHIELD_MICRODOX_LEFT
def_bool $(shields_list_contains,microdox_left)
config SHIELD_MICRODOX_RIGHT
def_bool $(shields_list_contains,microdox_right)

View file

@ -0,0 +1,34 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
&spi1 {
compatible = "nordic,nrf-spim";
/* Cannot be used together with i2c0. */
status = "okay";
mosi-pin = <6>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <5>;
miso-pin = <7>;
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "SK6812mini";
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <6>; /* There are per-key RGB, but the first 6 are underglow */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View file

@ -0,0 +1,6 @@
# Uncomment the following lines to enable the Microdox RGB Underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y
# Uncomment the following line to enable the Microdox OLED Display
# CONFIG_ZMK_DISPLAY=y

View file

@ -0,0 +1,66 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix-transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <10>;
rows = <4>;
// | SW1 | SW2 | SW3 | SW4 | SW5 | | SW5 | SW4 | SW3 | SW2 | SW1 |
// | SW6 | SW7 | SW8 | SW9 | SW10 | | SW10 | SW9 | SW8 | SW7 | SW6 |
// | SW11 | SW12 | SW13 | SW14 | SW15 | | SW15 | SW14 | SW13 | SW12 | SW11 |
// | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 |
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9)
RC(2,0) 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(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7)
>;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
row-gpios
= <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
// TODO: per-key RGB node(s)?
};
&pro_micro_i2c {
status = "okay";
oled: ssd1306@3c {
compatible = "solomon,ssd1306fb";
reg = <0x3c>;
label = "DISPLAY";
width = <128>;
height = <32>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <31>;
segment-remap;
com-invdir;
com-sequential;
prechargep = <0x22>;
};
};

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