Merge branch 'zmkfirmware:main' into main

This commit is contained in:
MakerJake 2022-04-08 13:33:48 -04:00 committed by GitHub
commit 4d882b656b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
635 changed files with 14439 additions and 32927 deletions
.devcontainer
.github/workflows
.vscode
app
CMakeLists.txtKconfig
boards
arm
interconnects
native_posix_64.confnative_posix_64.overlayseeeduino_xiao.confseeeduino_xiao.overlayseeeduino_xiao_ble.confseeeduino_xiao_ble.overlay
shields

View file

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

View file

@ -9,75 +9,19 @@ on:
paths:
- ".github/workflows/build.yml"
- "app/**"
schedule:
- cron: '22 4 * * *'
jobs:
build:
if: ${{ always() }}
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-build-arm:2.5
image: docker.io/zmkfirmware/zmk-build-arm:3.0
needs: compile-matrix
strategy:
matrix:
board:
- bluemicro840_v1
- nice_nano
- nice_nano_v2
- nrfmicro_13
- proton_c
shield:
- bfo9000_left
- bfo9000_right
- boardsource3x4
- corne_left
- corne_right
- cradio_left
- cradio_right
- crbn
- eek
- helix_left
- helix_right
- iris_left
- iris_right
- jian_left
- jian_right
- jorne_left
- jorne_right
- kyria_left
- kyria_right
- lily58_left
- lily58_right
- microdox_left
- microdox_right
- nibble
- qaz
- quefrency_left
- quefrency_right
- reviung41
- romac
- romac_plus
- settings_reset
- sofle_left
- sofle_right
- splitreus62_left
- splitreus62_right
- tg4x
- tidbit
cmake-args: [""]
include:
- board: bdn9_rev2
- board: dz60rgb_rev1
- board: nrf52840_m2
shield: m60
- board: planck_rev6
- board: proton_c
shield: clueboard_california
- board: nice_nano_v2
shield: kyria_left
cmake-args: -DCONFIG_ZMK_DISPLAY=y
skip-archive: true
- board: nice_nano_v2
shield: kyria_right
cmake-args: -DCONFIG_ZMK_DISPLAY=y
skip-archive: true
include: ${{ fromJSON(needs.compile-matrix.outputs.include-list) }}
steps:
- name: Checkout
uses: actions/checkout@v2
@ -104,29 +48,360 @@ jobs:
run: west update
- name: Export Zephyr CMake package (west zephyr-export)
run: west zephyr-export
- name: Prepare variables
id: variables
run: |
SHIELD_ARG=
ARTIFACT_NAME="${{ matrix.board }}"
if [ -n "${{ matrix.shield }}" ]; then
SHIELD_ARG="-DSHIELD=${{ matrix.shield }}"
ARTIFACT_NAME="${ARTIFACT_NAME}-${{ matrix.shield }}"
fi
ARTIFACT_NAME="${ARTIFACT_NAME}-zmk"
echo ::set-output name=shield-arg::${SHIELD_ARG}
echo ::set-output name=artifact-name::${ARTIFACT_NAME}
- name: Build (west build)
run: west build -s app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} ${{ matrix.cmake-args }}
- name: Archive artifacts
if: ${{ !matrix.skip-archive }}
uses: actions/upload-artifact@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
name: "${{ steps.variables.outputs.artifact-name }}"
path: |
build/zephyr/zmk.hex
build/zephyr/zmk.uf2
continue-on-error: true
node-version: '14.x'
- name: Install @actions/artifact
run: npm install @actions/artifact
- name: Build and upload artifacts
uses: actions/github-script@v4
id: boards-list
with:
script: |
const fs = require('fs');
const artifact = require('@actions/artifact');
const artifactClient = artifact.create();
const execSync = require('child_process').execSync;
const buildShieldArgs = JSON.parse(`${{ matrix.shieldArgs }}`);
let error = false;
for (const shieldArgs of buildShieldArgs) {
try {
const output = execSync(`west build -s app -p -b ${{ matrix.board }} -- ${shieldArgs.shield ? '-DSHIELD=' + shieldArgs.shield : ''} ${shieldArgs['cmake-args'] || ''}`);
console.log(`::group::${{ matrix.board}} ${shieldArgs.shield} Build`)
console.log(output.toString());
const fileExtensions = ["hex", "uf2"];
const files = fileExtensions
.map(extension => "build/zephyr/zmk." + extension)
.filter(path => fs.existsSync(path));
const rootDirectory = 'build/zephyr';
const options = {
continueOnError: true
}
const cmakeName = shieldArgs['cmake-args'] ? '-' + (shieldArgs.nickname || shieldArgs['cmake-args'].split(' ').join('')) : '';
const artifactName = `${{ matrix.board }}${shieldArgs.shield ? '-' + shieldArgs.shield : ''}${cmakeName}-zmk`;
await artifactClient.uploadArtifact(artifactName, files, rootDirectory, options);
} catch (e) {
console.error(`::error::Failed to build or upload ${{ matrix.board }} ${shieldArgs.shield} ${shieldArgs['cmake-args']}`);
console.error(e);
error = true;
} finally {
console.log('::endgroup::');
}
}
if (error) {
throw new Error('Failed to build one or more configurations');
}
compile-matrix:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: [core-coverage, board-changes, nightly]
outputs:
include-list: ${{ steps.compile-list.outputs.result }}
steps:
- name: Join build lists
uses: actions/github-script@v4
id: compile-list
with:
script: |
const coreCoverage = `${{ needs.core-coverage.outputs.core-include }}` || "[]";
const boardChanges = `${{ needs.board-changes.outputs.boards-include }}` || "[]";
const nightly = `${{ needs.nightly.outputs.nightly-include }}` || "[]";
const combined = [
...JSON.parse(coreCoverage),
...JSON.parse(boardChanges),
...JSON.parse(nightly)
];
const combinedUnique = [...new Map(combined.map(el => [JSON.stringify(el), el])).values()];
const perBoard = {};
for (const configuration of combinedUnique) {
if (!perBoard[configuration.board])
perBoard[configuration.board] = [];
perBoard[configuration.board].push({
shield: configuration.shield,
'cmake-args': configuration['cmake-args'],
nickname: configuration.nickname
})
}
return Object.entries(perBoard).map(([board, shieldArgs]) => ({
board,
shieldArgs: JSON.stringify(shieldArgs),
}));
core-coverage:
if: ${{ needs.get-changed-files.outputs.core-changes == 'true' }}
runs-on: ubuntu-latest
needs: get-changed-files
outputs:
core-include: ${{ steps.core-list.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install js-yaml
run: npm install js-yaml
- uses: actions/github-script@v4
id: core-list
with:
script: |
const fs = require('fs');
const yaml = require('js-yaml');
const coreCoverage = yaml.load(fs.readFileSync('app/core-coverage.yml', 'utf8'));
let include = coreCoverage.board.flatMap(board =>
coreCoverage.shield.map(shield => ({ board, shield }))
);
return [...include, ...coreCoverage.include];
board-changes:
if: ${{ needs.get-changed-files.outputs.board-changes == 'true' }}
runs-on: ubuntu-latest
needs: [get-grouped-hardware, get-changed-files]
outputs:
boards-include: ${{ steps.boards-list.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install js-yaml
run: npm install js-yaml
- uses: actions/github-script@v4
id: boards-list
with:
script: |
const fs = require('fs');
const yaml = require('js-yaml');
const changedFiles = JSON.parse(`${{ needs.get-changed-files.outputs.changed-files }}`);
const metadata = JSON.parse(`${{ needs.get-grouped-hardware.outputs.organized-metadata }}`);
const boardChanges = new Set(changedFiles.filter(f => f.startsWith('app/boards')).map(f => f.split('/').slice(0, 4).join('/')));
return (await Promise.all([...boardChanges].flatMap(async bc => {
const globber = await glob.create(bc + "/*.zmk.yml");
const files = await globber.glob();
const aggregated = files.flatMap((f) =>
yaml.loadAll(fs.readFileSync(f, "utf8"))
);
const boardAndShield = (b, s) => {
if (s.siblings) {
return s.siblings.map(shield => ({
board: b.id,
shield,
}));
} else {
return {
board: b.id,
shield: s.id
};
}
}
return aggregated.flatMap(hm => {
switch (hm.type) {
case "board":
if (hm.features && hm.features.includes("keys")) {
if (hm.siblings) {
return hm.siblings.map(board => ({
board,
}));
} else {
return {
board: hm.id
};
}
} else if (hm.exposes) {
return hm.exposes.flatMap(i =>
metadata.interconnects[i].shields.flatMap(s => boardAndShield(hm, s))
);
} else {
console.error("Board without keys or interconnect");
}
break;
case "shield":
if (hm.features && hm.features.includes("keys")) {
return hm.requires.flatMap(i =>
metadata.interconnects[i].boards.flatMap(b => boardAndShield(b, hm))
);
}
break;
case "interconnect":
return [];
}
});
}))).flat();
nightly:
if: ${{ github.event_name == 'schedule' }}
runs-on: ubuntu-latest
needs: get-grouped-hardware
outputs:
nightly-include: ${{ steps.nightly-list.outputs.result }}
steps:
- name: Create nightly list
uses: actions/github-script@v4
id: nightly-list
with:
script: |
const metadata = JSON.parse(`${{ needs.get-grouped-hardware.outputs.organized-metadata }}`);
let includeOnboard = metadata.onboard.flatMap(b => {
if (b.siblings) {
return b.siblings.map(board => ({
board,
}));
} else {
return {
board: b.id,
};
}
});
let includeInterconnect = Object.values(metadata.interconnects).flatMap(i =>
i.boards.flatMap(b =>
i.shields.flatMap(s => {
if (s.siblings) {
return s.siblings.map(shield => ({
board: b.id,
shield,
}));
} else {
return {
board: b.id,
shield: s.id,
};
}
})
)
);
return [...includeOnboard, ...includeInterconnect];
get-grouped-hardware:
runs-on: ubuntu-latest
outputs:
organized-metadata: ${{ steps.organize-metadata.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install js-yaml
run: npm install js-yaml
- name: Aggregate Metadata
uses: actions/github-script@v4
id: aggregate-metadata
with:
script: |
const fs = require('fs');
const yaml = require('js-yaml');
const globber = await glob.create("app/boards/**/*.zmk.yml");
const files = await globber.glob();
const aggregated = files.flatMap((f) =>
yaml.loadAll(fs.readFileSync(f, "utf8"))
);
return JSON.stringify(aggregated).replace(/\\/g,"\\\\");
result-encoding: string
- name: Organize Metadata
uses: actions/github-script@v4
id: organize-metadata
with:
script: |
const hardware = JSON.parse(`${{ steps.aggregate-metadata.outputs.result }}`);
const grouped = hardware.reduce((agg, hm) => {
switch (hm.type) {
case "board":
if (hm.features && hm.features.includes("keys")) {
agg.onboard.push(hm);
} else if (hm.exposes) {
hm.exposes.forEach((element) => {
let ic = agg.interconnects[element] || {
boards: [],
shields: [],
};
ic.boards.push(hm);
agg.interconnects[element] = ic;
});
} else {
console.error("Board without keys or interconnect");
}
break;
case "shield":
if (hm.features && hm.features.includes("keys")) {
hm.requires.forEach((id) => {
let ic = agg.interconnects[id] || { boards: [], shields: [] };
ic.shields.push(hm);
agg.interconnects[id] = ic;
});
}
break;
case "interconnect":
let ic = agg.interconnects[hm.id] || { boards: [], shields: [] };
ic.interconnect = hm;
agg.interconnects[hm.id] = ic;
break;
}
return agg;
},
{ onboard: [], interconnects: {} });
return JSON.stringify(grouped).replace(/\\/g,"\\\\");
result-encoding: string
get-changed-files:
if: ${{ github.event_name != 'schedule' }}
runs-on: ubuntu-latest
outputs:
changed-files: ${{ steps.changed-files.outputs.all }}
board-changes: ${{ steps.board-changes.outputs.result }}
core-changes: ${{ steps.core-changes.outputs.result }}
steps:
- uses: Ana06/get-changed-files@v2.0.0
id: changed-files
with:
format: 'json'
- uses: actions/github-script@v4
id: board-changes
with:
script: |
const changedFiles = JSON.parse(`${{ steps.changed-files.outputs.all }}`);
const boardChanges = changedFiles.filter(f => f.startsWith('app/boards'));
return boardChanges.length ? 'true' : 'false';
result-encoding: string
- uses: actions/github-script@v4
id: core-changes
with:
script: |
const changedFiles = JSON.parse(`${{ steps.changed-files.outputs.all }}`);
const boardChanges = changedFiles.filter(f => f.startsWith('app/boards'));
const appChanges = changedFiles.filter(f => f.startsWith('app'));
const ymlChanges = changedFiles.includes('.github/workflows/build.yml');
return boardChanges.length < appChanges.length || ymlChanges ? 'true' : 'false';
result-encoding: string

View file

@ -29,7 +29,7 @@ jobs:
validate-metadata:
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-dev-arm:2.5
image: docker.io/zmkfirmware/zmk-dev-arm:3.0
steps:
- uses: actions/checkout@v2
- name: Install dependencies

View file

@ -13,10 +13,27 @@ on:
- "app/src/**"
jobs:
integration_test:
collect-tests:
outputs:
test-dirs: ${{ steps.test-dirs.outputs.test-dirs }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Find test directories
id: test-dirs
run: |
cd app/tests/
export TESTS=$(ls -d * | jq -R -s -c 'split("\n")[:-1]')
echo "::set-output name=test-dirs::${TESTS}"
run-tests:
needs: collect-tests
strategy:
matrix:
test: ${{ fromJSON(needs.collect-tests.outputs.test-dirs) }}
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-build-arm:2.5
image: docker.io/zmkfirmware/zmk-build-arm:3.0
steps:
- name: Checkout
uses: actions/checkout@v2
@ -43,8 +60,9 @@ jobs:
run: west update
- name: Export Zephyr CMake package (west zephyr-export)
run: west zephyr-export
- name: Test all
run: west test
- name: Test ${{ matrix.test }}
working-directory: app
run: west test tests/${{ matrix.test }}
- name: Archive artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2

View file

@ -2,5 +2,6 @@
"files.associations": {
"*.overlay": "dts",
"*.keymap": "dts"
}
},
"python.formatting.provider": "black"
}

View file

@ -22,7 +22,7 @@ zephyr_linker_sources(RODATA include/linker/zmk-events.ld)
# Add your source file to the "app" target. This must come after
# find_package(Zephyr) which defines the target.
target_include_directories(app PRIVATE include)
target_sources_ifdef(CONFIG_ZMK_SLEEP app PRIVATE src/power.c)
target_sources(app PRIVATE src/stdlib.c)
target_sources(app PRIVATE src/activity.c)
target_sources(app PRIVATE src/kscan.c)
target_sources(app PRIVATE src/matrix_transform.c)
@ -41,27 +41,32 @@ target_sources(app PRIVATE src/events/sensor_event.c)
target_sources_ifdef(CONFIG_ZMK_WPM app PRIVATE src/events/wpm_state_changed.c)
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/events/ble_active_profile_changed.c)
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/events/battery_state_changed.c)
target_sources_ifdef(CONFIG_USB 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_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/behaviors/behavior_ext_power.c)
if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL)
target_sources(app PRIVATE src/behaviors/behavior_key_press.c)
target_sources(app PRIVATE src/behaviors/behavior_reset.c)
target_sources(app PRIVATE src/behaviors/behavior_hold_tap.c)
target_sources(app PRIVATE src/behaviors/behavior_sticky_key.c)
target_sources(app PRIVATE src/behaviors/behavior_caps_word.c)
target_sources(app PRIVATE src/behaviors/behavior_key_repeat.c)
target_sources(app PRIVATE src/behaviors/behavior_macro.c)
target_sources(app PRIVATE src/behaviors/behavior_momentary_layer.c)
target_sources(app PRIVATE src/behaviors/behavior_mod_morph.c)
target_sources(app PRIVATE src/behaviors/behavior_outputs.c)
target_sources(app PRIVATE src/behaviors/behavior_tap_dance.c)
target_sources(app PRIVATE src/behaviors/behavior_toggle_layer.c)
target_sources(app PRIVATE src/behaviors/behavior_to_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/combo.c)
target_sources(app PRIVATE src/behavior_queue.c)
target_sources(app PRIVATE src/conditional_layer.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_BACKLIGHT app PRIVATE src/behaviors/behavior_backlight.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/battery.c)
@ -72,9 +77,10 @@ endif()
if (CONFIG_ZMK_SPLIT_BLE AND CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL)
target_sources(app PRIVATE src/split/bluetooth/central.c)
endif()
target_sources_ifdef(CONFIG_USB app PRIVATE src/usb.c)
target_sources_ifdef(CONFIG_USB_DEVICE_STACK app PRIVATE src/usb.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_BACKLIGHT app PRIVATE src/backlight.c)
target_sources(app PRIVATE src/endpoints.c)
target_sources(app PRIVATE src/hid_listener.c)
target_sources(app PRIVATE src/main.c)

View file

@ -132,6 +132,9 @@ config ZMK_BLE_CLEAR_BONDS_ON_START
config BT_GATT_NOTIFY_MULTIPLE
default n
config BT_GATT_AUTO_SEC_REQ
default n
config BT_DEVICE_APPEARANCE
default 961
@ -175,6 +178,14 @@ config ZMK_SPLIT_BLE_CENTRAL_POSITION_QUEUE_SIZE
int "Max number of key position state events to queue when received from peripherals"
default 5
config ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_STACK_SIZE
int "BLE split central write thread stack size"
default 512
config ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_QUEUE_SIZE
int "Max number of behavior run events to queue to send to the peripheral(s)"
default 5
endif
if !ZMK_SPLIT_BLE_ROLE_CENTRAL
@ -249,7 +260,7 @@ menu "Display/LED Options"
rsource "src/display/Kconfig"
config ZMK_RGB_UNDERGLOW
menuconfig ZMK_RGB_UNDERGLOW
bool "RGB Adressable LED Underglow"
select LED_STRIP
@ -320,6 +331,35 @@ config ZMK_RGB_UNDERGLOW_ON_START
#ZMK_RGB_UNDERGLOW
endif
menuconfig ZMK_BACKLIGHT
bool "LED backlight"
select LED
if ZMK_BACKLIGHT
config ZMK_BACKLIGHT_BRT_STEP
int "Brightness step in percent"
range 1 100
default 20
config ZMK_BACKLIGHT_BRT_START
int "Default brightness in percent"
range 1 100
default 40
config ZMK_BACKLIGHT_ON_START
bool "Default backlight state"
default y
config ZMK_BACKLIGHT_AUTO_OFF_IDLE
bool "Turn off backlight when keyboard goes into idle state"
config ZMK_BACKLIGHT_AUTO_OFF_USB
bool "Turn off backlight when USB is disconnected"
#ZMK_BACKLIGHT
endif
#Display/LED Options
endmenu
@ -335,10 +375,6 @@ config ZMK_SLEEP
if ZMK_SLEEP
choice SYS_PM_POLICY
default PM_POLICY_APP
endchoice
config PM_DEVICE
default y
@ -370,14 +406,22 @@ config ZMK_COMBO_MAX_KEYS_PER_COMBO
int "Maximum number of keys per combo"
default 4
#Display/LED Options
#Combo options
endmenu
menu "Behavior Options"
config ZMK_BEHAVIORS_QUEUE_SIZE
int "Maximum number of behaviors to allow queueing from a macro or other complex behavior"
default 64
endmenu
menu "Advanced"
menu "Initialization Priorities"
if USB
if USB_DEVICE_STACK
config ZMK_USB_INIT_PRIORITY
int "USB Init Priority"
@ -436,15 +480,6 @@ config ZMK_LOG_LEVEL
config USB_CDC_ACM_RINGBUF_SIZE
default 1024
config USB_CDC_ACM_DEVICE_NAME
default "CDC_ACM"
config USB_CDC_ACM_DEVICE_COUNT
default 1
config UART_CONSOLE_ON_DEV_NAME
default "CDC_ACM_0"
config LOG_BUFFER_SIZE
default 8192
@ -481,7 +516,7 @@ config KERNEL_BIN_NAME
config REBOOT
default y
config USB
config USB_DEVICE_STACK
default y if HAS_HW_NRF_USBD
config ZMK_WPM

View file

@ -6,6 +6,8 @@
/dts-v1/;
#include <st/f0/stm32f072Xb.dtsi>
#include <st/f0/stm32f072c(8-b)tx-pinctrl.dtsi>
#include <dt-bindings/led/led.h>
/ {
model = "Keeb.io BDN9 rev2";
@ -14,12 +16,13 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan;
/* TODO: Enable once the GPIO bitbanging driver supports STM32
zmk,underglow = &led_strip;
*/
};
kscan: kscan {
compatible = "zmk,kscan-gpio-direct";
label = "KSCAN";
@ -80,8 +83,32 @@
};
};
&clk_hsi {
status = "okay";
};
&pll {
status = "okay";
prediv = <1>;
mul = <6>;
clocks = <&clk_hsi>;
};
&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(48)>;
ahb-prescaler = <1>;
apb1-prescaler = <1>;
};
&usb {
status = "okay";
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
pinctrl-names = "default";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
&rtc {
@ -99,7 +126,7 @@
#size-cells = <1>;
/* Set 6Kb of storage at the end of the 128Kb of flash */
storage_partition: partition@3e800 {
storage_partition: partition@1e800 {
label = "storage";
reg = <0x0001e800 0x00001800>;
};

View file

@ -11,8 +11,11 @@ CONFIG_FPU=y
# enable GPIO
CONFIG_GPIO=y
# Enable pinmux
CONFIG_PINMUX=y
# Enable pinctrl
CONFIG_PINCTRL=y
# Poll to avoid interrupt overlap issues
CONFIG_ZMK_KSCAN_DIRECT_POLLING=y
# Needed to reduce this to size that will fit on F072
CONFIG_HEAP_MEM_POOL_SIZE=1024
@ -20,13 +23,3 @@ CONFIG_HEAP_MEM_POOL_SIZE=1024
# clock configuration
CONFIG_CLOCK_CONTROL=y
# Clock configuration for Cube Clock control driver
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# use HSI as PLL input
CONFIG_CLOCK_STM32_PLL_SRC_HSI=y
# produce 72MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_PREDIV=1
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=12
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=2
CONFIG_CLOCK_STM32_APB2_PRESCALER=1

View file

@ -1,8 +0,0 @@
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

@ -8,15 +8,12 @@ if BOARD_BLUEMICRO840_V1
config BOARD
default "bluemicro840_v1"
if USB
if USB_DEVICE_STACK
config USB_NRFX
default y
config USB_DEVICE_STACK
default y
endif # USB
endif # USB_DEVICE_STACK
config BT_CTLR
default BT

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};
leds {
@ -73,6 +74,10 @@
&usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

View file

@ -11,6 +11,7 @@ CONFIG_ARM_MPU=y
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y

View file

@ -1,8 +0,0 @@
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

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
@ -84,6 +85,10 @@
&usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

View file

@ -22,7 +22,7 @@
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,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(3,0) 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,12)
RC(4,0) RC(4,1) RC(4,2) RC(4,6) RC(4,10) RC(4,11) RC(4,12) RC(4,13) RC(4,14)
>;
};

View file

@ -15,6 +15,7 @@ CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y

View file

@ -15,6 +15,7 @@ CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y

View file

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

View file

@ -3,5 +3,5 @@
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/dfu-util.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -16,6 +16,7 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
@ -67,6 +68,10 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) RC(
&usb {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
&flash0 {

View file

@ -1,67 +0,0 @@
/*
* 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(const 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

@ -17,6 +17,7 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan;
zmk,matrix_transform = &transform;
/* TODO: Enable once we support the IC for underglow
@ -98,6 +99,7 @@
&i2c2 {
pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>;
pinctrl-names = "default";
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
@ -116,8 +118,31 @@
status = "okay";
};
&clk_hsi {
status = "okay";
};
&pll {
prediv = <1>;
mul = <6>;
clocks = <&clk_hsi>;
status = "okay";
};
&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(48)>;
ahb-prescaler = <1>;
apb1-prescaler = <1>;
};
&rtc {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
&flash0 {

View file

@ -7,7 +7,7 @@ CONFIG_SOC_STM32F072XB=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000
# enable PINMUX
CONFIG_PINMUX=y
CONFIG_PINCTRL=y
# enable GPIO
CONFIG_GPIO=y
@ -31,13 +31,3 @@ CONFIG_HEAP_MEM_POOL_SIZE=1024
# clock configuration
CONFIG_CLOCK_CONTROL=y
# Clock configuration for Cube Clock control driver
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# use HSI as PLL input
CONFIG_CLOCK_STM32_PLL_SRC_HSI=y
# produce 48MHz clock at PLL output
# CONFIG_CLOCK_STM32_PLL_PREDIV=1
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=6
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=1
# CONFIG_CLOCK_STM32_APB2_PRESCALER=1

View file

@ -1,11 +1,3 @@
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
)
if(CONFIG_PINMUX)
zephyr_library()

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};
leds {
@ -29,7 +30,8 @@
ext-power {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
init-delay-ms = <50>;
};
vbatt {
@ -71,6 +73,10 @@
&usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

View file

@ -11,6 +11,7 @@ CONFIG_ARM_MPU=y
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y

View file

@ -1,8 +0,0 @@
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/../tools/uf2/utils/uf2conv.py
-c
-b 0x1000
-f 0xADA52840
-o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.uf2
${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
)

View file

@ -6,15 +6,12 @@ if BOARD_NICE60
config ZMK_KEYBOARD_NAME
default "nice!60"
if USB
if USB_DEVICE_STACK
config USB_NRFX
default y
config USB_DEVICE_STACK
default y
endif # USB
endif # USB_DEVICE_STACK
config BT_CTLR
default BT

View file

@ -6,6 +6,8 @@
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <dt-bindings/led/led.h>
#include <dt-bindings/zmk/matrix_transform.h>
/ {
@ -16,6 +18,7 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
zmk,underglow = &led_strip;
@ -123,11 +126,16 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) R
chain-length = <12>; /* LED strip length */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
&usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
&flash0 {

View file

@ -12,6 +12,7 @@ CONFIG_ARM_MPU=y
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y

View file

@ -1,8 +0,0 @@
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

@ -6,15 +6,12 @@ if BOARD_NICE_NANO || BOARD_NICE_NANO_V2
config BOARD
default "nice_nano"
if USB
if USB_DEVICE_STACK
config USB_NRFX
default y
config USB_DEVICE_STACK
default y
endif # USB
endif # USB_DEVICE_STACK
config BT_CTLR
default BT

View file

@ -15,6 +15,7 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};
leds {
@ -56,6 +57,10 @@
&usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

View file

@ -11,6 +11,7 @@ CONFIG_ARM_MPU=y
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y

View file

@ -12,7 +12,7 @@
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
init-delay-ms = <10>;
init-delay-ms = <50>;
};
vbatt {

View file

@ -11,6 +11,7 @@ CONFIG_ARM_MPU=y
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y

View file

@ -1,11 +0,0 @@
# 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

@ -6,15 +6,12 @@ if BOARD_NRF52840_M2
config BOARD
default "nrf52480_m2"
if USB
if USB_DEVICE_STACK
config USB_NRFX
default y
config USB_DEVICE_STACK
default y
endif # USB
endif # USB_DEVICE_STACK
config BT_CTLR
default BT

View file

@ -15,6 +15,7 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};
leds {
@ -54,6 +55,10 @@
&usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

View file

@ -12,6 +12,7 @@ CONFIG_ARM_MPU=y
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y

View file

@ -1,11 +1,3 @@
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
)
if(CONFIG_PINMUX)
zephyr_library()

View file

@ -8,15 +8,12 @@ if BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13
config BOARD
default "nrfmicro"
if USB
if USB_DEVICE_STACK
config USB_NRFX
default y
config USB_DEVICE_STACK
default y
endif # USB
endif # USB_DEVICE_STACK
config BT_CTLR
default BT

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};
leds {
@ -59,6 +60,10 @@
&usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

View file

@ -11,6 +11,7 @@ CONFIG_ARM_MPU=y
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};
leds {
@ -59,6 +60,10 @@
&usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

View file

@ -11,6 +11,7 @@ CONFIG_ARM_MPU=y
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};
leds {
@ -71,6 +72,10 @@
&usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

View file

@ -11,6 +11,7 @@ CONFIG_ARM_MPU=y
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y

View file

@ -2,8 +2,3 @@
list(APPEND EXTRA_DTC_FLAGS "-qq")
if(CONFIG_PINMUX)
zephyr_library()
zephyr_library_sources(pinmux.c)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
endif()

View file

@ -1,67 +0,0 @@
/*
* 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[] = {
#ifdef CONFIG_UART_1
{STM32_PIN_PC4, STM32F3_PINMUX_FUNC_PC4_USART1_TX},
{STM32_PIN_PC5, STM32F3_PINMUX_FUNC_PC5_USART1_RX},
#endif /* CONFIG_UART_1 */
#ifdef CONFIG_UART_2
{STM32_PIN_PA2, STM32F3_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F3_PINMUX_FUNC_PA3_USART2_RX},
#endif /* CONFIG_UART_2 */
#ifdef CONFIG_I2C_1
{STM32_PIN_PB6, STM32F3_PINMUX_FUNC_PB6_I2C1_SCL},
{STM32_PIN_PB7, STM32F3_PINMUX_FUNC_PB7_I2C1_SDA},
#endif /* CONFIG_I2C_1 */
#ifdef CONFIG_I2C_2
{STM32_PIN_PA9, STM32F3_PINMUX_FUNC_PA9_I2C2_SCL},
{STM32_PIN_PA10, STM32F3_PINMUX_FUNC_PA10_I2C2_SDA},
#endif /* CONFIG_I2C_2 */
#ifdef CONFIG_SPI_1
#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 /* CONFIG_SPI_1 */
#ifdef CONFIG_SPI_2
#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 /* CONFIG_SPI_2 */
#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 */
#ifdef CONFIG_CAN_1
{STM32_PIN_PD0, STM32F3_PINMUX_FUNC_PD0_CAN1_RX},
{STM32_PIN_PD1, STM32F3_PINMUX_FUNC_PD1_CAN1_TX},
#endif /* CONFIG_CAN_1 */
};
static int pinmux_stm32_init(const 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

@ -1,11 +1,12 @@
/*
* Copyright (c) 2017 I-SENSE group of ICCS
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/dts-v1/;
#include <st/f3/stm32f303Xc.dtsi>
#include <st/f3/stm32f303c(b-c)tx-pinctrl.dtsi>
#include <dt-bindings/zmk/matrix_transform.h>
/ {
@ -15,8 +16,9 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0;
zmk,matrix_transform = &layout_grid_transform;
zmk,matrix_transform = &layout_grid_transform;
};
kscan0: kscan {
@ -82,7 +84,33 @@ layout_2x2u_transform:
};
&usb {
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
pinctrl-names = "default";
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
&clk_hse {
status = "okay";
clock-frequency = <DT_FREQ_M(8)>;
};
&pll {
prediv = <1>;
mul = <9>;
clocks = <&clk_hse>;
status = "okay";
};
&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(72)>;
ahb-prescaler = <1>;
apb1-prescaler = <2>;
apb2-prescaler = <1>;
};
&flash0 {

View file

@ -8,21 +8,10 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000
# enable pinmux
CONFIG_PINMUX=y
CONFIG_PINCTRL=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

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Pete Johanson
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
@ -16,6 +16,11 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart0;
};
aliases {
led0 = &led;
};
leds {
@ -29,18 +34,47 @@
&usart1 {
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
pinctrl-names = "default";
};
&spi2 {
pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15>;
pinctrl-names = "default";
};
&i2c1 {
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
pinctrl-names = "default";
};
&clk_hse {
status = "okay";
clock-frequency = <DT_FREQ_M(8)>;
};
&pll {
prediv = <1>;
mul = <9>;
clocks = <&clk_hse>;
status = "okay";
};
&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(72)>;
ahb-prescaler = <1>;
apb1-prescaler = <2>;
apb2-prescaler = <1>;
};
&usb {
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
pinctrl-names = "default";
status = "okay";
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
&rtc {

View file

@ -8,8 +8,8 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000
# Floating Point Options
CONFIG_FPU=y
# enable pinmux
CONFIG_PINMUX=y
# enable pinctrl
CONFIG_PINCTRL=y
# enable GPIO
CONFIG_GPIO=y
@ -17,14 +17,3 @@ 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

@ -1,8 +0,0 @@
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/../tools/uf2/utils/uf2conv.py
-c
-b 0x1000
-f 0xADA52840
-o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.uf2
${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
)

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
@ -95,6 +96,10 @@
&usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
&flash0 {

View file

@ -12,6 +12,7 @@ CONFIG_ARM_MPU=y
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y

View file

@ -0,0 +1,9 @@
file_format: "1"
id: seeeduino_xiao
name: Seeeduino XIAO
type: board
arch: arm
outputs:
- usb
url: https://wiki.seeedstudio.com/Seeeduino-XIAO/
exposes: [seeed_xiao]

View file

@ -0,0 +1,10 @@
file_format: "1"
id: seeeduino_xiao_ble
name: Seeeduino XIAO BLE
type: board
arch: arm
outputs:
- usb
- ble
url: https://wiki.seeedstudio.com/XIAO_BLE/
exposes: [seeed_xiao]

View file

@ -8,3 +8,7 @@ description: |
The SparkFun Pro Micro grew popular as a low cost ATmega32U4 board with sufficient GPIO and peripherals
to work for many keyboard needs. Since the original Pro Micro, many pin compatible boards have appeared,
with various changes or improvements, such as the Elite-C w/ USB-C, nice!nano with nRF52840 wireless.
Note: ZMK doesn't support boards with AVR 8-bit processors, such as the ATmega32U4, because Zephyr™ only
supports 32-bit and 64-bit platforms. As a result, controllers like the SparkFun Pro Micro and the Elite-C
are *not* supported by ZMK.

View file

@ -0,0 +1,10 @@
file_format: "1"
id: seeed_xiao
name: Seeed XIAO
type: interconnect
url: https://wiki.seeedstudio.com/Seeeduino-XIAO/
manufacturer: Seeed
description: |
The Seeed(uino) XIAO is a popular smaller format micro-controller, that has gained popularity as an alterative
to the SparkFun Pro Micro. Since its creation, several pin compatible controllers, such
as the Seeeduino XIAO BLE, Adafruit QT Py and Adafruit QT Py RP2040, have become available.

View file

@ -0,0 +1,11 @@
CONFIG_KSCAN=n
CONFIG_ZMK_KSCAN_MOCK_DRIVER=y
CONFIG_ZMK_KSCAN_GPIO_DRIVER=n
CONFIG_GPIO=n
# Enable to have the native posix build expose USBIP device(s)
# CONFIG_ZMK_USB=y
CONFIG_LOG=y
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_ZMK_LOG_LEVEL_DBG=y
CONFIG_DEBUG=y
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000

View file

@ -0,0 +1,18 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/kscan_mock.h>
/ {
chosen {
zmk,kscan = &kscan;
};
kscan: kscan {
compatible = "zmk,kscan-mock";
label = "KSCAN_MOCK";
rows = <2>;
columns = <2>;
exit-after;
};
};

View file

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

View file

@ -0,0 +1,19 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/ {
chosen {
zephyr,console = &cdc_acm_uart;
};
};
&usb0 {
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

View file

@ -0,0 +1,8 @@
CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_UART_INTERRUPT_DRIVEN=n
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View file

@ -0,0 +1,33 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/ {
chosen {
zephyr,console = &cdc_acm_uart;
};
vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 7>;
power-gpios = <&gpio0 14 (GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>;
output-ohms = <1000000>;
full-ohms = <(1000000 + 510000)>;
};
};
&adc {
status = "okay";
};
&usbd {
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

View file

@ -0,0 +1,9 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_BAT43
config ZMK_KEYBOARD_NAME
default "Bat43"
endif

View file

@ -0,0 +1,5 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
config SHIELD_BAT43
def_bool $(shields_list_contains,bat43)

View file

@ -0,0 +1,50 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>
#define LOWER 1
#define RAISE 2
#define L_SPC &lt LOWER SPACE
#define R_RET &lt RAISE RET
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp MINUS
&kp TAB &kp A &kp S &kp D &kp F &kp G &kp BSPC &kp H &kp J &kp K &kp L &kp SEMI &kp RSHFT
&kp LCTRL &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL
&kp LGUI &kp LANG2 L_SPC R_RET &kp LANG1 &kp RALT
&bt BT_CLR &out OUT_TOG &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2
>;
};
lower_layer {
bindings = <
&trans &none &none &none &none &none &none &kp EQUAL &kp PLUS &kp STAR &kp PRCNT &trans
&trans &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &trans &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &trans
&trans &none &none &none &none &none &none &none &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans
>;
};
raise_layer {
bindings = <
&trans &kp BSLH &kp EXCL &kp AMPS &kp PIPE &none &none &kp EQUAL &kp PLUS &kp STAR &kp PRCNT &trans
&trans &kp HASH &kp GRAVE &kp DQT &kp SQT &kp TILDE &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp DLLR &trans
&trans &none &none &kp LBRC &kp LBKT &kp LPAR &kp RPAR &kp RBKT &kp RBRC &kp AT &kp CARET &trans
&trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans
>;
};
};
};

View file

@ -0,0 +1,54 @@
/*
* Copyright (c) 2021 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 = <6>;
rows = <7>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(3,0) RC(5,0) RC(5,1) RC(5,2) RC(5,3) RC(5,4) RC(5,5)
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) RC(6,3) RC(6,4) RC(6,5)
RC(3,3) RC(3,4) RC(3,5) RC(7,0) RC(7,1) RC(7,2)
RC(7,5) RC(7,4) RC(7,3) RC(3,1) RC(3,2)
>;
};
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
col-gpios
= <&pro_micro 10 GPIO_ACTIVE_HIGH>
, <&pro_micro 16 GPIO_ACTIVE_HIGH>
, <&pro_micro 14 GPIO_ACTIVE_HIGH>
, <&pro_micro 15 GPIO_ACTIVE_HIGH>
, <&pro_micro 9 GPIO_ACTIVE_HIGH>
, <&pro_micro 8 GPIO_ACTIVE_HIGH>
;
row-gpios
= <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};

View file

@ -0,0 +1,8 @@
file_format: "1"
id: bat43
name: BAT43
type: shield
url: https://kbd.dailycraft.jp/bat43/
requires: [pro_micro]
features:
- keys

View file

@ -1,3 +1,5 @@
#include <dt-bindings/led/led.h>
&spi1 {
compatible = "nordic,nrf-spim";
status = "okay";
@ -18,6 +20,8 @@
chain-length = <14>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};

View file

@ -1,3 +1,5 @@
#include <dt-bindings/led/led.h>
&spi1 {
compatible = "nordic,nrf-spim";
status = "okay";
@ -18,6 +20,8 @@
chain-length = <14>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};

View file

@ -0,0 +1,19 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_CLOG_LEFT
config ZMK_KEYBOARD_NAME
default "Clog"
config ZMK_SPLIT_BLE_ROLE_CENTRAL
default y
endif
if SHIELD_CLOG_LEFT || SHIELD_CLOG_RIGHT
config ZMK_SPLIT
default y
endif

View file

@ -0,0 +1,8 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
config SHIELD_CLOG_LEFT
def_bool $(shields_list_contains,clog_left)
config SHIELD_CLOG_RIGHT
def_bool $(shields_list_contains,clog_right)

View file

@ -0,0 +1,8 @@
# The Clog
The Clog is a 34-key choc v1 split board by S'mores. This firmware works for both the [Clog][clog],
as well as the [Sephirette][sephirette], the MX version. You can purchase kits for both boards
at smoresboards.com.
[clog]: https://github.com/smores56/clog
[sephirette]: https://github.com/smores56/sephirette

View file

View file

@ -0,0 +1,51 @@
/*
* Copyright (c) 2022 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,20) RC(0,19) RC(0,18) RC(0,17)
RC(0,4) 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,21)
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 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 20 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
;
};
};

View file

@ -0,0 +1,113 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#define MAIN 0
#define SYM 1
#define NAV 2
#define BT 3
&mt {
flavor = "tap-preferred";
tapping_term_ms = <140>;
};
/ {
combos {
compatible = "zmk,combos";
combo_esc {
timeout-ms = <100>;
key-positions = <21 22>;
bindings = <&kp ESC>;
};
combo_tab {
timeout-ms = <100>;
key-positions = <22 23>;
bindings = <&kp TAB>;
};
combo_minus {
timeout-ms = <100>;
key-positions = <26 27>;
bindings = <&kp MINUS>;
};
combo_underscore {
timeout-ms = <100>;
key-positions = <26 28>;
bindings = <&kp UNDERSCORE>;
};
combo_colon {
timeout-ms = <100>;
key-positions = <7 8>;
bindings = <&kp COLON>;
};
combo_semicolon {
timeout-ms = <100>;
key-positions = <6 8>;
bindings = <&kp SEMICOLON>;
};
combo_backslash {
timeout-ms = <100>;
key-positions = <27 28>;
bindings = <&kp BSLH>;
};
combo_grave {
timeout-ms = <100>;
key-positions = <8 9>;
bindings = <&kp GRAVE>;
};
};
keymap {
compatible = "zmk,keymap";
MAIN_layer {
bindings = <
&kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O
&kp Q &kp A &kp S &kp D &lt SYM F &kp G &kp H &lt SYM J &kp K &kp L &kp SQT &kp P
&mt LSHFT Z &mt LALT X &mt LCTRL C &mt LGUI V &kp B &kp N &mt RGUI M &mt RCTRL COMMA &mt RALT DOT &mt RSHFT FSLH
&lt BT ENTER &lt NAV SPACE &sk RSHFT &kp BSPC
>;
};
SYM_layer {
bindings = <
&kp N7 &kp N8 &kp N9 &kp STAR &kp DLLR &kp LBRC &kp RBRC &kp HASH
&kp AMPS &kp EXCL &kp N1 &kp N2 &kp N3 &kp EQUAL &kp LT &kp LPAR &kp RPAR &kp GT &kp PIPE &none
&kp CARET &kp N4 &kp N5 &kp N6 &kp PLUS &kp TILDE &kp LBKT &kp RBKT &kp AT &kp PRCNT
&kp DOT &kp N0 &trans &none
>;
};
NAV_layer {
bindings = <
&kp C_VOL_DN &kp C_VOL_UP &kp C_NEXT &kp C_PP &none &kp F7 &kp F8 &kp F9
&kp C_PREV &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp LC(TAB) &kp PSCRN &kp F1 &kp F2 &kp F3 &kp F10 &kp F12
&kp HOME &kp PG_DN &kp PG_UP &kp END &kp LS(LC(TAB)) &kp CAPS &kp F4 &kp F5 &kp F6 &kp F11
&none &none &trans &kp DEL
>;
};
BT_layer {
bindings = <
&none &none &none &none &none &none &none &none
&none &none &none &none &none &none &none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &none
&none &none &none &none &none &none &bt BT_CLR &none &none &none
&none &none &none &none
>;
};
};
};

View file

@ -0,0 +1,11 @@
file_format: "1"
id: clog
name: Clog
type: shield
url: https://github.com/smores56/clog
requires: [pro_micro]
features:
- keys
siblings:
- clog_left
- clog_right

View file

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

View file

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

View file

@ -0,0 +1,9 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_CONTRA
config ZMK_KEYBOARD_NAME
default "Contra Keyboard"
endif

View file

@ -0,0 +1,5 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
config SHIELD_CONTRA
def_bool $(shields_list_contains,contra)

View file

View file

@ -0,0 +1,46 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#define DEFAULT 0
#define NUM_MODS 1
#define BT_CTRL 2
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC
&kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp ENTER
&kp LCTRL &kp LGUI &kp LALT &kp BSLH &to DEFAULT &kp SPACE &trans &to NUM_MODS &kp LEFT &kp RIGHT &kp UP &kp DOWN
>;
};
num_mods {
bindings = <
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp DEL
&kp TAB &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp MINUS &kp PG_UP &kp LBKT &kp RBKT &kp BSLH
&kp LSHFT &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp EQUAL &kp PG_DN &kp HOME &kp END &kp ENTER
&kp LCTRL &kp LGUI &kp LALT &reset &to DEFAULT &kp SPACE &trans &mo BT_CTRL &kp LEFT &kp RIGHT &kp UP &kp DOWN
>;
};
bt_control {
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
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &bt BT_PRV &bt BT_NXT &trans &trans
>;
};
};
};

View file

@ -0,0 +1,39 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/ {
chosen {
zmk,kscan = &kscan0;
};
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
col-gpios
= <&pro_micro 21 GPIO_ACTIVE_HIGH>
, <&pro_micro 20 GPIO_ACTIVE_HIGH>
, <&pro_micro 9 GPIO_ACTIVE_HIGH>
, <&pro_micro 8 GPIO_ACTIVE_HIGH>
, <&pro_micro 7 GPIO_ACTIVE_HIGH>
, <&pro_micro 6 GPIO_ACTIVE_HIGH>
, <&pro_micro 5 GPIO_ACTIVE_HIGH>
, <&pro_micro 4 GPIO_ACTIVE_HIGH>
, <&pro_micro 3 GPIO_ACTIVE_HIGH>
, <&pro_micro 2 GPIO_ACTIVE_HIGH>
, <&pro_micro 0 GPIO_ACTIVE_HIGH>
, <&pro_micro 1 GPIO_ACTIVE_HIGH>
;
row-gpios
= <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};

View file

@ -0,0 +1,8 @@
file_format: "1"
id: contra
name: Contra
type: shield
url: https://github.com/ai03-2725/Contra
requires: [pro_micro]
features:
- keys

View file

@ -1,3 +1,5 @@
#include <dt-bindings/led/led.h>
&spi1 {
compatible = "nordic,nrf-spim";
/* Cannot be used together with i2c0. */
@ -19,6 +21,8 @@
chain-length = <6>; /* There are per-key RGB, but the first 6 are underglow */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};

View file

@ -8,6 +8,7 @@
/ {
chosen {
zephyr,display = &oled;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};

View file

@ -0,0 +1,55 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_ELEPHANT42_LEFT
config ZMK_KEYBOARD_NAME
default "Elephant42"
config ZMK_SPLIT_BLE_ROLE_CENTRAL
default y
endif
if SHIELD_ELEPHANT42_LEFT || SHIELD_ELEPHANT42_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_MAX
default 128
config LVGL_VER_RES_MAX
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) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
config SHIELD_ELEPHANT42_LEFT
def_bool $(shields_list_contains,elephant42_left)
config SHIELD_ELEPHANT42_RIGHT
def_bool $(shields_list_contains,elephant42_right)

View file

@ -0,0 +1,32 @@
#include <dt-bindings/led/led.h>
&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 = "WS2812";
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <27>; /* There are per-key RGB and the LAST 6 are underglow */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View file

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

View file

@ -0,0 +1,60 @@
/*
* Copyright (c) 2021 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 = <12>;
rows = <4>;
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(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(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(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9)
>;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
row-gpios
= <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};
&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>;
};
};

View file

@ -0,0 +1,55 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>
#define LOWR 1
#define RAIS 2
#define ADJT 3
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&lt ADJT ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp DEL
&mt LCTRL TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH
&kp LSHFT &mo LOWR &kp LGUI &kp BSPC &kp SPACE &kp ENTER &mo RAIS &kp LALT
>;
};
lower {
bindings = <
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp C_PLAY_PAUSE
&trans &trans &trans &trans &trans &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans &trans
&trans &trans &trans &trans &kp LBKT &kp RBKT &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans
>;
};
raise {
bindings = <
&kp TILDE &trans &trans &trans &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp C_PLAY_PAUSE
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp BSLH
&trans &trans &trans &trans &kp LBKT &kp RBKT &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans
>;
};
adjust {
bindings = <
&trans &bt BT_NXT &bt BT_PRV &trans &trans &bt BT_CLR &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&out OUT_TOG &trans &trans &trans &trans &trans &trans &trans
>;
};
};
};

View file

@ -0,0 +1,14 @@
file_format: "1"
id: elephant42
name: Elephant42
type: shield
url: https://github.com/illness072/elephant42
requires: [pro_micro]
exposes: [i2c_oled]
features:
- keys
- display
- underglow
siblings:
- elephant42_left
- elephant42_right

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "elephant42.dtsi"
&kscan0 {
col-gpios
= <&pro_micro 21 GPIO_ACTIVE_HIGH>
, <&pro_micro 20 GPIO_ACTIVE_HIGH>
, <&pro_micro 19 GPIO_ACTIVE_HIGH>
, <&pro_micro 18 GPIO_ACTIVE_HIGH>
, <&pro_micro 15 GPIO_ACTIVE_HIGH>
, <&pro_micro 14 GPIO_ACTIVE_HIGH>
;
};

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