Merge branch 'main' into pteron36
This commit is contained in:
commit
59fe7491e2
1106 changed files with 40013 additions and 27135 deletions
|
@ -1,4 +1,4 @@
|
|||
FROM zmkfirmware/zmk-dev-arm:2.4
|
||||
FROM docker.io/zmkfirmware/zmk-dev-arm:3.0
|
||||
|
||||
COPY .bashrc tmp
|
||||
RUN mv /tmp/.bashrc ~/.bashrc
|
||||
|
|
13
.github/pull_request_template.md
vendored
Normal file
13
.github/pull_request_template.md
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
<!-- If you're adding a board/shield please fill out this check-list, otherwise you can delete it -->
|
||||
## Board/Shield Check-list
|
||||
- [ ] This board/shield is tested working on real hardware
|
||||
- [ ] Definitions follow the general style of other shields/boards upstream ([Reference](https://zmk.dev/docs/development/new-shield))
|
||||
- [ ] `.zmk.yml` metadata file added
|
||||
- [ ] Proper Copyright + License headers added to applicable files (Generally, we stick to "The ZMK Contributors" for copyrights to help avoid churn when files get edited)
|
||||
- [ ] General consistent formatting of DeviceTree files
|
||||
- [ ] Keymaps do not use deprecated key defines (Check using the [upgrader tool](https://zmk.dev/docs/codes/keymap-upgrader))
|
||||
- [ ] `&pro_micro` used in favor of `&pro_micro_d/a` if applicable
|
||||
- [ ] If split, no name added for the right/peripheral half
|
||||
- [ ] Kconfig.defconfig file correctly wraps *all* configuration in conditional on the shield symbol
|
||||
- [ ] `.conf` file has optional extra features commented out
|
||||
- [ ] Keyboard/PCB is part of a shipped group buy or is generally available in stock to purchase (OSH/personal projects without general availability should create a zmk-config repo instead)
|
131
.github/workflows/build-user-config.yml
vendored
Normal file
131
.github/workflows/build-user-config.yml
vendored
Normal file
|
@ -0,0 +1,131 @@
|
|||
name: Reusable user config build
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
build_matrix_path:
|
||||
description: "Path to the build matrix file"
|
||||
default: "build.yaml"
|
||||
required: false
|
||||
type: string
|
||||
config_path:
|
||||
description: "Path to the config directory"
|
||||
default: "config"
|
||||
required: false
|
||||
type: string
|
||||
fallback_binary:
|
||||
description: "Fallback binary format, if no *.uf2 file was built"
|
||||
default: "bin"
|
||||
required: false
|
||||
type: string
|
||||
artifact_name:
|
||||
description: 'Artifact output file name'
|
||||
default: 'firmware'
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
matrix:
|
||||
runs-on: ubuntu-latest
|
||||
name: Fetch Build Keyboards
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install yaml2json
|
||||
run: python3 -m pip install remarshal
|
||||
|
||||
- name: Fetch Build Matrix
|
||||
id: set-matrix
|
||||
run: |
|
||||
set -x
|
||||
matrix=$(yaml2json ${{ inputs.build_matrix_path }} | jq -c .)
|
||||
yaml2json ${{ inputs.build_matrix_path }}
|
||||
echo "::set-output name=matrix::${matrix}"
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: zmkfirmware/zmk-build-arm:stable
|
||||
needs: matrix
|
||||
name: Build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
|
||||
steps:
|
||||
- name: Prepare variables
|
||||
id: variables
|
||||
run: |
|
||||
set -x
|
||||
if [ -n "${{ matrix.shield }}" ]
|
||||
then
|
||||
EXTRA_CMAKE_ARGS="-DSHIELD=${{ matrix.shield }}"
|
||||
ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk"
|
||||
DISPLAY_NAME="${{ matrix.shield }} - ${{ matrix.board }}"
|
||||
else
|
||||
EXTRA_CMAKE_ARGS=
|
||||
DISPLAY_NAME="${{ matrix.board }}"
|
||||
ARTIFACT_NAME="${{ matrix.board }}-zmk"
|
||||
fi
|
||||
echo ::set-output name=extra-cmake-args::${EXTRA_CMAKE_ARGS}
|
||||
echo ::set-output name=artifact-name::${ARTIFACT_NAME}
|
||||
echo ::set-output name=display-name::${DISPLAY_NAME}
|
||||
echo ::set-output name=zephyr-version::${ZEPHYR_VERSION}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache west modules
|
||||
uses: actions/cache@v3.0.2
|
||||
continue-on-error: true
|
||||
env:
|
||||
cache-name: cache-zephyr-${{ steps.variables.outputs.zephyr-version }}-modules
|
||||
with:
|
||||
path: |
|
||||
modules/
|
||||
tools/
|
||||
zephyr/
|
||||
bootloader/
|
||||
zmk/
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: West Init
|
||||
run: west init -l ${{ inputs.config_path }}
|
||||
|
||||
- name: West Update
|
||||
run: west update
|
||||
|
||||
- name: West Zephyr export
|
||||
run: west zephyr-export
|
||||
|
||||
- name: West Build (${{ steps.variables.outputs.display-name }})
|
||||
run: |
|
||||
set -x
|
||||
west build -s zmk/app -b ${{ matrix.board }} -- -DZMK_CONFIG=${GITHUB_WORKSPACE}/${{ inputs.config_path }} ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }}
|
||||
|
||||
- name: ${{ steps.variables.outputs.display-name }} Kconfig file
|
||||
run: grep -v -e "^#" -e "^$" build/zephyr/.config | sort
|
||||
|
||||
- name: Rename artifacts
|
||||
run: |
|
||||
set -x
|
||||
mkdir build/artifacts
|
||||
if [ -f build/zephyr/zmk.uf2 ]
|
||||
then
|
||||
cp build/zephyr/zmk.uf2 "build/artifacts/${{ steps.variables.outputs.artifact-name }}.uf2"
|
||||
elif [ -f build/zephyr/zmk.${{ inputs.fallback_binary }} ]
|
||||
then
|
||||
cp build/zephyr/zmk.${{ inputs.fallback_binary }} "build/artifacts/${{ steps.variables.outputs.artifact-name }}.${{ inputs.fallback_binary }}"
|
||||
fi
|
||||
|
||||
- name: Archive (${{ steps.variables.outputs.display-name }})
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ inputs.artifact_name }}
|
||||
path: build/artifacts
|
450
.github/workflows/build.yml
vendored
450
.github/workflows/build.yml
vendored
|
@ -9,79 +9,24 @@ on:
|
|||
paths:
|
||||
- ".github/workflows/build.yml"
|
||||
- "app/**"
|
||||
schedule:
|
||||
- cron: '22 4 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: zmkfirmware/zmk-build-arm:2.4
|
||||
image: docker.io/zmkfirmware/zmk-build-arm:3.0
|
||||
needs: compile-matrix
|
||||
strategy:
|
||||
matrix:
|
||||
board:
|
||||
- bluemicro840_v1
|
||||
- nice_nano
|
||||
- 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
|
||||
shield: kyria_left
|
||||
cmake-args: -DCONFIG_ZMK_DISPLAY=y
|
||||
skip-archive: true
|
||||
- board: nice_nano
|
||||
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
|
||||
- name: Cache west modules
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3.0.2
|
||||
env:
|
||||
cache-name: cache-zephyr-modules
|
||||
with:
|
||||
|
@ -103,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
|
||||
|
|
2
.github/workflows/clang-format-lint.yml
vendored
2
.github/workflows/clang-format-lint.yml
vendored
|
@ -23,7 +23,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: DoozyX/clang-format-lint-action@v0.12
|
||||
- uses: DoozyX/clang-format-lint-action@v0.13
|
||||
with:
|
||||
source: "./app"
|
||||
extensions: "h,c"
|
||||
|
|
13
.github/workflows/doc-checks.yml
vendored
13
.github/workflows/doc-checks.yml
vendored
|
@ -31,3 +31,16 @@ jobs:
|
|||
- name: Prettier check
|
||||
run: npm run prettier:check
|
||||
working-directory: docs
|
||||
typecheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: bahmutov/npm-install@v1
|
||||
with:
|
||||
working-directory: docs
|
||||
- name: Build
|
||||
run: npm run build
|
||||
working-directory: docs
|
||||
- name: TypeScript check
|
||||
run: npm run typecheck
|
||||
working-directory: docs
|
||||
|
|
45
.github/workflows/hardware-metadata-validation.yml
vendored
Normal file
45
.github/workflows/hardware-metadata-validation.yml
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
name: Hardware Metadata Validation
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- ".github/workflows/hardware-metadata-validation.yml"
|
||||
- "schema/hardware-metadata.schema.json"
|
||||
- "app/boards/**/*.zmk.yml"
|
||||
- "app/scripts/west_commands/metadata.py"
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/hardware-metadata-validation.yml"
|
||||
- "schema/hardware-metadata.schema.json"
|
||||
- "app/boards/**/*.zmk.yml"
|
||||
- "app/scripts/west_commands/metadata.py"
|
||||
|
||||
jobs:
|
||||
check-metadata-format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2
|
||||
- uses: bahmutov/npm-install@v1
|
||||
with:
|
||||
working-directory: app
|
||||
- name: Prettier Check
|
||||
run: npm run prettier:check
|
||||
working-directory: app
|
||||
validate-metadata:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker.io/zmkfirmware/zmk-dev-arm:3.0
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: pip install -r app/scripts/requirements.txt
|
||||
- name: West init
|
||||
run: west init -l app
|
||||
- name: Update modules (west update)
|
||||
run: west update
|
||||
- name: Export Zephyr CMake package (west zephyr-export)
|
||||
run: west zephyr-export
|
||||
- name: Validate Hardware Metadata
|
||||
working-directory: app
|
||||
run: west metadata check
|
28
.github/workflows/test.yml
vendored
28
.github/workflows/test.yml
vendored
|
@ -13,15 +13,32 @@ 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: zmkfirmware/zmk-build-arm:2.4
|
||||
image: docker.io/zmkfirmware/zmk-build-arm:3.0
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache west modules
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3.0.2
|
||||
env:
|
||||
cache-name: cache-zephyr-modules
|
||||
with:
|
||||
|
@ -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
|
||||
|
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -2,5 +2,6 @@
|
|||
"files.associations": {
|
||||
"*.overlay": "dts",
|
||||
"*.keymap": "dts"
|
||||
}
|
||||
},
|
||||
"python.formatting.provider": "black"
|
||||
}
|
|
@ -60,7 +60,7 @@ representative at an online or offline event.
|
|||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
conduct@zmkfirmware.dev.
|
||||
conduct@zmk.dev.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
|
|
|
@ -7,7 +7,7 @@ you have any questions, please come join us on the
|
|||
## 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.
|
||||
For any and all conduct inquiries or concerns, please contact conduct@zmk.dev.
|
||||
|
||||
[code-of-conduct]: https://github.com/zmkfirmware/zmk/blob/main/CODE_OF_CONDUCT.md
|
||||
|
||||
|
@ -35,8 +35,8 @@ 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.
|
||||
- Review the [Frequently Asked Questions](https://zmk.dev/docs/faq).
|
||||
- Check the [Troubleshooting Guide](https://zmk.dev/docs/troubleshooting) for answers.
|
||||
- Search the [open issues](https://github.com/zmkfirmware/zmk/issues) for an existing report that
|
||||
matches your problem.
|
||||
|
||||
|
@ -47,10 +47,10 @@ 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.
|
||||
- What [board/shield](https://zmk.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)
|
||||
- Any relevant screenshots or [logs](https://zmk.dev/docs/dev-guide-usb-logging)
|
||||
|
||||
## Testing
|
||||
|
||||
|
@ -91,7 +91,7 @@ You can setup git to run prettier automatically when you commit by installing th
|
|||
### 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
|
||||
[basic setup](https://zmk.dev/docs/development/setup/) docs, and make sure you can build and flash
|
||||
your own locally built firmware.
|
||||
|
||||
### Formatting
|
||||
|
@ -124,4 +124,4 @@ When opening a pull request with your changes, please:
|
|||
- Requested testing by reviewers or testers.
|
||||
- Screenshots or logs that support understanding the change.
|
||||
|
||||
[discord-invite]: https://zmkfirmware.dev/community/discord/invite
|
||||
[discord-invite]: https://zmk.dev/community/discord/invite
|
||||
|
|
10
README.md
10
README.md
|
@ -1,13 +1,13 @@
|
|||
# Zephyr™ Mechanical Keyboard (ZMK) Firmware
|
||||
|
||||
[](https://zmkfirmware.dev/community/discord/invite)
|
||||
[](https://zmk.dev/community/discord/invite)
|
||||
[](https://github.com/zmkfirmware/zmk/actions)
|
||||
[](CODE_OF_CONDUCT.md)
|
||||
|
||||
[ZMK Firmware](https://zmkfirmware.dev/) is an open source (MIT) keyboard firmware built on the [Zephyr™ Project](https://www.zephyrproject.org/) Real Time Operating System (RTOS). ZMK's goal is to provide a modern, wireless, and powerful firmware free of licensing issues.
|
||||
[ZMK Firmware](https://zmk.dev/) is an open source (MIT) keyboard firmware built on the [Zephyr™ Project](https://www.zephyrproject.org/) Real Time Operating System (RTOS). ZMK's goal is to provide a modern, wireless, and powerful firmware free of licensing issues.
|
||||
|
||||
Check out the website to learn more: https://zmkfirmware.dev/
|
||||
Check out the website to learn more: https://zmk.dev/
|
||||
|
||||
You can also come join our [ZMK Discord Server](https://zmkfirmware.dev/community/discord/invite)
|
||||
You can also come join our [ZMK Discord Server](https://zmk.dev/community/discord/invite)
|
||||
|
||||
To review features, check out the [feature overview](https://zmkfirmware.dev/docs/). ZMK is under active development, and new features are listed with the [enhancement label](https://github.com/zmkfirmware/zmk/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) in GitHub. Please feel free to add 👍 to the issue description of any requests to upvote the feature.
|
||||
To review features, check out the [feature overview](https://zmk.dev/docs/). ZMK is under active development, and new features are listed with the [enhancement label](https://github.com/zmkfirmware/zmk/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) in GitHub. Please feel free to add 👍 to the issue description of any requests to upvote the feature.
|
||||
|
|
1
app/.gitignore
vendored
1
app/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
build/
|
||||
node_modules/
|
||||
|
|
3
app/.prettierrc.js
Normal file
3
app/.prettierrc.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
endOfLine: "auto",
|
||||
};
|
|
@ -1,18 +1,16 @@
|
|||
cmake_minimum_required(VERSION 3.13.1)
|
||||
|
||||
set(CONFIG_APPLICATION_DEFINED_SYSCALL true)
|
||||
list(APPEND BOARD_ROOT ${CMAKE_SOURCE_DIR})
|
||||
list(APPEND DTS_ROOT ${CMAKE_SOURCE_DIR})
|
||||
|
||||
# Add our custom Zephyr module for drivers w/ syscalls, etc.
|
||||
list(APPEND DTS_ROOT ${CMAKE_SOURCE_DIR}/drivers/zephyr)
|
||||
|
||||
set(ZephyrBuildConfiguration_ROOT ${CMAKE_SOURCE_DIR}/cmake)
|
||||
|
||||
list(APPEND ZEPHYR_EXTRA_MODULES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers
|
||||
)
|
||||
|
||||
include(cmake/zmk_config.cmake)
|
||||
|
||||
# Find Zephyr. This also loads Zephyr's build system.
|
||||
find_package(Zephyr REQUIRED HINTS ../zephyr)
|
||||
project(zmk)
|
||||
|
@ -22,58 +20,71 @@ 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)
|
||||
target_sources(app PRIVATE src/hid.c)
|
||||
target_sources(app PRIVATE src/sensors.c)
|
||||
target_sources_ifdef(CONFIG_ZMK_WPM app PRIVATE src/wpm.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/activity_state_changed.c)
|
||||
target_sources(app PRIVATE src/events/position_state_changed.c)
|
||||
target_sources(app PRIVATE src/events/layer_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/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)
|
||||
if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL)
|
||||
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_ROLE_CENTRAL)
|
||||
target_sources(app PRIVATE src/hid.c)
|
||||
target_sources(app PRIVATE src/behaviors/behavior_key_press.c)
|
||||
target_sources(app PRIVATE src/behaviors/behavior_reset.c)
|
||||
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_KEY_TOGGLE app PRIVATE src/behaviors/behavior_key_toggle.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/endpoints.c)
|
||||
target_sources(app PRIVATE src/events/endpoint_selection_changed.c)
|
||||
target_sources(app PRIVATE src/hid_listener.c)
|
||||
target_sources(app PRIVATE src/keymap.c)
|
||||
target_sources(app PRIVATE src/events/layer_state_changed.c)
|
||||
target_sources(app PRIVATE src/events/modifiers_state_changed.c)
|
||||
target_sources(app PRIVATE src/events/keycode_state_changed.c)
|
||||
|
||||
if (CONFIG_ZMK_BLE)
|
||||
target_sources(app PRIVATE src/events/ble_active_profile_changed.c)
|
||||
target_sources(app PRIVATE src/behaviors/behavior_bt.c)
|
||||
target_sources(app PRIVATE src/ble.c)
|
||||
target_sources(app PRIVATE src/hog.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
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_BACKLIGHT app PRIVATE src/behaviors/behavior_backlight.c)
|
||||
|
||||
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/events/battery_state_changed.c)
|
||||
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/battery.c)
|
||||
if (CONFIG_ZMK_SPLIT_BLE AND (NOT CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL))
|
||||
target_sources(app PRIVATE src/split_listener.c)
|
||||
target_sources(app PRIVATE src/split/bluetooth/service.c)
|
||||
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_ZMK_BLE app PRIVATE src/hog.c)
|
||||
|
||||
target_sources_ifdef(CONFIG_ZMK_SPLIT app PRIVATE src/events/split_peripheral_status_changed.c)
|
||||
add_subdirectory(src/split)
|
||||
|
||||
target_sources_ifdef(CONFIG_USB_DEVICE_STACK app PRIVATE src/usb.c)
|
||||
target_sources_ifdef(CONFIG_ZMK_USB app PRIVATE src/usb_hid.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/hid_listener.c)
|
||||
target_sources_ifdef(CONFIG_ZMK_BACKLIGHT app PRIVATE src/backlight.c)
|
||||
target_sources(app PRIVATE src/main.c)
|
||||
|
||||
add_subdirectory(src/display/)
|
||||
|
|
284
app/Kconfig
284
app/Kconfig
|
@ -25,7 +25,57 @@ config USB_DEVICE_PID
|
|||
config USB_DEVICE_MANUFACTURER
|
||||
default "ZMK Project"
|
||||
|
||||
menu "HID Output Types"
|
||||
menu "HID"
|
||||
|
||||
choice ZMK_HID_REPORT_TYPE
|
||||
prompt "HID Report Type"
|
||||
|
||||
config ZMK_HID_REPORT_TYPE_HKRO
|
||||
bool "#-Key Roll Over (HKRO) HID Report"
|
||||
help
|
||||
Enable # key roll over for HID report. This selection is "boot keyboard" compatible
|
||||
but limits the total number of possible keys to report as held to #.
|
||||
|
||||
config ZMK_HID_REPORT_TYPE_NKRO
|
||||
bool "Full N-Key Roll Over (NKRO) HID Report"
|
||||
help
|
||||
Enable full N-Key Roll Over for HID output. This selection will prevent the keyboard
|
||||
from working with some BIOS/UEFI versions that only support "boot keyboard" support.
|
||||
This option also prevents using some infrequently used higher range HID usages.
|
||||
|
||||
endchoice
|
||||
|
||||
if ZMK_HID_REPORT_TYPE_HKRO
|
||||
|
||||
config ZMK_HID_KEYBOARD_REPORT_SIZE
|
||||
int "# Keyboard Keys Reportable"
|
||||
default 6
|
||||
|
||||
endif
|
||||
|
||||
config ZMK_HID_CONSUMER_REPORT_SIZE
|
||||
int "# Consumer Keys Reportable"
|
||||
default 6
|
||||
|
||||
|
||||
choice ZMK_HID_CONSUMER_REPORT_USAGES
|
||||
prompt "HID Report Type"
|
||||
|
||||
config ZMK_HID_CONSUMER_REPORT_USAGES_FULL
|
||||
bool "Full Consumer HID Usage Support"
|
||||
help
|
||||
Enable full Consumer usage ID values to be sent to hosts. Allows for less
|
||||
frequently used usages, but has compatibability issues with some host OSes.
|
||||
|
||||
config ZMK_HID_CONSUMER_REPORT_USAGES_BASIC
|
||||
bool "Basic Consumer HID Usage Support"
|
||||
help
|
||||
Enable Consumer usage ID values up to "Playback Speed - Slow" to be sent to
|
||||
hosts. Allows for broader compatibability with more host OSes.
|
||||
|
||||
endchoice
|
||||
|
||||
menu "Output Types"
|
||||
|
||||
config ZMK_USB
|
||||
bool "USB"
|
||||
|
@ -38,6 +88,9 @@ if ZMK_USB
|
|||
config USB_NUMOF_EP_WRITE_RETRIES
|
||||
default 10
|
||||
|
||||
config USB_HID_POLL_INTERVAL_MS
|
||||
default 1
|
||||
|
||||
#ZMK_USB
|
||||
endif
|
||||
|
||||
|
@ -82,6 +135,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
|
||||
|
||||
|
@ -89,105 +145,29 @@ config ZMK_BLE_PASSKEY_ENTRY
|
|||
bool "Experimental: Requiring typing passkey from host to pair BLE connection"
|
||||
default n
|
||||
|
||||
#ZMK_BLE
|
||||
endif
|
||||
|
||||
#HID Output Types
|
||||
endmenu
|
||||
|
||||
menu "Split Support"
|
||||
|
||||
config ZMK_SPLIT
|
||||
bool "Split keyboard support"
|
||||
|
||||
if ZMK_SPLIT
|
||||
|
||||
menuconfig ZMK_SPLIT_BLE
|
||||
bool "Split keyboard support via BLE transport"
|
||||
depends on ZMK_BLE
|
||||
default y
|
||||
select BT_USER_PHY_UPDATE
|
||||
|
||||
if ZMK_SPLIT_BLE
|
||||
|
||||
menuconfig ZMK_SPLIT_BLE_ROLE_CENTRAL
|
||||
bool "Central"
|
||||
select BT_CENTRAL
|
||||
select BT_GATT_CLIENT
|
||||
|
||||
if ZMK_SPLIT_BLE_ROLE_CENTRAL
|
||||
|
||||
config ZMK_SPLIT_BLE_CENTRAL_POSITION_QUEUE_SIZE
|
||||
int "Max number of key position state events to queue when received from peripherals"
|
||||
default 5
|
||||
|
||||
endif
|
||||
|
||||
if !ZMK_SPLIT_BLE_ROLE_CENTRAL
|
||||
|
||||
config ZMK_SPLIT_BLE_PERIPHERAL_STACK_SIZE
|
||||
int "BLE split peripheral notify thread stack size"
|
||||
default 512
|
||||
|
||||
config ZMK_SPLIT_BLE_PERIPHERAL_PRIORITY
|
||||
int "BLE split peripheral notify thread priority"
|
||||
default 5
|
||||
|
||||
config ZMK_SPLIT_BLE_PERIPHERAL_POSITION_QUEUE_SIZE
|
||||
int "Max number of key position state events to queue to send to the central"
|
||||
default 10
|
||||
|
||||
config ZMK_USB
|
||||
default n
|
||||
|
||||
config BT_MAX_PAIRED
|
||||
default 1
|
||||
|
||||
config BT_MAX_CONN
|
||||
default 1
|
||||
|
||||
config BT_GAP_AUTO_UPDATE_CONN_PARAMS
|
||||
default n
|
||||
|
||||
#!ZMK_SPLIT_BLE_ROLE_CENTRAL
|
||||
endif
|
||||
|
||||
#ZMK_SPLIT_BLE
|
||||
endif
|
||||
|
||||
#ZMK_SPLIT
|
||||
endif
|
||||
|
||||
if ZMK_BLE
|
||||
|
||||
if ZMK_SPLIT_BLE && ZMK_SPLIT_BLE_ROLE_CENTRAL
|
||||
|
||||
config BT_MAX_CONN
|
||||
config BT_PERIPHERAL_PREF_MIN_INT
|
||||
default 6
|
||||
|
||||
config BT_MAX_PAIRED
|
||||
default 6
|
||||
config BT_PERIPHERAL_PREF_MAX_INT
|
||||
default 12
|
||||
|
||||
#ZMK_SPLIT_BLE && ZMK_SPLIT_BLE_ROLE_CENTRAL
|
||||
endif
|
||||
config BT_PERIPHERAL_PREF_LATENCY
|
||||
default 30
|
||||
|
||||
if !ZMK_SPLIT_BLE
|
||||
|
||||
config BT_MAX_CONN
|
||||
default 5
|
||||
|
||||
config BT_MAX_PAIRED
|
||||
default 5
|
||||
|
||||
#!ZMK_SPLIT_BLE
|
||||
endif
|
||||
config BT_PERIPHERAL_PREF_TIMEOUT
|
||||
default 400
|
||||
|
||||
#ZMK_BLE
|
||||
endif
|
||||
|
||||
#Split Support
|
||||
#Output Types
|
||||
endmenu
|
||||
|
||||
# HID
|
||||
endmenu
|
||||
|
||||
rsource "src/split/Kconfig"
|
||||
|
||||
#Basic Keyboard Setup
|
||||
endmenu
|
||||
|
||||
|
@ -195,7 +175,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
|
||||
|
||||
|
@ -209,36 +189,54 @@ config ZMK_RGB_UNDERGLOW_EXT_POWER
|
|||
bool "RGB underglow toggling also controls external power"
|
||||
default y
|
||||
|
||||
config ZMK_RGB_UNDERGLOW_BRT_MIN
|
||||
int "RGB underglow minimum brightness in percent"
|
||||
range 0 100
|
||||
default 0
|
||||
|
||||
config ZMK_RGB_UNDERGLOW_BRT_MAX
|
||||
int "RGB underglow maximum brightness in percent"
|
||||
range ZMK_RGB_UNDERGLOW_BRT_MIN 100
|
||||
default 100
|
||||
|
||||
config ZMK_RGB_UNDERGLOW_HUE_STEP
|
||||
int "RGB underglow hue step in degrees of 360"
|
||||
int "RGB underglow hue step in degrees"
|
||||
range 0 359
|
||||
default 10
|
||||
|
||||
config ZMK_RGB_UNDERGLOW_SAT_STEP
|
||||
int "RGB underglow sturation step in percent"
|
||||
int "RGB underglow saturation step in percent"
|
||||
range 0 100
|
||||
default 10
|
||||
|
||||
config ZMK_RGB_UNDERGLOW_BRT_STEP
|
||||
int "RGB underglow brightness step in percent"
|
||||
range 0 100
|
||||
default 10
|
||||
|
||||
config ZMK_RGB_UNDERGLOW_HUE_START
|
||||
int "RGB underglow start hue value from 0-359"
|
||||
int "RGB underglow start hue value in degrees"
|
||||
range 0 359
|
||||
default 0
|
||||
|
||||
config ZMK_RGB_UNDERGLOW_SAT_START
|
||||
int "RGB underglow start saturations value from 0-100"
|
||||
int "RGB underglow start saturations value in percent"
|
||||
range 0 100
|
||||
default 100
|
||||
|
||||
config ZMK_RGB_UNDERGLOW_BRT_START
|
||||
int "RGB underglow start brightness value from 0-100"
|
||||
default 100
|
||||
int "RGB underglow start brightness value in percent"
|
||||
range ZMK_RGB_UNDERGLOW_BRT_MIN ZMK_RGB_UNDERGLOW_BRT_MAX
|
||||
default ZMK_RGB_UNDERGLOW_BRT_MAX
|
||||
|
||||
config ZMK_RGB_UNDERGLOW_SPD_START
|
||||
int "RGB underglow start animation speed value from 1-5"
|
||||
int "RGB underglow start animation speed value"
|
||||
range 1 5
|
||||
default 3
|
||||
|
||||
config ZMK_RGB_UNDERGLOW_EFF_START
|
||||
int "RGB underglow start effect int value related to the effect enum list"
|
||||
range 0 3
|
||||
default 0
|
||||
|
||||
config ZMK_RGB_UNDERGLOW_ON_START
|
||||
|
@ -248,6 +246,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
|
||||
|
||||
|
@ -263,14 +290,7 @@ config ZMK_SLEEP
|
|||
|
||||
if ZMK_SLEEP
|
||||
|
||||
config SYS_POWER_DEEP_SLEEP_STATES
|
||||
default y
|
||||
|
||||
choice SYS_PM_POLICY
|
||||
default SYS_PM_POLICY_APP
|
||||
endchoice
|
||||
|
||||
config DEVICE_POWER_MANAGEMENT
|
||||
config PM_DEVICE
|
||||
default y
|
||||
|
||||
config ZMK_IDLE_SLEEP_TIMEOUT
|
||||
|
@ -301,14 +321,28 @@ 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
|
||||
|
||||
DT_COMPAT_ZMK_BEHAVIOR_KEY_TOGGLE := zmk,behavior-key-toggle
|
||||
|
||||
config ZMK_BEHAVIOR_KEY_TOGGLE
|
||||
bool
|
||||
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_BEHAVIOR_KEY_TOGGLE))
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Advanced"
|
||||
|
||||
menu "Initialization Priorities"
|
||||
|
||||
if USB
|
||||
if USB_DEVICE_STACK
|
||||
|
||||
config ZMK_USB_INIT_PRIORITY
|
||||
int "USB Init Priority"
|
||||
|
@ -335,12 +369,6 @@ 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"
|
||||
|
||||
config ZMK_KSCAN_COMPOSITE_DRIVER
|
||||
bool "Enable composite kscan driver to combine kscan devices"
|
||||
|
||||
#KSCAN Settings
|
||||
endmenu
|
||||
|
||||
|
@ -364,17 +392,12 @@ if ZMK_USB_LOGGING
|
|||
config ZMK_LOG_LEVEL
|
||||
default 4
|
||||
|
||||
config USB_CDC_ACM_RINGBUF_SIZE
|
||||
default 1024
|
||||
|
||||
config USB_CDC_ACM_DEVICE_NAME
|
||||
default "CDC_ACM"
|
||||
|
||||
config USB_CDC_ACM_DEVICE_COUNT
|
||||
# We do this to avoid log loop where logging to USB generates more log messages.
|
||||
config USB_CDC_ACM_LOG_LEVEL
|
||||
default 1
|
||||
|
||||
config UART_CONSOLE_ON_DEV_NAME
|
||||
default "CDC_ACM_0"
|
||||
config USB_CDC_ACM_RINGBUF_SIZE
|
||||
default 1024
|
||||
|
||||
config LOG_BUFFER_SIZE
|
||||
default 8192
|
||||
|
@ -382,6 +405,9 @@ config LOG_BUFFER_SIZE
|
|||
config LOG_STRDUP_BUF_COUNT
|
||||
default 16
|
||||
|
||||
config LOG_PROCESS_THREAD_STARTUP_DELAY_MS
|
||||
default 1000
|
||||
|
||||
#ZMK_USB_LOGGING
|
||||
endif
|
||||
|
||||
|
@ -397,6 +423,11 @@ config ZMK_SETTINGS_SAVE_DEBOUNCE
|
|||
#SETTINGS
|
||||
endif
|
||||
|
||||
config ZMK_BATTERY_REPORT_INTERVAL
|
||||
depends on ZMK_BLE
|
||||
int "Battery level report interval in seconds"
|
||||
default 60
|
||||
|
||||
#Advanced
|
||||
endmenu
|
||||
|
||||
|
@ -412,7 +443,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
|
||||
|
@ -422,6 +453,11 @@ config ZMK_WPM
|
|||
config SENSOR
|
||||
default y
|
||||
|
||||
choice CBPRINTF_IMPLEMENTATION
|
||||
default CBPRINTF_NANO
|
||||
|
||||
endchoice
|
||||
|
||||
module = ZMK
|
||||
module-str = zmk
|
||||
source "subsys/logging/Kconfig.template.log_config"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# keeb.io BDN9 board configuration
|
||||
|
||||
# Copyright (c) 2020 Pete Johanson
|
||||
# Copyright (c) 2020 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if BOARD_BDN9
|
||||
|
@ -14,4 +14,8 @@ config ZMK_KEYBOARD_NAME
|
|||
config ZMK_USB
|
||||
default y
|
||||
|
||||
config ZMK_RGB_UNDERGLOW
|
||||
select SPI
|
||||
select WS2812_STRIP
|
||||
|
||||
endif # BOARD_BDN9
|
||||
|
|
5
app/boards/arm/bdn9/bdn9_rev2.conf
Normal file
5
app/boards/arm/bdn9/bdn9_rev2.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Copyright (c) 2022 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Uncomment the line below to enable RGB.
|
||||
# CONFIG_ZMK_RGB_UNDERGLOW=y
|
|
@ -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,11 @@
|
|||
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";
|
||||
|
@ -37,17 +38,6 @@
|
|||
;
|
||||
};
|
||||
|
||||
/*
|
||||
led_strip: ws2812 {
|
||||
compatible = "worldsemi,ws2812-gpio";
|
||||
label = "WS2812";
|
||||
|
||||
in-gpios = <&gpiob 15 0>;
|
||||
|
||||
chain-length = <9>;
|
||||
};
|
||||
*/
|
||||
|
||||
left_encoder: encoder_left {
|
||||
compatible = "alps,ec11";
|
||||
label = "LEFT_ENCODER";
|
||||
|
@ -80,8 +70,54 @@
|
|||
};
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi2_sck_pb13 &spi2_mosi_pb15>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
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 = <9>;
|
||||
spi-one-frame = <0x70>;
|
||||
spi-zero-frame = <0x40>;
|
||||
|
||||
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
|
||||
};
|
||||
};
|
||||
|
||||
&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 +135,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>;
|
||||
};
|
||||
|
|
11
app/boards/arm/bdn9/bdn9_rev2.yml
Normal file
11
app/boards/arm/bdn9/bdn9_rev2.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
file_format: "1"
|
||||
id: bdn9_rev2
|
||||
name: BDN9 Rev2
|
||||
type: board
|
||||
arch: arm
|
||||
features:
|
||||
- keys
|
||||
- encoder
|
||||
outputs:
|
||||
- usb
|
||||
url: https://keeb.io/products/bdn9-rev-2-3x3-9-key-macropad-rotary-encoder-and-rgb
|
11
app/boards/arm/bdn9/bdn9_rev2.zmk.yml
Normal file
11
app/boards/arm/bdn9/bdn9_rev2.zmk.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
file_format: "1"
|
||||
id: bdn9_rev2
|
||||
name: BDN9 Rev2
|
||||
type: board
|
||||
arch: arm
|
||||
outputs:
|
||||
- usb
|
||||
features:
|
||||
- keys
|
||||
- encoder
|
||||
url: https://keeb.io/collections/bdn9-collection/products/bdn9-rev-2-3x3-9-key-macropad-rotary-encoder-and-rgb
|
|
@ -11,19 +11,15 @@ CONFIG_FPU=y
|
|||
# enable GPIO
|
||||
CONFIG_GPIO=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
|
||||
|
||||
# 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
|
||||
|
|
|
@ -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
|
||||
)
|
|
@ -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
|
||||
|
@ -27,7 +24,4 @@ config ZMK_BLE
|
|||
config ZMK_USB
|
||||
default y
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_BLUEMICRO840_V1
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
/ {
|
||||
pro_micro_d: connector_d {
|
||||
pro_micro: connector {
|
||||
compatible = "arduino-pro-micro";
|
||||
#gpio-cells = <2>;
|
||||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
|
@ -25,6 +25,10 @@
|
|||
, <16 0 &gpio0 28 0> /* D16 B2*/
|
||||
, <14 0 &gpio0 3 0> /* D14 B3*/
|
||||
, <15 0 &gpio1 13 0> /* D15 B1*/
|
||||
, <18 0 &gpio0 2 0> /* D18/A0 F7*/
|
||||
, <19 0 &gpio0 29 0> /* D19/A1 F6*/
|
||||
, <20 0 &gpio0 26 0> /* D20/A2 F5*/
|
||||
, <21 0 &gpio0 30 0> /* D21/A3 F4*/
|
||||
;
|
||||
};
|
||||
|
||||
|
@ -34,10 +38,10 @@
|
|||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
gpio-map-pass-thru = <0 0x3f>;
|
||||
gpio-map
|
||||
= <0 0 &gpio0 2 0> /* A0 F7*/
|
||||
, <1 0 &gpio0 29 0> /* A1 F6*/
|
||||
, <2 0 &gpio0 26 0> /* A2 F5*/
|
||||
, <3 0 &gpio0 30 0> /* A3 F4*/
|
||||
= <0 0 &gpio0 2 0> /* D18/A0 F7*/
|
||||
, <1 0 &gpio0 29 0> /* D19/A1 F6*/
|
||||
, <2 0 &gpio0 26 0> /* D20/A2 F5*/
|
||||
, <3 0 &gpio0 30 0> /* D21/A3 F4*/
|
||||
, <6 0 &gpio0 20 0> /* D4/A6 D4*/
|
||||
, <7 0 &gpio0 24 0> /* D6/A7 D7*/
|
||||
, <8 0 &gpio0 10 0> /* D8/A8 B4*/
|
||||
|
@ -47,6 +51,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
pro_micro_d: &pro_micro {};
|
||||
pro_micro_i2c: &i2c0 {};
|
||||
pro_micro_spi: &spi0 {};
|
||||
pro_micro_serial: &uart0 {};
|
||||
|
|
|
@ -16,12 +16,14 @@
|
|||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
zmk,battery = &vbatt;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
blue_led: led_0 {
|
||||
gpios = <&gpio0 42 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
|
||||
label = "Blue LED";
|
||||
};
|
||||
};
|
||||
|
@ -29,10 +31,11 @@
|
|||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
init-delay-ms = <20>;
|
||||
control-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
vbatt {
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc 7>;
|
||||
|
@ -72,6 +75,10 @@
|
|||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
10
app/boards/arm/bluemicro840/bluemicro840_v1.zmk.yml
Normal file
10
app/boards/arm/bluemicro840/bluemicro840_v1.zmk.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
file_format: "1"
|
||||
id: bluemicro840_v1
|
||||
name: BlueMicro840 v1
|
||||
type: board
|
||||
arch: arm
|
||||
outputs:
|
||||
- usb
|
||||
- ble
|
||||
url: https://nrf52.jpconstantineau.com/docs/bluemicro840_v1/
|
||||
exposes: [pro_micro]
|
|
@ -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
|
||||
|
|
7
app/boards/arm/bt60/Kconfig
Normal file
7
app/boards/arm/bt60/Kconfig
Normal file
|
@ -0,0 +1,7 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config BOARD_ENABLE_DCDC
|
||||
bool "Enable DCDC mode"
|
||||
select SOC_DCDC_NRF52X
|
||||
default y
|
||||
depends on (BOARD_BT60_V1_HS || BOARD_BT60_V1)
|
12
app/boards/arm/bt60/Kconfig.board
Normal file
12
app/boards/arm/bt60/Kconfig.board
Normal file
|
@ -0,0 +1,12 @@
|
|||
# BT60 board configuration
|
||||
|
||||
# Copyright (c) 2021 Polarity Works
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config BOARD_BT60_V1
|
||||
bool "bt60"
|
||||
depends on SOC_NRF52840_QIAA
|
||||
|
||||
config BOARD_BT60_V1_HS
|
||||
bool "bt60 hotswap"
|
||||
depends on SOC_NRF52840_QIAA
|
31
app/boards/arm/bt60/Kconfig.defconfig
Normal file
31
app/boards/arm/bt60/Kconfig.defconfig
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Copyright (c) 2021 Polarity Works
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if BOARD_BT60_V1_HS || BOARD_BT60_V1
|
||||
|
||||
config BOARD
|
||||
default "bt60"
|
||||
|
||||
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
|
||||
|
||||
config ZMK_KEYBOARD_NAME
|
||||
default "BT60"
|
||||
|
||||
endif # BOARD_BT60
|
5
app/boards/arm/bt60/board.cmake
Normal file
5
app/boards/arm/bt60/board.cmake
Normal file
|
@ -0,0 +1,5 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
|
||||
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
|
134
app/boards/arm/bt60/bt60.dtsi
Normal file
134
app/boards/arm/bt60/bt60.dtsi
Normal file
|
@ -0,0 +1,134 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Polarity Works
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
#include <dt-bindings/zmk/matrix_transform.h>
|
||||
|
||||
/ {
|
||||
model = "BT60";
|
||||
compatible = "polarityworks,bt60";
|
||||
|
||||
chosen {
|
||||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
zmk,battery = &vbatt;
|
||||
zmk,kscan = &kscan0;
|
||||
zmk,matrix_transform = &default_transform;
|
||||
};
|
||||
|
||||
sensors {
|
||||
compatible = "zmk,keymap-sensors";
|
||||
sensors = <&left_encoder>;
|
||||
};
|
||||
|
||||
|
||||
|
||||
left_encoder: encoder_left {
|
||||
compatible = "alps,ec11";
|
||||
label = "LEFT_ENCODER";
|
||||
a-gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||
b-gpios = <&gpio1 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||
resolution = <4>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
blue_led: led_0 {
|
||||
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
|
||||
label = "Blue LED";
|
||||
};
|
||||
};
|
||||
|
||||
vbatt: 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 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
compatible = "nordic,nrf-twi";
|
||||
sda-pin = <17>;
|
||||
scl-pin = <20>;
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
compatible = "nordic,nrf-uarte";
|
||||
tx-pin = <6>;
|
||||
rx-pin = <8>;
|
||||
};
|
||||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
&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>;
|
||||
};
|
||||
};
|
||||
};
|
113
app/boards/arm/bt60/bt60_v1.dts
Normal file
113
app/boards/arm/bt60/bt60_v1.dts
Normal file
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Polarity Works
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include "bt60.dtsi"
|
||||
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
zmk,matrix_transform = &ansi_transform;
|
||||
};
|
||||
|
||||
ansi_transform: keymap_transform_0 {
|
||||
compatible = "zmk,matrix-transform";
|
||||
columns = <15>;
|
||||
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,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)
|
||||
>;
|
||||
};
|
||||
|
||||
hhkb_transform: keymap_transform_1 {
|
||||
compatible = "zmk,matrix-transform";
|
||||
columns = <15>;
|
||||
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(0,14)
|
||||
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,12) RC(3,14)
|
||||
RC(4,0) RC(4,1) RC(4,2) RC(4,6) RC(4,10) RC(4,11) RC(4,12) RC(4,13)
|
||||
>;
|
||||
};
|
||||
|
||||
iso_transform: keymap_transform_2 {
|
||||
compatible = "zmk,matrix-transform";
|
||||
columns = <15>;
|
||||
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(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,12) 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,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)
|
||||
>;
|
||||
};
|
||||
|
||||
all_1u_transform: keymap_transform_3 {
|
||||
compatible = "zmk,matrix-transform";
|
||||
columns = <15>;
|
||||
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,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(3,13) RC(3,14)
|
||||
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)
|
||||
>;
|
||||
};
|
||||
|
||||
split_transform: keymap_transform_4 {
|
||||
compatible = "zmk,matrix-transform";
|
||||
columns = <15>;
|
||||
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(0,14)
|
||||
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,12) RC(3,14)
|
||||
RC(4,0) RC(4,1) RC(4,2) RC(4,6) RC(4,10) RC(4,11) RC(4,12) RC(4,13)
|
||||
>;
|
||||
};
|
||||
|
||||
kscan0: kscan_0 {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
label = "KSCAN";
|
||||
diode-direction = "col2row";
|
||||
|
||||
col-gpios
|
||||
= <&gpio1 13 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 10 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 11 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 15 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 3 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 2 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 28 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 29 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 30 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 31 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 5 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 7 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 9 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 12 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 23 GPIO_ACTIVE_HIGH>
|
||||
;
|
||||
|
||||
row-gpios
|
||||
= <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio0 22 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio0 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio1 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
;
|
||||
};
|
||||
};
|
180
app/boards/arm/bt60/bt60_v1.keymap
Normal file
180
app/boards/arm/bt60/bt60_v1.keymap
Normal file
|
@ -0,0 +1,180 @@
|
|||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/bt.h>
|
||||
|
||||
#define ANSI true
|
||||
//#define HHKB true
|
||||
//#define ISO true
|
||||
//#define ALL_1U true
|
||||
//#define SPLIT_BKSP_RSHFT true
|
||||
|
||||
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
#ifdef ANSI
|
||||
zmk,matrix_transform = &ansi_transform;
|
||||
#elif defined(HHKB)
|
||||
zmk,matrix_transform = &hhkb_transform;
|
||||
#elif defined(ISO)
|
||||
zmk,matrix_transform = &iso_transform;
|
||||
#elif defined(ALL_1U)
|
||||
zmk,matrix_transform = &all_1u_transform;
|
||||
#else
|
||||
zmk,matrix_transform = &split_transform;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
#ifdef ANSI
|
||||
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 | 1 | MENU | CTRL |
|
||||
// ------------------------------------------------------------------------------------------
|
||||
bindings = <
|
||||
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC
|
||||
&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 SEMI &kp SQT &kp RET
|
||||
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
|
||||
&kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &mo 1 &kp K_CMENU &kp RCTRL &bt BT_CLR
|
||||
>;
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
};
|
||||
raise {
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// |GRAVE| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
|
||||
// | TAB | Q | UP | E | R | T | Y | U | INS | O |PSCRN|SLCK |PSEBRK| RESET |
|
||||
// | CAPS |LEFT |DOWN |RIGHT| F | G | H | J | K | L |HOME |PGUP | BOOTLOADER |
|
||||
// | PREV |VOLUP |VOLDN|MUTE | V | B | N | M | , | END | PGDN | NEXT |
|
||||
// | CTL | WIN | ALT | SPACE | ALT | 1 | MENU | BT_CLR |
|
||||
// ------------------------------------------------------------------------------------------
|
||||
bindings = <
|
||||
&kp GRAVE &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 DEL
|
||||
&trans &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &reset
|
||||
&trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &bootloader
|
||||
&kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &kp END &kp PG_DN &kp C_NEXT
|
||||
&bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &bt BT_CLR &trans
|
||||
>;
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
};
|
||||
#elif defined(HHKB)
|
||||
default_layer {
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|
||||
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | BSPC |
|
||||
// | CTRL | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
|
||||
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | 1 |
|
||||
// | CAPS | ALT | WIN | SPACE | WIN | ALT | CTRL |
|
||||
// ------------------------------------------------------------------------------------------
|
||||
bindings = <
|
||||
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSLH &kp GRAVE
|
||||
&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 BSPC
|
||||
&kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET
|
||||
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &mo 1
|
||||
&kp LCTRL &kp LALT &kp LGUI &kp SPACE &kp RGUI &kp RALT &kp RCTRL
|
||||
>;
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
};
|
||||
raise {
|
||||
bindings = <
|
||||
&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 INS &kp DEL
|
||||
&kp CLCK &bt BT_PRV &bt BT_NXT &bt BT_CLR &trans &trans &trans &trans &trans &trans &trans &kp UP &trans &reset
|
||||
&trans &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &trans &kp LEFT &kp RIGHT &trans
|
||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp DOWN &trans &trans
|
||||
&trans &trans &trans &bootloader &trans &trans &trans
|
||||
>;
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
};
|
||||
#elif defined(ISO)
|
||||
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 | 1 | MENU | CTRL |
|
||||
// ------------------------------------------------------------------------------------------
|
||||
bindings = <
|
||||
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC
|
||||
&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 CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp NON_US_HASH &kp RET
|
||||
&kp LSHFT &kp NON_US_BSLH &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
|
||||
&kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &mo 1 &kp K_CMENU &kp RCTRL
|
||||
>;
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
};
|
||||
raise {
|
||||
bindings = <
|
||||
&kp GRAVE &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 DEL
|
||||
&reset &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK
|
||||
&trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &trans &bootloader
|
||||
&kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &trans &kp END &kp PG_DN &kp C_NEXT
|
||||
&bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &bt BT_CLR
|
||||
>;
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
};
|
||||
#elif defined(ALL_1U)
|
||||
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 | , | . | / | SHFT | UP | 1 |
|
||||
// | CTL | WIN | ALT | SPACE | ALT | CTRL | LEFT | DOWN | RIGHT |
|
||||
// ------------------------------------------------------------------------------------------
|
||||
bindings = <
|
||||
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC
|
||||
&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 SEMI &kp SQT &kp RET
|
||||
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp UP &mo 1
|
||||
&kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &kp RCTRL &kp LEFT &kp DOWN &kp RIGHT
|
||||
>;
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
};
|
||||
raise {
|
||||
bindings = <
|
||||
&kp GRAVE &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
|
||||
&trans &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &reset
|
||||
&trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &bootloader
|
||||
&kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &trans &trans &kp END &kp PG_DN &kp C_NEXT
|
||||
&bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &trans &bt BT_CLR
|
||||
>;
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
};
|
||||
#else
|
||||
default_layer {
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |BKSP| DEL |
|
||||
// | 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 | 1 |
|
||||
// | CTL | WIN | ALT | SPACE | ALT | 1 | CTRL |
|
||||
// ------------------------------------------------------------------------------------------
|
||||
bindings = <
|
||||
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp DEL
|
||||
&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 SEMI &kp SQT &kp RET
|
||||
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &mo 1
|
||||
&kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &kp RGUI &kp C_MENU &kp RCTRL
|
||||
>;
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
};
|
||||
raise {
|
||||
bindings = <
|
||||
&kp GRAVE &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 DEL &trans
|
||||
&trans &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &reset
|
||||
&trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &bootloader
|
||||
&kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &kp END &kp PG_DN &kp C_NEXT &trans
|
||||
&bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &bt BT_CLR
|
||||
>;
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
};
|
15
app/boards/arm/bt60/bt60_v1.yaml
Normal file
15
app/boards/arm/bt60/bt60_v1.yaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
identifier: bt60_v1
|
||||
name: BT60 V1 Soldered
|
||||
type: mcu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- adc
|
||||
- usb_device
|
||||
- ble
|
||||
- ieee802154
|
||||
- pwm
|
||||
- watchdog
|
12
app/boards/arm/bt60/bt60_v1.zmk.yml
Normal file
12
app/boards/arm/bt60/bt60_v1.zmk.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
file_format: "1"
|
||||
id: bt60_v1
|
||||
name: BT60 V1 Soldered
|
||||
type: board
|
||||
arch: arm
|
||||
features:
|
||||
- keys
|
||||
- encoder
|
||||
outputs:
|
||||
- usb
|
||||
- ble
|
||||
url: https://polarityworks.com
|
25
app/boards/arm/bt60/bt60_v1_defconfig
Normal file
25
app/boards/arm/bt60/bt60_v1_defconfig
Normal file
|
@ -0,0 +1,25 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
CONFIG_SOC_SERIES_NRF52X=y
|
||||
CONFIG_SOC_NRF52840_QIAA=y
|
||||
CONFIG_BOARD_BT60_V1=y
|
||||
|
||||
# Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
# encoder
|
||||
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
|
||||
CONFIG_SETTINGS_NVS=y
|
||||
CONFIG_FLASH=y
|
||||
CONFIG_FLASH_PAGE_LAYOUT=y
|
||||
CONFIG_FLASH_MAP=y
|
61
app/boards/arm/bt60/bt60_v1_hs.dts
Normal file
61
app/boards/arm/bt60/bt60_v1_hs.dts
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Polarity Works
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include "bt60.dtsi"
|
||||
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
zmk,matrix_transform = &default_transform;
|
||||
};
|
||||
|
||||
default_transform: keymap_transform_0 {
|
||||
compatible = "zmk,matrix-transform";
|
||||
columns = <15>;
|
||||
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(2,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,12)
|
||||
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(4,0) RC(4,1) RC(4,2) RC(4,5) RC(4,8) RC(4,9) RC(4,10) RC(4,11)
|
||||
>;
|
||||
};
|
||||
|
||||
|
||||
kscan0: kscan_0 {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
label = "KSCAN";
|
||||
diode-direction = "col2row";
|
||||
|
||||
col-gpios
|
||||
= <&gpio1 11 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 10 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 13 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 15 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 3 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 2 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 28 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 29 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 30 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 31 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 5 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 7 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 9 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 12 GPIO_ACTIVE_HIGH>
|
||||
;
|
||||
|
||||
row-gpios
|
||||
= <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio0 22 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio0 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio0 23 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
;
|
||||
};
|
||||
};
|
37
app/boards/arm/bt60/bt60_v1_hs.keymap
Normal file
37
app/boards/arm/bt60/bt60_v1_hs.keymap
Normal file
|
@ -0,0 +1,37 @@
|
|||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/bt.h>
|
||||
|
||||
/ {
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
|
||||
default_layer {
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | DEL
|
||||
// | 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 | 1 | MENU | CTRL |
|
||||
// ------------------------------------------------------------------------------------------
|
||||
bindings = <
|
||||
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &bt BT_CLR
|
||||
&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 SEMI &kp SQT &kp RET
|
||||
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
|
||||
&kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &mo 1 &kp K_CMENU &kp RCTRL
|
||||
>;
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
};
|
||||
raise {
|
||||
bindings = <
|
||||
&kp GRAVE &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 DEL &trans
|
||||
&trans &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &reset
|
||||
&trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &bootloader
|
||||
&kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &kp END &kp PG_DN &kp C_NEXT
|
||||
&bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &bt BT_CLR
|
||||
>;
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
};
|
||||
};
|
||||
};
|
15
app/boards/arm/bt60/bt60_v1_hs.yaml
Normal file
15
app/boards/arm/bt60/bt60_v1_hs.yaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
identifier: bt60_v1_hs
|
||||
name: BT60 V1 Hotswap
|
||||
type: mcu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- adc
|
||||
- usb_device
|
||||
- ble
|
||||
- ieee802154
|
||||
- pwm
|
||||
- watchdog
|
12
app/boards/arm/bt60/bt60_v1_hs.zmk.yml
Normal file
12
app/boards/arm/bt60/bt60_v1_hs.zmk.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
file_format: "1"
|
||||
id: bt60_v1_hs
|
||||
name: BT60 V1 Hotswap
|
||||
type: board
|
||||
arch: arm
|
||||
features:
|
||||
- keys
|
||||
- encoder
|
||||
outputs:
|
||||
- usb
|
||||
- ble
|
||||
url: https://polarityworks.com
|
25
app/boards/arm/bt60/bt60_v1_hs_defconfig
Normal file
25
app/boards/arm/bt60/bt60_v1_hs_defconfig
Normal file
|
@ -0,0 +1,25 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
CONFIG_SOC_SERIES_NRF52X=y
|
||||
CONFIG_SOC_NRF52840_QIAA=y
|
||||
CONFIG_BOARD_BT60_V1_HS=y
|
||||
|
||||
# Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
# encoder
|
||||
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
|
||||
CONFIG_SETTINGS_NVS=y
|
||||
CONFIG_FLASH=y
|
||||
CONFIG_FLASH_PAGE_LAYOUT=y
|
||||
CONFIG_FLASH_MAP=y
|
|
@ -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()
|
|
@ -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)
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
8
app/boards/arm/ferris/Kconfig.board
Normal file
8
app/boards/arm/ferris/Kconfig.board
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Ferris board configuration
|
||||
|
||||
# Copyright (c) 2020 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config BOARD_FERRIS
|
||||
bool "Ferris rev 0.2"
|
||||
depends on SOC_STM32F072XB
|
20
app/boards/arm/ferris/Kconfig.defconfig
Normal file
20
app/boards/arm/ferris/Kconfig.defconfig
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Ferris board configuration
|
||||
|
||||
# Copyright (c) 2020 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if BOARD_FERRIS
|
||||
|
||||
config BOARD
|
||||
default "ferris_rev02"
|
||||
|
||||
config ZMK_KEYBOARD_NAME
|
||||
default "Ferris rev 0.2"
|
||||
|
||||
config ZMK_USB
|
||||
default y
|
||||
|
||||
config ZMK_KSCAN_MATRIX_POLLING
|
||||
default y
|
||||
|
||||
endif # BOARD_FERRIS
|
16
app/boards/arm/ferris/README.md
Normal file
16
app/boards/arm/ferris/README.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Building ZMK for the Ferris 0.2
|
||||
|
||||
|
||||
## Standard Build
|
||||
|
||||
```
|
||||
west build -p -d build/ferris --board ferris_rev02
|
||||
```
|
||||
|
||||
## Flashing
|
||||
|
||||
`west` can be used to flash the board directly. Press the reset button once, and run:
|
||||
|
||||
```
|
||||
west flash -d build/ferris
|
||||
```
|
7
app/boards/arm/ferris/board.cmake
Normal file
7
app/boards/arm/ferris/board.cmake
Normal 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=STM32F072CB" "--speed=4000")
|
||||
|
||||
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
|
164
app/boards/arm/ferris/ferris_rev02.dts
Normal file
164
app/boards/arm/ferris/ferris_rev02.dts
Normal file
|
@ -0,0 +1,164 @@
|
|||
/*
|
||||
* Copyright (c) 2020 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <st/f0/stm32f072Xb.dtsi>
|
||||
#include <st/f0/stm32f072v(8-b)tx-pinctrl.dtsi>
|
||||
|
||||
#include <dt-bindings/zmk/matrix_transform.h>
|
||||
|
||||
/ {
|
||||
model = "Ferris rev0.2";
|
||||
compatible = "ferris,rev02", "st,stm32f072";
|
||||
|
||||
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
|
||||
zmk,underglow = &led_strip;
|
||||
*/
|
||||
};
|
||||
|
||||
transform: transform {
|
||||
compatible = "zmk,matrix-transform";
|
||||
rows = <4>;
|
||||
columns = <10>;
|
||||
|
||||
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,3) RC(3,4) RC(3,5) RC(3,6)
|
||||
>;
|
||||
};
|
||||
|
||||
kscan: kscan {
|
||||
compatible = "zmk,kscan-composite";
|
||||
label = "KSCAN";
|
||||
rows = <4>;
|
||||
columns = <10>;
|
||||
|
||||
left {
|
||||
kscan = <&kscan_left>;
|
||||
};
|
||||
|
||||
right {
|
||||
kscan = <&kscan_right>;
|
||||
column-offset = <5>;
|
||||
};
|
||||
};
|
||||
|
||||
kscan_left: kscan_left {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
label = "KSCAN_LEFT";
|
||||
|
||||
diode-direction = "col2row";
|
||||
|
||||
col-gpios
|
||||
= <&gpiob 8 (GPIO_ACTIVE_HIGH)>
|
||||
, <&gpiob 4 (GPIO_ACTIVE_HIGH)>
|
||||
, <&gpiob 3 (GPIO_ACTIVE_HIGH)>
|
||||
, <&gpioa 15 (GPIO_ACTIVE_HIGH)>
|
||||
, <&gpioa 14 (GPIO_ACTIVE_HIGH)>
|
||||
;
|
||||
row-gpios
|
||||
= <&gpiob 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpiob 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpiob 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpioa 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
;
|
||||
};
|
||||
|
||||
kscan_right: kscan_right {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
label = "KSCAN_RIGHT";
|
||||
|
||||
diode-direction = "row2col";
|
||||
|
||||
col-gpios
|
||||
= <&right_io 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&right_io 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&right_io 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&right_io 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&right_io 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
;
|
||||
row-gpios
|
||||
= <&right_io 8 (GPIO_ACTIVE_LOW)>
|
||||
, <&right_io 9 (GPIO_ACTIVE_LOW)>
|
||||
, <&right_io 10 (GPIO_ACTIVE_LOW)>
|
||||
, <&right_io 11 (GPIO_ACTIVE_LOW)>
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c2 {
|
||||
pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
clock-frequency = <I2C_BITRATE_FAST>;
|
||||
|
||||
right_io: mcp23017@20 {
|
||||
compatible = "microchip,mcp23017";
|
||||
status = "okay";
|
||||
gpio-controller;
|
||||
reg = <0x20>;
|
||||
label = "RIGHT_IO";
|
||||
#gpio-cells = <2>;
|
||||
ngpios = <16>;
|
||||
};
|
||||
};
|
||||
|
||||
&usb {
|
||||
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 {
|
||||
/*
|
||||
* 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 128Kb of flash */
|
||||
storage_partition: partition@3e800 {
|
||||
label = "storage";
|
||||
reg = <0x0001e800 0x00001800>;
|
||||
};
|
||||
};
|
||||
};
|
79
app/boards/arm/ferris/ferris_rev02.keymap
Normal file
79
app/boards/arm/ferris/ferris_rev02.keymap
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* 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>
|
||||
|
||||
#define NAV_L 1
|
||||
#define OTHER_L 2
|
||||
#define NUM_L 3
|
||||
#define SYM_L 4
|
||||
|
||||
// Using layer taps on thumbs, having quick tap as well helps w/ repeating space/backspace
|
||||
< { quick_tap_ms = <200>; };
|
||||
|
||||
/ {
|
||||
behaviors {
|
||||
hm: homerow_mods {
|
||||
compatible = "zmk,behavior-hold-tap";
|
||||
label = "homerow mods";
|
||||
#binding-cells = <2>;
|
||||
tapping_term_ms = <200>;
|
||||
flavor = "tap-preferred";
|
||||
bindings = <&kp>, <&kp>;
|
||||
};
|
||||
};
|
||||
|
||||
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
|
||||
&hm LGUI A &hm LALT S &hm LCTRL D &hm LSHFT F &kp G &kp H &hm RSHFT J &hm RCTRL K &hm LALT L &hm LGUI QUOT
|
||||
&kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH
|
||||
< NAV_L TAB &kp ENTER < NUM_L SPACE < SYM_L BKSP
|
||||
>;
|
||||
};
|
||||
|
||||
nav_layer {
|
||||
bindings = <
|
||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
||||
&trans &trans &trans &trans &trans &trans &kp LARW &kp DARW &kp UARW &kp RARW
|
||||
&trans &trans &trans &trans &trans &trans &kp HOME &kp PG_DN &kp PG_UP &kp END
|
||||
&trans &trans &kp ESC &kp DEL
|
||||
>;
|
||||
};
|
||||
|
||||
other_layer {
|
||||
bindings = <
|
||||
&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 &kp HOME &trans &trans &trans
|
||||
&trans &trans &trans &trans
|
||||
>;
|
||||
};
|
||||
|
||||
num_layer {
|
||||
bindings = <
|
||||
&kp LBKT &kp N7 &kp N8 &kp N9 &kp RBKT &trans &trans &trans &trans &trans
|
||||
&kp SEMI &kp N4 &kp N5 &kp N6 &kp EQUAL &trans &trans &trans &trans &trans
|
||||
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp BSLH &trans &trans &trans &trans &trans
|
||||
&kp N0 &kp MINUS &trans &trans
|
||||
>;
|
||||
};
|
||||
|
||||
sym_layer {
|
||||
bindings = <
|
||||
&kp LBRC &kp LS(N7) &kp LS(N8) &kp LS(N9) &kp RBRC &trans &trans &trans &trans &trans
|
||||
&kp COLON &kp LS(N4) &kp LS(N5) &kp LS(N6) &kp PLUS &trans &trans &trans &trans &trans
|
||||
&kp TILDE &kp LS(N1) &kp LS(N2) &kp LS(N3) &kp LS(BSLH) &trans &trans &trans &trans &trans
|
||||
&kp LS(N0) &kp UNDER &trans &trans
|
||||
>;
|
||||
};
|
||||
};
|
||||
};
|
12
app/boards/arm/ferris/ferris_rev02.yaml
Normal file
12
app/boards/arm/ferris/ferris_rev02.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
identifier: ferris_rev02
|
||||
name: Ferris 0.2
|
||||
type: mcu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
ram: 40
|
||||
supported:
|
||||
- switches
|
||||
- underglow
|
10
app/boards/arm/ferris/ferris_rev02.zmk.yml
Normal file
10
app/boards/arm/ferris/ferris_rev02.zmk.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
file_format: "1"
|
||||
id: ferris_rev02
|
||||
name: Ferris 0.2
|
||||
type: board
|
||||
arch: arm
|
||||
features:
|
||||
- keys
|
||||
outputs:
|
||||
- usb
|
||||
url: https://github.com/pierrechevalier83/ferris/tree/main/0.2
|
31
app/boards/arm/ferris/ferris_rev02_defconfig
Normal file
31
app/boards/arm/ferris/ferris_rev02_defconfig
Normal file
|
@ -0,0 +1,31 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
CONFIG_BOARD_FERRIS=y
|
||||
CONFIG_SOC_SERIES_STM32F0X=y
|
||||
CONFIG_SOC_STM32F072XB=y
|
||||
# 48MHz system clock
|
||||
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000
|
||||
|
||||
# enable PINMUX
|
||||
CONFIG_PINCTRL=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
# Enable i2c
|
||||
CONFIG_I2C=y
|
||||
|
||||
# ZMK Settings
|
||||
CONFIG_ZMK_USB=y
|
||||
CONFIG_ZMK_KSCAN_MATRIX_POLLING=y
|
||||
CONFIG_USB_SELF_POWERED=n
|
||||
|
||||
# Enable IO multiplexer
|
||||
CONFIG_GPIO_MCP23017=y
|
||||
|
||||
# Needed to reduce this to size that will fit on F072
|
||||
CONFIG_HEAP_MEM_POOL_SIZE=1024
|
||||
|
||||
# clock configuration
|
||||
CONFIG_CLOCK_CONTROL=y
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if(CONFIG_PINMUX)
|
||||
zephyr_library()
|
||||
zephyr_library_sources(pinmux.c)
|
||||
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
|
||||
endif()
|
||||
endif()
|
29
app/boards/arm/mikoto/Kconfig
Normal file
29
app/boards/arm/mikoto/Kconfig
Normal file
|
@ -0,0 +1,29 @@
|
|||
config BOARD_ENABLE_DCDC
|
||||
bool "Enable DCDC mode"
|
||||
select SOC_DCDC_NRF52X
|
||||
default y
|
||||
depends on (BOARD_MIKOTO_520)
|
||||
|
||||
choice BOARD_MIKOTO_CHARGER_CURRENT
|
||||
prompt "Charge current to supply to attached batteries"
|
||||
depends on (BOARD_MIKOTO_520)
|
||||
|
||||
config BOARD_MIKOTO_CHARGER_CURRENT_40MA
|
||||
bool "40mA charge current, for battery capacity 40mAh or higher"
|
||||
|
||||
config BOARD_MIKOTO_CHARGER_CURRENT_100MA
|
||||
bool "100mA charge current, for battery capacity 100mAh or higher"
|
||||
|
||||
config BOARD_MIKOTO_CHARGER_CURRENT_150MA
|
||||
bool "150mA charge current, for battery capacity 150mAh or higher"
|
||||
|
||||
config BOARD_MIKOTO_CHARGER_CURRENT_250MA
|
||||
bool "250mA charge current, for battery capacity 250mAh or higher"
|
||||
|
||||
config BOARD_MIKOTO_CHARGER_CURRENT_350MA
|
||||
bool "350mA charge current, for battery capacity 350mAh or higher"
|
||||
|
||||
config BOARD_MIKOTO_CHARGER_CURRENT_NONE
|
||||
bool "Disable charge current"
|
||||
|
||||
endchoice
|
8
app/boards/arm/mikoto/Kconfig.board
Normal file
8
app/boards/arm/mikoto/Kconfig.board
Normal file
|
@ -0,0 +1,8 @@
|
|||
# mikoto board configuration
|
||||
|
||||
# Copyright (c) 2020 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config BOARD_MIKOTO_520
|
||||
bool "mikoto_520"
|
||||
depends on SOC_NRF52840_QIAA
|
37
app/boards/arm/mikoto/Kconfig.defconfig
Normal file
37
app/boards/arm/mikoto/Kconfig.defconfig
Normal file
|
@ -0,0 +1,37 @@
|
|||
# Electronut Labs Papyr board configuration
|
||||
|
||||
# Copyright (c) 2020 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if BOARD_MIKOTO_520
|
||||
|
||||
config BOARD
|
||||
default "mikoto"
|
||||
|
||||
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
|
||||
|
||||
config PINMUX
|
||||
default y
|
||||
|
||||
choice BOARD_MIKOTO_CHARGER_CURRENT
|
||||
default BOARD_MIKOTO_CHARGER_CURRENT_100MA
|
||||
endchoice
|
||||
|
||||
endif # BOARD_MIKOTO_520
|
59
app/boards/arm/mikoto/arduino_pro_micro_pins.dtsi
Normal file
59
app/boards/arm/mikoto/arduino_pro_micro_pins.dtsi
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Copyright (c) 2020 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
|
||||
/ {
|
||||
pro_micro: connector {
|
||||
compatible = "arduino-pro-micro";
|
||||
#gpio-cells = <2>;
|
||||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
gpio-map-pass-thru = <0 0x3f>;
|
||||
gpio-map
|
||||
= <0 0 &gpio0 4 0> /* D0 */
|
||||
, <1 0 &gpio0 8 0> /* D1 */
|
||||
, <2 0 &gpio0 17 0> /* D2 */
|
||||
, <3 0 &gpio0 20 0> /* D3 */
|
||||
, <4 0 &gpio0 22 0> /* D4/A6 */
|
||||
, <5 0 &gpio0 24 0> /* D5 */
|
||||
, <6 0 &gpio1 0 0> /* D6/A7 */
|
||||
, <7 0 &gpio1 2 0> /* D7 */
|
||||
, <8 0 &gpio1 4 0> /* D8/A8 */
|
||||
, <9 0 &gpio1 6 0> /* D9/A9 */
|
||||
, <10 0 &gpio0 9 0> /* D10/A10 */
|
||||
, <16 0 &gpio0 10 0> /* D16 */
|
||||
, <14 0 &gpio1 13 0> /* D14 */
|
||||
, <15 0 &gpio0 2 0> /* D15 */
|
||||
, <18 0 &gpio0 29 0> /* D18/A0 */
|
||||
, <19 0 &gpio0 31 0> /* D19/A1 */
|
||||
, <20 0 &gpio0 25 0> /* D20/A2 */
|
||||
, <21 0 &gpio0 11 0> /* D21/A3 */
|
||||
;
|
||||
};
|
||||
|
||||
pro_micro_a: connector_a {
|
||||
compatible = "arduino-pro-micro";
|
||||
#gpio-cells = <2>;
|
||||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
gpio-map-pass-thru = <0 0x3f>;
|
||||
gpio-map
|
||||
= <0 0 &gpio0 29 0> /* D18/A0 */
|
||||
, <1 0 &gpio0 31 0> /* D19/A1 */
|
||||
, <2 0 &gpio0 25 0> /* D20/A2 */
|
||||
, <3 0 &gpio0 11 0> /* D21/A3 */
|
||||
, <6 0 &gpio0 22 0> /* D4/A6 */
|
||||
, <7 0 &gpio1 0 0> /* D6/A7 */
|
||||
, <8 0 &gpio1 4 0> /* D8/A8 */
|
||||
, <9 0 &gpio1 6 0> /* D9/A9 */
|
||||
, <10 0 &gpio0 9 0> /* D10/A10 */
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
pro_micro_d: &pro_micro {};
|
||||
pro_micro_i2c: &i2c0 {};
|
||||
pro_micro_spi: &spi0 {};
|
||||
pro_micro_serial: &uart0 {};
|
5
app/boards/arm/mikoto/board.cmake
Normal file
5
app/boards/arm/mikoto/board.cmake
Normal file
|
@ -0,0 +1,5 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
|
||||
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
|
122
app/boards/arm/mikoto/mikoto_520.dts
Normal file
122
app/boards/arm/mikoto/mikoto_520.dts
Normal file
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
* Copyright (c) 2020 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
#include "arduino_pro_micro_pins.dtsi"
|
||||
|
||||
/ {
|
||||
model = "mikoto";
|
||||
compatible = "zhiayang,mikoto";
|
||||
|
||||
chosen {
|
||||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
zmk,battery = &vbatt;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
blue_led: led_0 {
|
||||
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
|
||||
label = "Blue LED";
|
||||
};
|
||||
};
|
||||
|
||||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
|
||||
init-delay-ms = <50>;
|
||||
};
|
||||
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc 1>;
|
||||
output-ohms = <10000000>;
|
||||
full-ohms = <(10000000 + 4000000)>;
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiote {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
compatible = "nordic,nrf-twi";
|
||||
sda-pin = <17>;
|
||||
scl-pin = <20>;
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
compatible = "nordic,nrf-uarte";
|
||||
tx-pin = <8>;
|
||||
rx-pin = <4>;
|
||||
};
|
||||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
&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>;
|
||||
};
|
||||
};
|
||||
};
|
15
app/boards/arm/mikoto/mikoto_520.yaml
Normal file
15
app/boards/arm/mikoto/mikoto_520.yaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
identifier: mikoto_520
|
||||
name: mikoto_520
|
||||
type: mcu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- adc
|
||||
- usb_device
|
||||
- ble
|
||||
- ieee802154
|
||||
- pwm
|
||||
- watchdog
|
10
app/boards/arm/mikoto/mikoto_520.zmk.yml
Normal file
10
app/boards/arm/mikoto/mikoto_520.zmk.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
file_format: "1"
|
||||
id: mikoto_520
|
||||
name: Mikoto 5.20
|
||||
type: board
|
||||
arch: arm
|
||||
outputs:
|
||||
- usb
|
||||
- ble
|
||||
url: https://github.com/zhiayang/mikoto
|
||||
exposes: [pro_micro]
|
21
app/boards/arm/mikoto/mikoto_520_defconfig
Normal file
21
app/boards/arm/mikoto/mikoto_520_defconfig
Normal file
|
@ -0,0 +1,21 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
CONFIG_SOC_SERIES_NRF52X=y
|
||||
CONFIG_SOC_NRF52840_QIAA=y
|
||||
CONFIG_BOARD_MIKOTO_520=y
|
||||
|
||||
# Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
CONFIG_USE_DT_CODE_PARTITION=y
|
||||
CONFIG_BUILD_OUTPUT_UF2=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
|
48
app/boards/arm/mikoto/pinmux.c
Normal file
48
app/boards/arm/mikoto/pinmux.c
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2020 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <kernel.h>
|
||||
#include <device.h>
|
||||
#include <init.h>
|
||||
#include <drivers/gpio.h>
|
||||
#include <sys/sys_io.h>
|
||||
#include <devicetree.h>
|
||||
|
||||
static int pinmux_mikoto_init(const struct device *port) {
|
||||
ARG_UNUSED(port);
|
||||
|
||||
#if CONFIG_BOARD_MIKOTO_520
|
||||
const struct device *p0 = device_get_binding("GPIO_0");
|
||||
const struct device *p1 = device_get_binding("GPIO_1");
|
||||
#if CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_40MA
|
||||
gpio_pin_configure(p0, 26, GPIO_INPUT | GPIO_PULL_DOWN);
|
||||
gpio_pin_configure(p1, 15, GPIO_INPUT);
|
||||
#elif CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_100MA
|
||||
gpio_pin_configure(p0, 26, GPIO_OUTPUT);
|
||||
gpio_pin_set(p0, 26, 0);
|
||||
gpio_pin_configure(p1, 15, GPIO_INPUT);
|
||||
#elif CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_150MA
|
||||
gpio_pin_configure(p0, 26, GPIO_OUTPUT);
|
||||
gpio_pin_set(p0, 26, 0);
|
||||
gpio_pin_configure(p1, 15, GPIO_INPUT | GPIO_PULL_DOWN);
|
||||
#elif CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_250MA
|
||||
gpio_pin_configure(p0, 26, GPIO_INPUT);
|
||||
gpio_pin_configure(p1, 15, GPIO_OUTPUT);
|
||||
gpio_pin_set(p1, 15, 0);
|
||||
#elif CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_350MA
|
||||
gpio_pin_configure(p0, 26, GPIO_OUTPUT);
|
||||
gpio_pin_set(p0, 26, 0);
|
||||
gpio_pin_configure(p1, 15, GPIO_OUTPUT);
|
||||
gpio_pin_set(p1, 15, 0);
|
||||
#elif CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_NONE
|
||||
gpio_pin_configure(p0, 26, GPIO_INPUT);
|
||||
gpio_pin_configure(p1, 15, GPIO_INPUT);
|
||||
#endif
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYS_INIT(pinmux_mikoto_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);
|
8
app/boards/arm/nice60/Kconfig
Normal file
8
app/boards/arm/nice60/Kconfig
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Copyright (c) 2021 Nick Winans
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config BOARD_ENABLE_DCDC
|
||||
bool "Enable DCDC mode"
|
||||
select SOC_DCDC_NRF52X
|
||||
default y
|
||||
depends on BOARD_NICE60
|
6
app/boards/arm/nice60/Kconfig.board
Normal file
6
app/boards/arm/nice60/Kconfig.board
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Copyright (c) 2021 Nick Winans
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config BOARD_NICE60
|
||||
bool "nice!60"
|
||||
depends on SOC_NRF52840_QIAA
|
25
app/boards/arm/nice60/Kconfig.defconfig
Normal file
25
app/boards/arm/nice60/Kconfig.defconfig
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Copyright (c) 2021 Nick Winans
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if BOARD_NICE60
|
||||
|
||||
config ZMK_KEYBOARD_NAME
|
||||
default "nice!60"
|
||||
|
||||
if USB_DEVICE_STACK
|
||||
|
||||
config USB_NRFX
|
||||
default y
|
||||
|
||||
endif # USB_DEVICE_STACK
|
||||
|
||||
config BT_CTLR
|
||||
default BT
|
||||
|
||||
config ZMK_BLE
|
||||
default y
|
||||
|
||||
config ZMK_USB
|
||||
default y
|
||||
|
||||
endif # BOARD_NICE60
|
9
app/boards/arm/nice60/README.md
Normal file
9
app/boards/arm/nice60/README.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# nice!60
|
||||

|
||||
|
||||
The nice!60 is a hotswap 60% made by Nice Keyboards. https://nicekeyboards.com/nice-60
|
||||
|
||||
## Building nice!60 ZMK firmware
|
||||
```
|
||||
west build -p -b nice60
|
||||
```
|
7
app/boards/arm/nice60/board.cmake
Normal file
7
app/boards/arm/nice60/board.cmake
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Copyright (c) 2021 Nick Winans
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set(OPENOCD_NRF5_SUBFAMILY nrf52)
|
||||
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
|
||||
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake)
|
181
app/boards/arm/nice60/nice60.dts
Normal file
181
app/boards/arm/nice60/nice60.dts
Normal file
|
@ -0,0 +1,181 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Nick Winans
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
|
||||
#include <dt-bindings/led/led.h>
|
||||
#include <dt-bindings/zmk/matrix_transform.h>
|
||||
|
||||
/ {
|
||||
model = "nice!60";
|
||||
compatible = "nice,60";
|
||||
|
||||
chosen {
|
||||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
zmk,battery = &vbatt;
|
||||
zmk,kscan = &kscan0;
|
||||
zmk,matrix_transform = &default_transform;
|
||||
zmk,underglow = &led_strip;
|
||||
};
|
||||
|
||||
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,13)
|
||||
RC(4,0) RC(4,1) RC(4,2) RC(4,5) 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
|
||||
= <&gpio1 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio1 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio1 12 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio1 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&gpio1 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
;
|
||||
col-gpios
|
||||
= <&gpio1 15 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 29 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 31 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 30 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 28 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 2 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio0 3 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 3 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 7 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 4 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 6 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 5 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 1 GPIO_ACTIVE_HIGH>
|
||||
, <&gpio1 2 GPIO_ACTIVE_HIGH>
|
||||
;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
blue_led: led_0 {
|
||||
gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
|
||||
label = "Blue LED";
|
||||
};
|
||||
};
|
||||
|
||||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
control-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
vbatt: 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 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
/* Cannot be used together with i2c0. */
|
||||
status = "okay";
|
||||
sck-pin = <12>;
|
||||
mosi-pin = <27>;
|
||||
miso-pin = <13>;
|
||||
|
||||
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 = <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 {
|
||||
/*
|
||||
* 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 = "mbr";
|
||||
reg = <0x00000000 0x00001000>;
|
||||
};
|
||||
|
||||
code_partition: partition@1000 {
|
||||
label = "code_partition";
|
||||
reg = <0x00001000 0x000d3000>;
|
||||
};
|
||||
|
||||
/*
|
||||
* The flash starting at 0x000d4000 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@d4000 {
|
||||
label = "storage";
|
||||
reg = <0x000d4000 0x00020000>;
|
||||
};
|
||||
|
||||
boot_partition: partition@f4000 {
|
||||
label = "adafruit_boot";
|
||||
reg = <0x000f4000 0x0000c000>;
|
||||
};
|
||||
};
|
||||
};
|
50
app/boards/arm/nice60/nice60.keymap
Normal file
50
app/boards/arm/nice60/nice60.keymap
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Nick Winans
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/rgb.h>
|
||||
#include <dt-bindings/zmk/bt.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 |
|
||||
// | CTL | WIN | ALT | SPACE | ALT | WIN | MO(1) | CTL |
|
||||
// ------------------------------------------------------------------------------------------
|
||||
bindings = <
|
||||
&gresc &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC
|
||||
&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 SEMI &kp SQT &kp RET
|
||||
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
|
||||
&kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &kp RGUI &mo 1 &kp RCTRL
|
||||
>;
|
||||
};
|
||||
|
||||
rgb_layer {
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// | BT CLR | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | EFFECT REV |
|
||||
// | BT 1 | | UP | | HUEUP | SATUP | BRIUP | SPDUP | | | | | | |
|
||||
// | BT 2 | LT | DN | RT | HUEDN | SATDN | BRIDN | SPDDN | | | | | EFFECT FORW |
|
||||
// | BT 3 | | | | | | | | | | | |
|
||||
// | BT 4 | | | TOG RGB | PRT SCR | | | DEL |
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bindings = <
|
||||
&bt BT_CLR &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &rgb_ug RGB_EFR
|
||||
&bt BT_SEL 0 &trans &kp UP &trans &rgb_ug RGB_HUI &rgb_ug RGB_SAI &rgb_ug RGB_BRI &rgb_ug RGB_SPI &trans &trans &trans &trans &trans &trans
|
||||
&bt BT_SEL 1 &kp LEFT &kp DOWN &kp RIGHT &rgb_ug RGB_HUD &rgb_ug RGB_SAD &rgb_ug RGB_BRD &rgb_ug RGB_SPD &trans &trans &trans &trans &rgb_ug RGB_EFF
|
||||
&bt BT_SEL 2 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
||||
&bt BT_SEL 3 &trans &trans &rgb_ug RGB_TOG &kp PSCRN &trans &trans &kp DEL
|
||||
>;
|
||||
};
|
||||
};
|
||||
};
|
14
app/boards/arm/nice60/nice60.yaml
Normal file
14
app/boards/arm/nice60/nice60.yaml
Normal file
|
@ -0,0 +1,14 @@
|
|||
identifier: nice60
|
||||
name: nice!60
|
||||
type: mcu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
supported:
|
||||
- adc
|
||||
- usb_device
|
||||
- ble
|
||||
- ieee802154
|
||||
- pwm
|
||||
- watchdog
|
12
app/boards/arm/nice60/nice60.zmk.yml
Normal file
12
app/boards/arm/nice60/nice60.zmk.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
file_format: "1"
|
||||
id: nice60
|
||||
name: nice!60
|
||||
type: board
|
||||
arch: arm
|
||||
features:
|
||||
- keys
|
||||
- underglow
|
||||
outputs:
|
||||
- usb
|
||||
- ble
|
||||
url: https://nicekeyboards.com/nice-60
|
28
app/boards/arm/nice60/nice60_defconfig
Normal file
28
app/boards/arm/nice60/nice60_defconfig
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Copyright (c) 2021 Nick Winans
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
CONFIG_SOC_SERIES_NRF52X=y
|
||||
CONFIG_SOC_NRF52840_QIAA=y
|
||||
CONFIG_BOARD_NICE60=y
|
||||
|
||||
# Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
CONFIG_USE_DT_CODE_PARTITION=y
|
||||
CONFIG_BUILD_OUTPUT_UF2=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
|
||||
|
||||
CONFIG_ZMK_RGB_UNDERGLOW=y
|
||||
CONFIG_WS2812_STRIP=y
|
||||
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=160
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=3
|
|
@ -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
|
||||
)
|
|
@ -4,4 +4,4 @@ config BOARD_ENABLE_DCDC
|
|||
bool "Enable DCDC mode"
|
||||
select SOC_DCDC_NRF52X
|
||||
default y
|
||||
depends on BOARD_NICE_NANO
|
||||
depends on (BOARD_NICE_NANO || BOARD_NICE_NANO_V2)
|
||||
|
|
|
@ -7,3 +7,7 @@ config BOARD_NICE_NANO
|
|||
bool "nice!nano"
|
||||
depends on SOC_NRF52840_QIAA
|
||||
|
||||
config BOARD_NICE_NANO_V2
|
||||
bool "nice!nano v2"
|
||||
depends on SOC_NRF52840_QIAA
|
||||
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
# Copyright (c) 2020 Pete Johanson
|
||||
# Copyright (c) 2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if BOARD_NICE_NANO
|
||||
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
|
||||
|
@ -25,7 +22,4 @@ config ZMK_BLE
|
|||
config ZMK_USB
|
||||
default y
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_NICE_NANO
|
||||
endif # BOARD_NICE_NANO || BOARD_NICE_NANO_V2
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
/ {
|
||||
pro_micro_d: connector_d {
|
||||
pro_micro: connector {
|
||||
compatible = "arduino-pro-micro";
|
||||
#gpio-cells = <2>;
|
||||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
|
@ -25,6 +25,10 @@
|
|||
, <16 0 &gpio0 10 0> /* D16 */
|
||||
, <14 0 &gpio1 11 0> /* D14 */
|
||||
, <15 0 &gpio1 13 0> /* D15 */
|
||||
, <18 0 &gpio1 15 0> /* D18/A0 */
|
||||
, <19 0 &gpio0 2 0> /* D19/A1 */
|
||||
, <20 0 &gpio0 29 0> /* D20/A2 */
|
||||
, <21 0 &gpio0 31 0> /* D21/A3 */
|
||||
;
|
||||
};
|
||||
|
||||
|
@ -34,10 +38,10 @@
|
|||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
gpio-map-pass-thru = <0 0x3f>;
|
||||
gpio-map
|
||||
= <0 0 &gpio1 15 0> /* A0 */
|
||||
, <1 0 &gpio0 2 0> /* A1 */
|
||||
, <2 0 &gpio0 29 0> /* A2 */
|
||||
, <3 0 &gpio0 31 0> /* A3 */
|
||||
= <0 0 &gpio1 15 0> /* D18/A0 */
|
||||
, <1 0 &gpio0 2 0> /* D19/A1 */
|
||||
, <2 0 &gpio0 29 0> /* D20/A2 */
|
||||
, <3 0 &gpio0 31 0> /* D21/A3 */
|
||||
, <6 0 &gpio0 22 0> /* D4/A6 */
|
||||
, <7 0 &gpio1 0 0> /* D6/A7 */
|
||||
, <8 0 &gpio1 4 0> /* D8/A8 */
|
||||
|
@ -47,6 +51,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
pro_micro_d: &pro_micro {};
|
||||
pro_micro_i2c: &i2c0 {};
|
||||
pro_micro_spi: &spi0 {};
|
||||
pro_micro_serial: &uart0 {};
|
||||
|
|
|
@ -1,29 +1,15 @@
|
|||
/*
|
||||
* Copyright (c) 2020 Pete Johanson
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
#include "arduino_pro_micro_pins.dtsi"
|
||||
#include "nice_nano.dtsi"
|
||||
|
||||
/ {
|
||||
model = "nice!nano";
|
||||
compatible = "nice,nano";
|
||||
|
||||
chosen {
|
||||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
blue_led: led_0 {
|
||||
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
|
||||
label = "Blue LED";
|
||||
};
|
||||
zmk,battery = &vbatt;
|
||||
};
|
||||
|
||||
ext-power {
|
||||
|
@ -32,7 +18,7 @@
|
|||
control-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
vbatt {
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc 2>;
|
||||
|
@ -40,76 +26,3 @@
|
|||
full-ohms = <(2000000 + 806000)>;
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiote {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
compatible = "nordic,nrf-twi";
|
||||
sda-pin = <17>;
|
||||
scl-pin = <20>;
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
compatible = "nordic,nrf-uarte";
|
||||
tx-pin = <6>;
|
||||
rx-pin = <8>;
|
||||
};
|
||||
|
||||
&usbd {
|
||||
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>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
105
app/boards/arm/nice_nano/nice_nano.dtsi
Normal file
105
app/boards/arm/nice_nano/nice_nano.dtsi
Normal file
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
#include "arduino_pro_micro_pins.dtsi"
|
||||
|
||||
/ {
|
||||
model = "nice!nano";
|
||||
compatible = "nice,nano";
|
||||
|
||||
chosen {
|
||||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
blue_led: led_0 {
|
||||
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
|
||||
label = "Blue LED";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiote {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
compatible = "nordic,nrf-twi";
|
||||
sda-pin = <17>;
|
||||
scl-pin = <20>;
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
compatible = "nordic,nrf-uarte";
|
||||
tx-pin = <6>;
|
||||
rx-pin = <8>;
|
||||
};
|
||||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
&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>;
|
||||
};
|
||||
};
|
||||
};
|
10
app/boards/arm/nice_nano/nice_nano.zmk.yml
Normal file
10
app/boards/arm/nice_nano/nice_nano.zmk.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
file_format: "1"
|
||||
id: nice_nano
|
||||
name: nice!nano v1
|
||||
type: board
|
||||
arch: arm
|
||||
outputs:
|
||||
- usb
|
||||
- ble
|
||||
url: https://nicekeyboards.com/nice-nano
|
||||
exposes: [pro_micro]
|
|
@ -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
|
||||
|
|
26
app/boards/arm/nice_nano/nice_nano_v2.dts
Normal file
26
app/boards/arm/nice_nano/nice_nano_v2.dts
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include "nice_nano.dtsi"
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,battery = &vbatt;
|
||||
};
|
||||
|
||||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
|
||||
init-delay-ms = <50>;
|
||||
};
|
||||
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-nrf-vddh";
|
||||
label = "BATTERY";
|
||||
};
|
||||
};
|
15
app/boards/arm/nice_nano/nice_nano_v2.yaml
Normal file
15
app/boards/arm/nice_nano/nice_nano_v2.yaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
identifier: nice_nano_v2
|
||||
name: nice!nano v2
|
||||
type: mcu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- adc
|
||||
- usb_device
|
||||
- ble
|
||||
- ieee802154
|
||||
- pwm
|
||||
- watchdog
|
10
app/boards/arm/nice_nano/nice_nano_v2.zmk.yml
Normal file
10
app/boards/arm/nice_nano/nice_nano_v2.zmk.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
file_format: "1"
|
||||
id: nice_nano_v2
|
||||
name: nice!nano v2
|
||||
type: board
|
||||
arch: arm
|
||||
outputs:
|
||||
- usb
|
||||
- ble
|
||||
url: https://nicekeyboards.com/nice-nano
|
||||
exposes: [pro_micro]
|
21
app/boards/arm/nice_nano/nice_nano_v2_defconfig
Normal file
21
app/boards/arm/nice_nano/nice_nano_v2_defconfig
Normal file
|
@ -0,0 +1,21 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
CONFIG_SOC_SERIES_NRF52X=y
|
||||
CONFIG_SOC_NRF52840_QIAA=y
|
||||
CONFIG_BOARD_NICE_NANO_V2=y
|
||||
|
||||
# Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
CONFIG_USE_DT_CODE_PARTITION=y
|
||||
CONFIG_BUILD_OUTPUT_UF2=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
|
|
@ -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
|
||||
)
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
10
app/boards/arm/nrf52840_m2/nrf52840_m2.zmk.yml
Normal file
10
app/boards/arm/nrf52840_m2/nrf52840_m2.zmk.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
file_format: "1"
|
||||
id: nrf52840_m2
|
||||
name: nRF52840 M.2 Module
|
||||
type: board
|
||||
arch: arm
|
||||
outputs:
|
||||
- usb
|
||||
- ble
|
||||
url: https://wiki.makerdiary.com/nrf52840-m2/
|
||||
exposes: [makerdiary_nrf52840_m2]
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
@ -35,9 +32,6 @@ if BOARD_NRFMICRO_13
|
|||
config BOARD_NRFMICRO_CHARGER
|
||||
default y
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_NRFMICRO_13
|
||||
|
||||
endif # BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
|
||||
/ {
|
||||
pro_micro_d: connector_d {
|
||||
pro_micro: connector {
|
||||
compatible = "arduino-pro-micro";
|
||||
#gpio-cells = <2>;
|
||||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
|
@ -24,8 +24,12 @@
|
|||
, <9 0 &gpio1 6 0> /* D9/A9 */
|
||||
, <10 0 &gpio1 11 0> /* D10/A10 */
|
||||
, <16 0 &gpio0 28 0> /* D16 */
|
||||
, <14 0 &gpio0 3 0> /* D14 */
|
||||
, <14 0 &gpio0 3 0> /* D14 */
|
||||
, <15 0 &gpio1 13 0> /* D15 */
|
||||
, <18 0 &gpio0 2 0> /* D18/A0 */
|
||||
, <19 0 &gpio0 29 0> /* D19/A1 */
|
||||
, <20 0 &gpio0 31 0> /* D20/A2 */
|
||||
, <21 0 &gpio0 30 0> /* D21/A3 */
|
||||
;
|
||||
};
|
||||
|
||||
|
@ -35,10 +39,10 @@
|
|||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
gpio-map-pass-thru = <0 0x3f>;
|
||||
gpio-map
|
||||
= <0 0 &gpio0 2 0> /* A0 */
|
||||
, <1 0 &gpio0 29 0> /* A1 */
|
||||
, <2 0 &gpio0 31 0> /* A2 */
|
||||
, <3 0 &gpio0 30 0> /* A3 */
|
||||
= <0 0 &gpio0 2 0> /* D18/A0 */
|
||||
, <1 0 &gpio0 29 0> /* D19/A1 */
|
||||
, <2 0 &gpio0 31 0> /* D20/A2 */
|
||||
, <3 0 &gpio0 30 0> /* D21/A3 */
|
||||
, <6 0 &gpio0 20 0> /* D4/A6 */
|
||||
, <7 0 &gpio0 24 0> /* D6/A7 */
|
||||
, <8 0 &gpio0 10 0> /* D8/A8 */
|
||||
|
@ -49,6 +53,7 @@
|
|||
};
|
||||
|
||||
|
||||
pro_micro_d: &pro_micro {};
|
||||
pro_micro_i2c: &i2c0 {};
|
||||
pro_micro_spi: &spi0 {};
|
||||
pro_micro_serial: &uart0 {};
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
/ {
|
||||
pro_micro_d: connector_d {
|
||||
pro_micro: connector {
|
||||
compatible = "arduino-pro-micro";
|
||||
#gpio-cells = <2>;
|
||||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
|
@ -21,10 +21,14 @@
|
|||
, <7 0 &gpio0 3 0> /* D7 */
|
||||
, <8 0 &gpio0 28 0> /* D8/A8 */
|
||||
, <9 0 &gpio1 11 0> /* D9/A9 */
|
||||
, <10 0 &gpio1 6 0> /* D10/A10 */
|
||||
, <10 0 &gpio1 6 0> /* D10/A10 */
|
||||
, <16 0 &gpio0 10 0> /* D16 */
|
||||
, <14 0 &gpio0 9 0> /* D14 */
|
||||
, <14 0 &gpio0 9 0> /* D14 */
|
||||
, <15 0 &gpio0 24 0> /* D15 */
|
||||
, <18 0 &gpio0 13 0> /* D18/A0 */
|
||||
, <19 0 &gpio0 20 0> /* D19/A1 */
|
||||
, <20 0 &gpio0 17 0> /* D20/A2 */
|
||||
, <21 0 &gpio0 15 0> /* D21/A3 */
|
||||
;
|
||||
};
|
||||
|
||||
|
@ -34,10 +38,10 @@
|
|||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
gpio-map-pass-thru = <0 0x3f>;
|
||||
gpio-map
|
||||
= <0 0 &gpio0 13 0> /* A0 */
|
||||
, <1 0 &gpio0 20 0> /* A1 */
|
||||
, <2 0 &gpio0 17 0> /* A2 */
|
||||
, <3 0 &gpio0 15 0> /* A3 */
|
||||
= <0 0 &gpio0 13 0> /* D18/A0 */
|
||||
, <1 0 &gpio0 20 0> /* D19/A1 */
|
||||
, <2 0 &gpio0 17 0> /* D20/A2 */
|
||||
, <3 0 &gpio0 15 0> /* D21/A3 */
|
||||
, <6 0 &gpio0 29 0> /* D4/A6 */
|
||||
, <7 0 &gpio1 13 0> /* D6/A7 */
|
||||
, <8 0 &gpio0 28 0> /* D8/A8 */
|
||||
|
@ -47,6 +51,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
pro_micro_d: &pro_micro {};
|
||||
pro_micro_i2c: &i2c0 {};
|
||||
pro_micro_spi: &spi0 {};
|
||||
pro_micro_serial: &uart0 {};
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue