Merge branch 'zmkfirmware:main' into main
This commit is contained in:
commit
a24fa872dd
763 changed files with 22239 additions and 25552 deletions
|
@ -1,4 +1,4 @@
|
|||
FROM docker.io/zmkfirmware/zmk-dev-arm:2.5
|
||||
FROM docker.io/zmkfirmware/zmk-dev-arm:3.0
|
||||
|
||||
COPY .bashrc tmp
|
||||
RUN mv /tmp/.bashrc ~/.bashrc
|
||||
|
|
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
|
451
.github/workflows/build.yml
vendored
451
.github/workflows/build.yml
vendored
|
@ -9,80 +9,24 @@ on:
|
|||
paths:
|
||||
- ".github/workflows/build.yml"
|
||||
- "app/**"
|
||||
schedule:
|
||||
- cron: '22 4 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker.io/zmkfirmware/zmk-build-arm:2.5
|
||||
image: docker.io/zmkfirmware/zmk-build-arm:3.0
|
||||
needs: compile-matrix
|
||||
strategy:
|
||||
matrix:
|
||||
board:
|
||||
- bluemicro840_v1
|
||||
- nice_nano
|
||||
- nice_nano_v2
|
||||
- nrfmicro_13
|
||||
- proton_c
|
||||
shield:
|
||||
- bfo9000_left
|
||||
- bfo9000_right
|
||||
- boardsource3x4
|
||||
- corne_left
|
||||
- corne_right
|
||||
- cradio_left
|
||||
- cradio_right
|
||||
- crbn
|
||||
- eek
|
||||
- helix_left
|
||||
- helix_right
|
||||
- iris_left
|
||||
- iris_right
|
||||
- jian_left
|
||||
- jian_right
|
||||
- jorne_left
|
||||
- jorne_right
|
||||
- kyria_left
|
||||
- kyria_right
|
||||
- lily58_left
|
||||
- lily58_right
|
||||
- microdox_left
|
||||
- microdox_right
|
||||
- nibble
|
||||
- qaz
|
||||
- quefrency_left
|
||||
- quefrency_right
|
||||
- reviung41
|
||||
- romac
|
||||
- romac_plus
|
||||
- settings_reset
|
||||
- sofle_left
|
||||
- sofle_right
|
||||
- splitreus62_left
|
||||
- splitreus62_right
|
||||
- tg4x
|
||||
- tidbit
|
||||
cmake-args: [""]
|
||||
include:
|
||||
- board: bdn9_rev2
|
||||
- board: dz60rgb_rev1
|
||||
- board: nrf52840_m2
|
||||
shield: m60
|
||||
- board: planck_rev6
|
||||
- board: proton_c
|
||||
shield: clueboard_california
|
||||
- board: nice_nano_v2
|
||||
shield: kyria_left
|
||||
cmake-args: -DCONFIG_ZMK_DISPLAY=y
|
||||
skip-archive: true
|
||||
- board: nice_nano_v2
|
||||
shield: kyria_right
|
||||
cmake-args: -DCONFIG_ZMK_DISPLAY=y
|
||||
skip-archive: true
|
||||
include: ${{ fromJSON(needs.compile-matrix.outputs.include-list) }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache west modules
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3.0.2
|
||||
env:
|
||||
cache-name: cache-zephyr-modules
|
||||
with:
|
||||
|
@ -104,29 +48,360 @@ jobs:
|
|||
run: west update
|
||||
- name: Export Zephyr CMake package (west zephyr-export)
|
||||
run: west zephyr-export
|
||||
- name: Prepare variables
|
||||
id: variables
|
||||
run: |
|
||||
SHIELD_ARG=
|
||||
ARTIFACT_NAME="${{ matrix.board }}"
|
||||
|
||||
if [ -n "${{ matrix.shield }}" ]; then
|
||||
SHIELD_ARG="-DSHIELD=${{ matrix.shield }}"
|
||||
ARTIFACT_NAME="${ARTIFACT_NAME}-${{ matrix.shield }}"
|
||||
fi
|
||||
|
||||
ARTIFACT_NAME="${ARTIFACT_NAME}-zmk"
|
||||
|
||||
echo ::set-output name=shield-arg::${SHIELD_ARG}
|
||||
echo ::set-output name=artifact-name::${ARTIFACT_NAME}
|
||||
- name: Build (west build)
|
||||
run: west build -s app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} ${{ matrix.cmake-args }}
|
||||
- name: Archive artifacts
|
||||
if: ${{ !matrix.skip-archive }}
|
||||
uses: actions/upload-artifact@v2
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
name: "${{ steps.variables.outputs.artifact-name }}"
|
||||
path: |
|
||||
build/zephyr/zmk.hex
|
||||
build/zephyr/zmk.uf2
|
||||
continue-on-error: true
|
||||
node-version: '14.x'
|
||||
- name: Install @actions/artifact
|
||||
run: npm install @actions/artifact
|
||||
- name: Build and upload artifacts
|
||||
uses: actions/github-script@v4
|
||||
id: boards-list
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const artifact = require('@actions/artifact');
|
||||
const artifactClient = artifact.create();
|
||||
|
||||
const execSync = require('child_process').execSync;
|
||||
|
||||
const buildShieldArgs = JSON.parse(`${{ matrix.shieldArgs }}`);
|
||||
|
||||
let error = false;
|
||||
|
||||
for (const shieldArgs of buildShieldArgs) {
|
||||
try {
|
||||
const output = execSync(`west build -s app -p -b ${{ matrix.board }} -- ${shieldArgs.shield ? '-DSHIELD=' + shieldArgs.shield : ''} ${shieldArgs['cmake-args'] || ''}`);
|
||||
|
||||
console.log(`::group::${{ matrix.board}} ${shieldArgs.shield} Build`)
|
||||
console.log(output.toString());
|
||||
|
||||
const fileExtensions = ["hex", "uf2"];
|
||||
|
||||
const files = fileExtensions
|
||||
.map(extension => "build/zephyr/zmk." + extension)
|
||||
.filter(path => fs.existsSync(path));
|
||||
|
||||
const rootDirectory = 'build/zephyr';
|
||||
const options = {
|
||||
continueOnError: true
|
||||
}
|
||||
|
||||
const cmakeName = shieldArgs['cmake-args'] ? '-' + (shieldArgs.nickname || shieldArgs['cmake-args'].split(' ').join('')) : '';
|
||||
const artifactName = `${{ matrix.board }}${shieldArgs.shield ? '-' + shieldArgs.shield : ''}${cmakeName}-zmk`;
|
||||
|
||||
await artifactClient.uploadArtifact(artifactName, files, rootDirectory, options);
|
||||
} catch (e) {
|
||||
console.error(`::error::Failed to build or upload ${{ matrix.board }} ${shieldArgs.shield} ${shieldArgs['cmake-args']}`);
|
||||
console.error(e);
|
||||
error = true;
|
||||
} finally {
|
||||
console.log('::endgroup::');
|
||||
}
|
||||
}
|
||||
|
||||
if (error) {
|
||||
throw new Error('Failed to build one or more configurations');
|
||||
}
|
||||
compile-matrix:
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: [core-coverage, board-changes, nightly]
|
||||
outputs:
|
||||
include-list: ${{ steps.compile-list.outputs.result }}
|
||||
steps:
|
||||
- name: Join build lists
|
||||
uses: actions/github-script@v4
|
||||
id: compile-list
|
||||
with:
|
||||
script: |
|
||||
const coreCoverage = `${{ needs.core-coverage.outputs.core-include }}` || "[]";
|
||||
const boardChanges = `${{ needs.board-changes.outputs.boards-include }}` || "[]";
|
||||
const nightly = `${{ needs.nightly.outputs.nightly-include }}` || "[]";
|
||||
|
||||
const combined = [
|
||||
...JSON.parse(coreCoverage),
|
||||
...JSON.parse(boardChanges),
|
||||
...JSON.parse(nightly)
|
||||
];
|
||||
const combinedUnique = [...new Map(combined.map(el => [JSON.stringify(el), el])).values()];
|
||||
|
||||
const perBoard = {};
|
||||
|
||||
for (const configuration of combinedUnique) {
|
||||
if (!perBoard[configuration.board])
|
||||
perBoard[configuration.board] = [];
|
||||
|
||||
perBoard[configuration.board].push({
|
||||
shield: configuration.shield,
|
||||
'cmake-args': configuration['cmake-args'],
|
||||
nickname: configuration.nickname
|
||||
})
|
||||
}
|
||||
|
||||
return Object.entries(perBoard).map(([board, shieldArgs]) => ({
|
||||
board,
|
||||
shieldArgs: JSON.stringify(shieldArgs),
|
||||
}));
|
||||
core-coverage:
|
||||
if: ${{ needs.get-changed-files.outputs.core-changes == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: get-changed-files
|
||||
outputs:
|
||||
core-include: ${{ steps.core-list.outputs.result }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- name: Install js-yaml
|
||||
run: npm install js-yaml
|
||||
- uses: actions/github-script@v4
|
||||
id: core-list
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const coreCoverage = yaml.load(fs.readFileSync('app/core-coverage.yml', 'utf8'));
|
||||
|
||||
let include = coreCoverage.board.flatMap(board =>
|
||||
coreCoverage.shield.map(shield => ({ board, shield }))
|
||||
);
|
||||
|
||||
return [...include, ...coreCoverage.include];
|
||||
board-changes:
|
||||
if: ${{ needs.get-changed-files.outputs.board-changes == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: [get-grouped-hardware, get-changed-files]
|
||||
outputs:
|
||||
boards-include: ${{ steps.boards-list.outputs.result }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- name: Install js-yaml
|
||||
run: npm install js-yaml
|
||||
- uses: actions/github-script@v4
|
||||
id: boards-list
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const changedFiles = JSON.parse(`${{ needs.get-changed-files.outputs.changed-files }}`);
|
||||
const metadata = JSON.parse(`${{ needs.get-grouped-hardware.outputs.organized-metadata }}`);
|
||||
const boardChanges = new Set(changedFiles.filter(f => f.startsWith('app/boards')).map(f => f.split('/').slice(0, 4).join('/')));
|
||||
|
||||
return (await Promise.all([...boardChanges].flatMap(async bc => {
|
||||
const globber = await glob.create(bc + "/*.zmk.yml");
|
||||
const files = await globber.glob();
|
||||
|
||||
const aggregated = files.flatMap((f) =>
|
||||
yaml.loadAll(fs.readFileSync(f, "utf8"))
|
||||
);
|
||||
|
||||
const boardAndShield = (b, s) => {
|
||||
if (s.siblings) {
|
||||
return s.siblings.map(shield => ({
|
||||
board: b.id,
|
||||
shield,
|
||||
}));
|
||||
} else {
|
||||
return {
|
||||
board: b.id,
|
||||
shield: s.id
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return aggregated.flatMap(hm => {
|
||||
switch (hm.type) {
|
||||
case "board":
|
||||
if (hm.features && hm.features.includes("keys")) {
|
||||
if (hm.siblings) {
|
||||
return hm.siblings.map(board => ({
|
||||
board,
|
||||
}));
|
||||
} else {
|
||||
return {
|
||||
board: hm.id
|
||||
};
|
||||
}
|
||||
} else if (hm.exposes) {
|
||||
return hm.exposes.flatMap(i =>
|
||||
metadata.interconnects[i].shields.flatMap(s => boardAndShield(hm, s))
|
||||
);
|
||||
} else {
|
||||
console.error("Board without keys or interconnect");
|
||||
}
|
||||
break;
|
||||
case "shield":
|
||||
if (hm.features && hm.features.includes("keys")) {
|
||||
return hm.requires.flatMap(i =>
|
||||
metadata.interconnects[i].boards.flatMap(b => boardAndShield(b, hm))
|
||||
);
|
||||
}
|
||||
break;
|
||||
case "interconnect":
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}))).flat();
|
||||
nightly:
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: get-grouped-hardware
|
||||
outputs:
|
||||
nightly-include: ${{ steps.nightly-list.outputs.result }}
|
||||
steps:
|
||||
- name: Create nightly list
|
||||
uses: actions/github-script@v4
|
||||
id: nightly-list
|
||||
with:
|
||||
script: |
|
||||
const metadata = JSON.parse(`${{ needs.get-grouped-hardware.outputs.organized-metadata }}`);
|
||||
|
||||
let includeOnboard = metadata.onboard.flatMap(b => {
|
||||
if (b.siblings) {
|
||||
return b.siblings.map(board => ({
|
||||
board,
|
||||
}));
|
||||
} else {
|
||||
return {
|
||||
board: b.id,
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
let includeInterconnect = Object.values(metadata.interconnects).flatMap(i =>
|
||||
i.boards.flatMap(b =>
|
||||
i.shields.flatMap(s => {
|
||||
if (s.siblings) {
|
||||
return s.siblings.map(shield => ({
|
||||
board: b.id,
|
||||
shield,
|
||||
}));
|
||||
} else {
|
||||
return {
|
||||
board: b.id,
|
||||
shield: s.id,
|
||||
};
|
||||
}
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
return [...includeOnboard, ...includeInterconnect];
|
||||
get-grouped-hardware:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
organized-metadata: ${{ steps.organize-metadata.outputs.result }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- name: Install js-yaml
|
||||
run: npm install js-yaml
|
||||
- name: Aggregate Metadata
|
||||
uses: actions/github-script@v4
|
||||
id: aggregate-metadata
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const globber = await glob.create("app/boards/**/*.zmk.yml");
|
||||
const files = await globber.glob();
|
||||
|
||||
const aggregated = files.flatMap((f) =>
|
||||
yaml.loadAll(fs.readFileSync(f, "utf8"))
|
||||
);
|
||||
|
||||
return JSON.stringify(aggregated).replace(/\\/g,"\\\\");
|
||||
result-encoding: string
|
||||
|
||||
- name: Organize Metadata
|
||||
uses: actions/github-script@v4
|
||||
id: organize-metadata
|
||||
with:
|
||||
script: |
|
||||
const hardware = JSON.parse(`${{ steps.aggregate-metadata.outputs.result }}`);
|
||||
|
||||
const grouped = hardware.reduce((agg, hm) => {
|
||||
switch (hm.type) {
|
||||
case "board":
|
||||
if (hm.features && hm.features.includes("keys")) {
|
||||
agg.onboard.push(hm);
|
||||
} else if (hm.exposes) {
|
||||
hm.exposes.forEach((element) => {
|
||||
let ic = agg.interconnects[element] || {
|
||||
boards: [],
|
||||
shields: [],
|
||||
};
|
||||
ic.boards.push(hm);
|
||||
agg.interconnects[element] = ic;
|
||||
});
|
||||
} else {
|
||||
console.error("Board without keys or interconnect");
|
||||
}
|
||||
break;
|
||||
case "shield":
|
||||
if (hm.features && hm.features.includes("keys")) {
|
||||
hm.requires.forEach((id) => {
|
||||
let ic = agg.interconnects[id] || { boards: [], shields: [] };
|
||||
ic.shields.push(hm);
|
||||
agg.interconnects[id] = ic;
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "interconnect":
|
||||
let ic = agg.interconnects[hm.id] || { boards: [], shields: [] };
|
||||
ic.interconnect = hm;
|
||||
agg.interconnects[hm.id] = ic;
|
||||
break;
|
||||
}
|
||||
return agg;
|
||||
},
|
||||
{ onboard: [], interconnects: {} });
|
||||
|
||||
return JSON.stringify(grouped).replace(/\\/g,"\\\\");
|
||||
result-encoding: string
|
||||
get-changed-files:
|
||||
if: ${{ github.event_name != 'schedule' }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
changed-files: ${{ steps.changed-files.outputs.all }}
|
||||
board-changes: ${{ steps.board-changes.outputs.result }}
|
||||
core-changes: ${{ steps.core-changes.outputs.result }}
|
||||
steps:
|
||||
- uses: Ana06/get-changed-files@v2.0.0
|
||||
id: changed-files
|
||||
with:
|
||||
format: 'json'
|
||||
- uses: actions/github-script@v4
|
||||
id: board-changes
|
||||
with:
|
||||
script: |
|
||||
const changedFiles = JSON.parse(`${{ steps.changed-files.outputs.all }}`);
|
||||
const boardChanges = changedFiles.filter(f => f.startsWith('app/boards'));
|
||||
return boardChanges.length ? 'true' : 'false';
|
||||
result-encoding: string
|
||||
- uses: actions/github-script@v4
|
||||
id: core-changes
|
||||
with:
|
||||
script: |
|
||||
const changedFiles = JSON.parse(`${{ steps.changed-files.outputs.all }}`);
|
||||
const boardChanges = changedFiles.filter(f => f.startsWith('app/boards'));
|
||||
const appChanges = changedFiles.filter(f => f.startsWith('app'));
|
||||
const ymlChanges = changedFiles.includes('.github/workflows/build.yml');
|
||||
return boardChanges.length < appChanges.length || ymlChanges ? 'true' : 'false';
|
||||
result-encoding: string
|
||||
|
|
|
@ -29,7 +29,7 @@ jobs:
|
|||
validate-metadata:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker.io/zmkfirmware/zmk-dev-arm:2.5
|
||||
image: docker.io/zmkfirmware/zmk-dev-arm:3.0
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
|
|
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: docker.io/zmkfirmware/zmk-build-arm:2.5
|
||||
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
|
||||
|
|
|
@ -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,61 +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/endpoint_selection_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/)
|
||||
|
|
194
app/Kconfig
194
app/Kconfig
|
@ -88,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
|
||||
|
||||
|
@ -132,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
|
||||
|
||||
|
@ -139,6 +145,18 @@ config ZMK_BLE_PASSKEY_ENTRY
|
|||
bool "Experimental: Requiring typing passkey from host to pair BLE connection"
|
||||
default n
|
||||
|
||||
config BT_PERIPHERAL_PREF_MIN_INT
|
||||
default 6
|
||||
|
||||
config BT_PERIPHERAL_PREF_MAX_INT
|
||||
default 12
|
||||
|
||||
config BT_PERIPHERAL_PREF_LATENCY
|
||||
default 30
|
||||
|
||||
config BT_PERIPHERAL_PREF_TIMEOUT
|
||||
default 400
|
||||
|
||||
#ZMK_BLE
|
||||
endif
|
||||
|
||||
|
@ -148,99 +166,7 @@ endmenu
|
|||
# HID
|
||||
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
|
||||
select BT_GATT_AUTO_DISCOVER_CCC
|
||||
|
||||
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
|
||||
default 6
|
||||
|
||||
config BT_MAX_PAIRED
|
||||
default 6
|
||||
|
||||
#ZMK_SPLIT_BLE && ZMK_SPLIT_BLE_ROLE_CENTRAL
|
||||
endif
|
||||
|
||||
if !ZMK_SPLIT_BLE
|
||||
|
||||
config BT_MAX_CONN
|
||||
default 5
|
||||
|
||||
config BT_MAX_PAIRED
|
||||
default 5
|
||||
|
||||
#!ZMK_SPLIT_BLE
|
||||
endif
|
||||
|
||||
#ZMK_BLE
|
||||
endif
|
||||
|
||||
#Split Support
|
||||
endmenu
|
||||
rsource "src/split/Kconfig"
|
||||
|
||||
#Basic Keyboard Setup
|
||||
endmenu
|
||||
|
@ -249,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
|
||||
|
||||
|
@ -320,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
|
||||
|
||||
|
@ -335,10 +290,6 @@ config ZMK_SLEEP
|
|||
|
||||
if ZMK_SLEEP
|
||||
|
||||
choice SYS_PM_POLICY
|
||||
default PM_POLICY_APP
|
||||
endchoice
|
||||
|
||||
config PM_DEVICE
|
||||
default y
|
||||
|
||||
|
@ -370,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"
|
||||
|
@ -404,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
|
||||
|
||||
|
@ -433,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
|
||||
|
@ -451,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
|
||||
|
||||
|
@ -466,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
|
||||
|
||||
|
@ -481,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
|
||||
|
|
|
@ -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,8 +11,11 @@ CONFIG_FPU=y
|
|||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
# Enable pinmux
|
||||
CONFIG_PINMUX=y
|
||||
# Enable pinctrl
|
||||
CONFIG_PINCTRL=y
|
||||
|
||||
# Poll to avoid interrupt overlap issues
|
||||
CONFIG_ZMK_KSCAN_DIRECT_POLLING=y
|
||||
|
||||
# Needed to reduce this to size that will fit on F072
|
||||
CONFIG_HEAP_MEM_POOL_SIZE=1024
|
||||
|
@ -20,13 +23,3 @@ CONFIG_HEAP_MEM_POOL_SIZE=1024
|
|||
# clock configuration
|
||||
CONFIG_CLOCK_CONTROL=y
|
||||
|
||||
# Clock configuration for Cube Clock control driver
|
||||
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
|
||||
# use HSI as PLL input
|
||||
CONFIG_CLOCK_STM32_PLL_SRC_HSI=y
|
||||
# produce 72MHz clock at PLL output
|
||||
CONFIG_CLOCK_STM32_PLL_PREDIV=1
|
||||
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=12
|
||||
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
|
||||
CONFIG_CLOCK_STM32_APB1_PRESCALER=2
|
||||
CONFIG_CLOCK_STM32_APB2_PRESCALER=1
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
zmk,battery = &vbatt;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -33,7 +35,7 @@
|
|||
control-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
vbatt {
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc 7>;
|
||||
|
@ -73,6 +75,10 @@
|
|||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
)
|
|
@ -25,9 +25,6 @@ config ZMK_BLE
|
|||
config ZMK_USB
|
||||
default y
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
config ZMK_KEYBOARD_NAME
|
||||
default "BT60"
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
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;
|
||||
};
|
||||
|
@ -45,7 +47,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
vbatt {
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc 2>;
|
||||
|
@ -84,6 +86,10 @@
|
|||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13)
|
||||
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13)
|
||||
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,13)
|
||||
RC(3,0) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,13)
|
||||
RC(3,0) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,12)
|
||||
RC(4,0) RC(4,1) RC(4,2) RC(4,6) RC(4,10) RC(4,11) RC(4,12) RC(4,13) RC(4,14)
|
||||
>;
|
||||
};
|
||||
|
|
|
@ -15,6 +15,7 @@ CONFIG_EC11=y
|
|||
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
|
||||
|
||||
CONFIG_USE_DT_CODE_PARTITION=y
|
||||
CONFIG_BUILD_OUTPUT_UF2=y
|
||||
|
||||
CONFIG_MPU_ALLOW_FLASH_WRITE=y
|
||||
CONFIG_NVS=y
|
||||
|
|
|
@ -15,6 +15,7 @@ CONFIG_EC11=y
|
|||
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
|
||||
|
||||
CONFIG_USE_DT_CODE_PARTITION=y
|
||||
CONFIG_BUILD_OUTPUT_UF2=y
|
||||
|
||||
CONFIG_MPU_ALLOW_FLASH_WRITE=y
|
||||
CONFIG_NVS=y
|
||||
|
|
|
@ -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()
|
|
@ -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);
|
|
@ -17,7 +17,4 @@ config ZMK_USB
|
|||
config ZMK_KSCAN_MATRIX_POLLING
|
||||
default y
|
||||
|
||||
config ZMK_KSCAN_COMPOSITE_DRIVER
|
||||
default y
|
||||
|
||||
endif # BOARD_FERRIS
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
chosen {
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
zmk,kscan = &kscan;
|
||||
zmk,matrix_transform = &transform;
|
||||
/* TODO: Enable once we support the IC for underglow
|
||||
|
@ -98,6 +99,7 @@
|
|||
|
||||
&i2c2 {
|
||||
pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
clock-frequency = <I2C_BITRATE_FAST>;
|
||||
|
||||
|
@ -116,8 +118,31 @@
|
|||
status = "okay";
|
||||
};
|
||||
|
||||
&clk_hsi {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pll {
|
||||
prediv = <1>;
|
||||
mul = <6>;
|
||||
clocks = <&clk_hsi>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rcc {
|
||||
clocks = <&pll>;
|
||||
clock-frequency = <DT_FREQ_M(48)>;
|
||||
ahb-prescaler = <1>;
|
||||
apb1-prescaler = <1>;
|
||||
};
|
||||
|
||||
|
||||
&rtc {
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
|
|
|
@ -7,7 +7,7 @@ CONFIG_SOC_STM32F072XB=y
|
|||
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000
|
||||
|
||||
# enable PINMUX
|
||||
CONFIG_PINMUX=y
|
||||
CONFIG_PINCTRL=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
@ -17,8 +17,6 @@ CONFIG_I2C=y
|
|||
|
||||
# ZMK Settings
|
||||
CONFIG_ZMK_USB=y
|
||||
CONFIG_ZMK_KSCAN_GPIO_DRIVER=y
|
||||
CONFIG_ZMK_KSCAN_COMPOSITE_DRIVER=y
|
||||
CONFIG_ZMK_KSCAN_MATRIX_POLLING=y
|
||||
CONFIG_USB_SELF_POWERED=n
|
||||
|
||||
|
@ -31,13 +29,3 @@ CONFIG_HEAP_MEM_POOL_SIZE=1024
|
|||
# clock configuration
|
||||
CONFIG_CLOCK_CONTROL=y
|
||||
|
||||
# Clock configuration for Cube Clock control driver
|
||||
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
|
||||
# use HSI as PLL input
|
||||
CONFIG_CLOCK_STM32_PLL_SRC_HSI=y
|
||||
# produce 48MHz clock at PLL output
|
||||
# CONFIG_CLOCK_STM32_PLL_PREDIV=1
|
||||
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=6
|
||||
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
|
||||
CONFIG_CLOCK_STM32_APB1_PRESCALER=1
|
||||
# CONFIG_CLOCK_STM32_APB2_PRESCALER=1
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -34,7 +34,4 @@ choice BOARD_MIKOTO_CHARGER_CURRENT
|
|||
default BOARD_MIKOTO_CHARGER_CURRENT_100MA
|
||||
endchoice
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_MIKOTO_520
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
zmk,battery = &vbatt;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -33,10 +35,10 @@
|
|||
init-delay-ms = <50>;
|
||||
};
|
||||
|
||||
vbatt {
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc 2>;
|
||||
io-channels = <&adc 1>;
|
||||
output-ohms = <10000000>;
|
||||
full-ohms = <(10000000 + 4000000)>;
|
||||
};
|
||||
|
@ -72,6 +74,10 @@
|
|||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/../tools/uf2/utils/uf2conv.py
|
||||
-c
|
||||
-b 0x1000
|
||||
-f 0xADA52840
|
||||
-o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.uf2
|
||||
${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
|
||||
)
|
|
@ -6,15 +6,12 @@ if BOARD_NICE60
|
|||
config ZMK_KEYBOARD_NAME
|
||||
default "nice!60"
|
||||
|
||||
if USB
|
||||
if USB_DEVICE_STACK
|
||||
|
||||
config USB_NRFX
|
||||
default y
|
||||
|
||||
config USB_DEVICE_STACK
|
||||
default y
|
||||
|
||||
endif # USB
|
||||
endif # USB_DEVICE_STACK
|
||||
|
||||
config BT_CTLR
|
||||
default BT
|
||||
|
@ -25,7 +22,4 @@ config ZMK_BLE
|
|||
config ZMK_USB
|
||||
default y
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_NICE60
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
/dts-v1/;
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
|
||||
#include <dt-bindings/led/led.h>
|
||||
#include <dt-bindings/zmk/matrix_transform.h>
|
||||
|
||||
/ {
|
||||
|
@ -16,6 +18,8 @@
|
|||
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;
|
||||
|
@ -78,7 +82,7 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) R
|
|||
control-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
vbatt {
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc 2>;
|
||||
|
@ -123,11 +127,16 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) R
|
|||
chain-length = <12>; /* LED strip length */
|
||||
spi-one-frame = <0x70>;
|
||||
spi-zero-frame = <0x40>;
|
||||
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
|
||||
};
|
||||
};
|
||||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
|
|
|
@ -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,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
|
||||
)
|
|
@ -6,15 +6,12 @@ if BOARD_NICE_NANO || BOARD_NICE_NANO_V2
|
|||
config BOARD
|
||||
default "nice_nano"
|
||||
|
||||
if USB
|
||||
if USB_DEVICE_STACK
|
||||
|
||||
config USB_NRFX
|
||||
default y
|
||||
|
||||
config USB_DEVICE_STACK
|
||||
default y
|
||||
|
||||
endif # USB
|
||||
endif # USB_DEVICE_STACK
|
||||
|
||||
config BT_CTLR
|
||||
default BT
|
||||
|
@ -26,17 +23,3 @@ config ZMK_USB
|
|||
default y
|
||||
|
||||
endif # BOARD_NICE_NANO || BOARD_NICE_NANO_V2
|
||||
|
||||
if BOARD_NICE_NANO
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_NICE_NANO
|
||||
|
||||
if BOARD_NICE_NANO_V2
|
||||
|
||||
config ZMK_BATTERY_NRF_VDDH
|
||||
default y
|
||||
|
||||
endif # BOARD_NICE_NANO_V2
|
||||
|
|
|
@ -8,13 +8,17 @@
|
|||
#include "nice_nano.dtsi"
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,battery = &vbatt;
|
||||
};
|
||||
|
||||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
control-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
vbatt {
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc 2>;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -56,6 +57,10 @@
|
|||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -8,6 +8,10 @@
|
|||
#include "nice_nano.dtsi"
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,battery = &vbatt;
|
||||
};
|
||||
|
||||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
|
@ -15,7 +19,7 @@
|
|||
init-delay-ms = <50>;
|
||||
};
|
||||
|
||||
vbatt {
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-nrf-vddh";
|
||||
label = "BATTERY";
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
zmk,battery = &vbatt;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -32,7 +34,7 @@
|
|||
control-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
vbatt {
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc 2>;
|
||||
|
@ -71,6 +73,10 @@
|
|||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2,8 +2,3 @@
|
|||
|
||||
list(APPEND EXTRA_DTC_FLAGS "-qq")
|
||||
|
||||
if(CONFIG_PINMUX)
|
||||
zephyr_library()
|
||||
zephyr_library_sources(pinmux.c)
|
||||
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
|
||||
endif()
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2017 I-SENSE group of ICCS
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <kernel.h>
|
||||
#include <device.h>
|
||||
#include <init.h>
|
||||
#include <drivers/pinmux.h>
|
||||
#include <sys/sys_io.h>
|
||||
|
||||
#include <pinmux/stm32/pinmux_stm32.h>
|
||||
|
||||
/* pin assignments for STM32F3DISCOVERY board */
|
||||
static const struct pin_config pinconf[] = {
|
||||
#ifdef CONFIG_UART_1
|
||||
{STM32_PIN_PC4, STM32F3_PINMUX_FUNC_PC4_USART1_TX},
|
||||
{STM32_PIN_PC5, STM32F3_PINMUX_FUNC_PC5_USART1_RX},
|
||||
#endif /* CONFIG_UART_1 */
|
||||
#ifdef CONFIG_UART_2
|
||||
{STM32_PIN_PA2, STM32F3_PINMUX_FUNC_PA2_USART2_TX},
|
||||
{STM32_PIN_PA3, STM32F3_PINMUX_FUNC_PA3_USART2_RX},
|
||||
#endif /* CONFIG_UART_2 */
|
||||
#ifdef CONFIG_I2C_1
|
||||
{STM32_PIN_PB6, STM32F3_PINMUX_FUNC_PB6_I2C1_SCL},
|
||||
{STM32_PIN_PB7, STM32F3_PINMUX_FUNC_PB7_I2C1_SDA},
|
||||
#endif /* CONFIG_I2C_1 */
|
||||
#ifdef CONFIG_I2C_2
|
||||
{STM32_PIN_PA9, STM32F3_PINMUX_FUNC_PA9_I2C2_SCL},
|
||||
{STM32_PIN_PA10, STM32F3_PINMUX_FUNC_PA10_I2C2_SDA},
|
||||
#endif /* CONFIG_I2C_2 */
|
||||
#ifdef CONFIG_SPI_1
|
||||
#ifdef CONFIG_SPI_STM32_USE_HW_SS
|
||||
{STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS},
|
||||
#endif /* CONFIG_SPI_STM32_USE_HW_SS */
|
||||
{STM32_PIN_PA5, STM32F3_PINMUX_FUNC_PA5_SPI1_SCK},
|
||||
{STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO},
|
||||
{STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI},
|
||||
#endif /* CONFIG_SPI_1 */
|
||||
#ifdef CONFIG_SPI_2
|
||||
#ifdef CONFIG_SPI_STM32_USE_HW_SS
|
||||
{STM32_PIN_PB12, STM32F3_PINMUX_FUNC_PB12_SPI2_NSS},
|
||||
#endif /* CONFIG_SPI_STM32_USE_HW_SS */
|
||||
{STM32_PIN_PB13, STM32F3_PINMUX_FUNC_PB13_SPI2_SCK},
|
||||
{STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO},
|
||||
{STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI},
|
||||
#endif /* CONFIG_SPI_2 */
|
||||
#ifdef CONFIG_USB_DC_STM32
|
||||
{STM32_PIN_PA11, STM32F3_PINMUX_FUNC_PA11_USB_DM},
|
||||
{STM32_PIN_PA12, STM32F3_PINMUX_FUNC_PA12_USB_DP},
|
||||
#endif /* CONFIG_USB_DC_STM32 */
|
||||
#ifdef CONFIG_CAN_1
|
||||
{STM32_PIN_PD0, STM32F3_PINMUX_FUNC_PD0_CAN1_RX},
|
||||
{STM32_PIN_PD1, STM32F3_PINMUX_FUNC_PD1_CAN1_TX},
|
||||
#endif /* CONFIG_CAN_1 */
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port) {
|
||||
ARG_UNUSED(port);
|
||||
|
||||
stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1, CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
|
|
@ -1,11 +1,12 @@
|
|||
/*
|
||||
* Copyright (c) 2017 I-SENSE group of ICCS
|
||||
* Copyright (c) 2020 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <st/f3/stm32f303Xc.dtsi>
|
||||
#include <st/f3/stm32f303c(b-c)tx-pinctrl.dtsi>
|
||||
#include <dt-bindings/zmk/matrix_transform.h>
|
||||
|
||||
/ {
|
||||
|
@ -15,8 +16,9 @@
|
|||
chosen {
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
zmk,kscan = &kscan0;
|
||||
zmk,matrix_transform = &layout_grid_transform;
|
||||
zmk,matrix_transform = &layout_grid_transform;
|
||||
};
|
||||
|
||||
kscan0: kscan {
|
||||
|
@ -82,7 +84,33 @@ layout_2x2u_transform:
|
|||
};
|
||||
|
||||
&usb {
|
||||
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
&clk_hse {
|
||||
status = "okay";
|
||||
clock-frequency = <DT_FREQ_M(8)>;
|
||||
};
|
||||
|
||||
&pll {
|
||||
prediv = <1>;
|
||||
mul = <9>;
|
||||
clocks = <&clk_hse>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rcc {
|
||||
clocks = <&pll>;
|
||||
clock-frequency = <DT_FREQ_M(72)>;
|
||||
ahb-prescaler = <1>;
|
||||
apb1-prescaler = <2>;
|
||||
apb2-prescaler = <1>;
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
|
|
|
@ -8,21 +8,10 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000
|
|||
|
||||
# enable pinmux
|
||||
CONFIG_PINMUX=y
|
||||
CONFIG_PINCTRL=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
# clock configuration
|
||||
CONFIG_CLOCK_CONTROL=y
|
||||
|
||||
# Clock configuration for Cube Clock control driver
|
||||
CONFIG_CLOCK_STM32_HSE_CLOCK=8000000
|
||||
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
|
||||
# use HSE as PLL input
|
||||
CONFIG_CLOCK_STM32_PLL_SRC_HSE=y
|
||||
# produce 72MHz clock at PLL output
|
||||
CONFIG_CLOCK_STM32_PLL_PREDIV=1
|
||||
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9
|
||||
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
|
||||
CONFIG_CLOCK_STM32_APB1_PRESCALER=2
|
||||
CONFIG_CLOCK_STM32_APB2_PRESCALER=1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2020 Pete Johanson
|
||||
* Copyright (c) 2020 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
@ -16,6 +16,11 @@
|
|||
chosen {
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,console = &cdc_acm_uart0;
|
||||
};
|
||||
|
||||
aliases {
|
||||
led0 = &led;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -29,18 +34,47 @@
|
|||
|
||||
&usart1 {
|
||||
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&clk_hse {
|
||||
status = "okay";
|
||||
clock-frequency = <DT_FREQ_M(8)>;
|
||||
};
|
||||
|
||||
&pll {
|
||||
prediv = <1>;
|
||||
mul = <9>;
|
||||
clocks = <&clk_hse>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rcc {
|
||||
clocks = <&pll>;
|
||||
clock-frequency = <DT_FREQ_M(72)>;
|
||||
ahb-prescaler = <1>;
|
||||
apb1-prescaler = <2>;
|
||||
apb2-prescaler = <1>;
|
||||
};
|
||||
|
||||
&usb {
|
||||
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
cdc_acm_uart0: cdc_acm_uart0 {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
&rtc {
|
||||
|
|
|
@ -8,8 +8,8 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000
|
|||
# Floating Point Options
|
||||
CONFIG_FPU=y
|
||||
|
||||
# enable pinmux
|
||||
CONFIG_PINMUX=y
|
||||
# enable pinctrl
|
||||
CONFIG_PINCTRL=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
@ -17,14 +17,3 @@ CONFIG_GPIO=y
|
|||
# clock configuration
|
||||
CONFIG_CLOCK_CONTROL=y
|
||||
|
||||
# Clock configuration for Cube Clock control driver
|
||||
CONFIG_CLOCK_STM32_HSE_CLOCK=8000000
|
||||
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
|
||||
# use HSE as PLL input
|
||||
CONFIG_CLOCK_STM32_PLL_SRC_HSE=y
|
||||
# produce 72MHz clock at PLL output
|
||||
CONFIG_CLOCK_STM32_PLL_PREDIV=1
|
||||
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9
|
||||
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
|
||||
CONFIG_CLOCK_STM32_APB1_PRESCALER=2
|
||||
CONFIG_CLOCK_STM32_APB2_PRESCALER=1
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/../tools/uf2/utils/uf2conv.py
|
||||
-c
|
||||
-b 0x1000
|
||||
-f 0xADA52840
|
||||
-o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.uf2
|
||||
${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
|
||||
)
|
|
@ -25,7 +25,4 @@ config ZMK_BLE
|
|||
config ZMK_USB
|
||||
default y
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_S40NC
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
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;
|
||||
};
|
||||
|
@ -68,7 +70,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
vbatt {
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc 2>;
|
||||
|
@ -95,6 +97,10 @@
|
|||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
|
|
|
@ -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
|
||||
|
|
9
app/boards/arm/seeeduino_xiao/seeeduino_xiao.zmk.yml
Normal file
9
app/boards/arm/seeeduino_xiao/seeeduino_xiao.zmk.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
file_format: "1"
|
||||
id: seeeduino_xiao
|
||||
name: Seeeduino XIAO
|
||||
type: board
|
||||
arch: arm
|
||||
outputs:
|
||||
- usb
|
||||
url: https://wiki.seeedstudio.com/Seeeduino-XIAO/
|
||||
exposes: [seeed_xiao]
|
10
app/boards/arm/seeeduino_xiao_ble/seeeduino_xiao_ble.zmk.yml
Normal file
10
app/boards/arm/seeeduino_xiao_ble/seeeduino_xiao_ble.zmk.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
file_format: "1"
|
||||
id: seeeduino_xiao_ble
|
||||
name: Seeeduino XIAO BLE
|
||||
type: board
|
||||
arch: arm
|
||||
outputs:
|
||||
- usb
|
||||
- ble
|
||||
url: https://wiki.seeedstudio.com/XIAO_BLE/
|
||||
exposes: [seeed_xiao]
|
|
@ -8,3 +8,7 @@ description: |
|
|||
The SparkFun Pro Micro grew popular as a low cost ATmega32U4 board with sufficient GPIO and peripherals
|
||||
to work for many keyboard needs. Since the original Pro Micro, many pin compatible boards have appeared,
|
||||
with various changes or improvements, such as the Elite-C w/ USB-C, nice!nano with nRF52840 wireless.
|
||||
|
||||
Note: ZMK doesn't support boards with AVR 8-bit processors, such as the ATmega32U4, because Zephyr™ only
|
||||
supports 32-bit and 64-bit platforms. As a result, controllers like the SparkFun Pro Micro and the Elite-C
|
||||
are *not* supported by ZMK.
|
||||
|
|
10
app/boards/interconnects/seeed_xiao/seeed_xiao.zmk.yml
Normal file
10
app/boards/interconnects/seeed_xiao/seeed_xiao.zmk.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
file_format: "1"
|
||||
id: seeed_xiao
|
||||
name: Seeed XIAO
|
||||
type: interconnect
|
||||
url: https://wiki.seeedstudio.com/Seeeduino-XIAO/
|
||||
manufacturer: Seeed
|
||||
description: |
|
||||
The Seeed(uino) XIAO is a popular smaller format micro-controller, that has gained popularity as an alterative
|
||||
to the SparkFun Pro Micro. Since its creation, several pin compatible controllers, such
|
||||
as the Seeeduino XIAO BLE, Adafruit QT Py and Adafruit QT Py RP2040, have become available.
|
|
@ -1,6 +1,3 @@
|
|||
CONFIG_KSCAN=n
|
||||
CONFIG_ZMK_KSCAN_MOCK_DRIVER=y
|
||||
CONFIG_ZMK_KSCAN_GPIO_DRIVER=n
|
||||
CONFIG_GPIO=n
|
||||
CONFIG_ZMK_BLE=n
|
||||
CONFIG_LOG=y
|
||||
|
|
8
app/boards/native_posix_64.conf
Normal file
8
app/boards/native_posix_64.conf
Normal file
|
@ -0,0 +1,8 @@
|
|||
CONFIG_GPIO=n
|
||||
# Enable to have the native posix build expose USBIP device(s)
|
||||
# CONFIG_ZMK_USB=y
|
||||
CONFIG_LOG=y
|
||||
CONFIG_LOG_BACKEND_SHOW_COLOR=n
|
||||
CONFIG_ZMK_LOG_LEVEL_DBG=y
|
||||
CONFIG_DEBUG=y
|
||||
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000
|
18
app/boards/native_posix_64.overlay
Normal file
18
app/boards/native_posix_64.overlay
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/kscan_mock.h>
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan;
|
||||
};
|
||||
|
||||
kscan: kscan {
|
||||
compatible = "zmk,kscan-mock";
|
||||
label = "KSCAN_MOCK";
|
||||
|
||||
rows = <2>;
|
||||
columns = <2>;
|
||||
exit-after;
|
||||
};
|
||||
};
|
5
app/boards/seeeduino_xiao.conf
Normal file
5
app/boards/seeeduino_xiao.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
CONFIG_CONSOLE=n
|
||||
CONFIG_SERIAL=n
|
||||
CONFIG_UART_CONSOLE=n
|
||||
CONFIG_UART_INTERRUPT_DRIVEN=n
|
||||
CONFIG_ZMK_USB=y
|
19
app/boards/seeeduino_xiao.overlay
Normal file
19
app/boards/seeeduino_xiao.overlay
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
};
|
||||
};
|
||||
|
||||
&usb0 {
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
15
app/boards/seeeduino_xiao_ble.conf
Normal file
15
app/boards/seeeduino_xiao_ble.conf
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
CONFIG_CONSOLE=n
|
||||
CONFIG_SERIAL=n
|
||||
CONFIG_UART_CONSOLE=n
|
||||
CONFIG_UART_INTERRUPT_DRIVEN=n
|
||||
CONFIG_ZMK_USB=y
|
||||
CONFIG_ZMK_BLE=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
|
34
app/boards/seeeduino_xiao_ble.overlay
Normal file
34
app/boards/seeeduino_xiao_ble.overlay
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
zmk,battery = &vbatt;
|
||||
};
|
||||
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-voltage-divider";
|
||||
label = "BATTERY";
|
||||
io-channels = <&adc 7>;
|
||||
power-gpios = <&gpio0 14 (GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>;
|
||||
output-ohms = <1000000>;
|
||||
full-ohms = <(1000000 + 510000)>;
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbd {
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
label = "CDC_ACM_0";
|
||||
};
|
||||
};
|
||||
|
|
@ -6,7 +6,7 @@ if SHIELD_A_DUX_LEFT
|
|||
config ZMK_KEYBOARD_NAME
|
||||
default "A. Dux"
|
||||
|
||||
config ZMK_SPLIT_BLE_ROLE_CENTRAL
|
||||
config ZMK_SPLIT_ROLE_CENTRAL
|
||||
default y
|
||||
|
||||
endif
|
||||
|
|
9
app/boards/shields/bat43/Kconfig.defconfig
Normal file
9
app/boards/shields/bat43/Kconfig.defconfig
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Copyright (c) 2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if SHIELD_BAT43
|
||||
|
||||
config ZMK_KEYBOARD_NAME
|
||||
default "Bat43"
|
||||
|
||||
endif
|
5
app/boards/shields/bat43/Kconfig.shield
Normal file
5
app/boards/shields/bat43/Kconfig.shield
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Copyright (c) 2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config SHIELD_BAT43
|
||||
def_bool $(shields_list_contains,bat43)
|
50
app/boards/shields/bat43/bat43.keymap
Normal file
50
app/boards/shields/bat43/bat43.keymap
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/bt.h>
|
||||
#include <dt-bindings/zmk/outputs.h>
|
||||
|
||||
#define LOWER 1
|
||||
#define RAISE 2
|
||||
|
||||
#define L_SPC < LOWER SPACE
|
||||
#define R_RET < RAISE RET
|
||||
|
||||
/ {
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
|
||||
default_layer {
|
||||
bindings = <
|
||||
&kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp MINUS
|
||||
&kp TAB &kp A &kp S &kp D &kp F &kp G &kp BSPC &kp H &kp J &kp K &kp L &kp SEMI &kp RSHFT
|
||||
&kp LCTRL &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL
|
||||
&kp LGUI &kp LANG2 L_SPC R_RET &kp LANG1 &kp RALT
|
||||
&bt BT_CLR &out OUT_TOG &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2
|
||||
>;
|
||||
};
|
||||
lower_layer {
|
||||
bindings = <
|
||||
&trans &none &none &none &none &none &none &kp EQUAL &kp PLUS &kp STAR &kp PRCNT &trans
|
||||
&trans &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &trans &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &trans
|
||||
&trans &none &none &none &none &none &none &none &trans &trans &trans &trans
|
||||
&trans &trans &trans &trans &trans &trans
|
||||
&trans &trans &trans &trans &trans
|
||||
>;
|
||||
};
|
||||
raise_layer {
|
||||
bindings = <
|
||||
&trans &kp BSLH &kp EXCL &kp AMPS &kp PIPE &none &none &kp EQUAL &kp PLUS &kp STAR &kp PRCNT &trans
|
||||
&trans &kp HASH &kp GRAVE &kp DQT &kp SQT &kp TILDE &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp DLLR &trans
|
||||
&trans &none &none &kp LBRC &kp LBKT &kp LPAR &kp RPAR &kp RBKT &kp RBRC &kp AT &kp CARET &trans
|
||||
&trans &trans &trans &trans &trans &trans
|
||||
&trans &trans &trans &trans &trans
|
||||
>;
|
||||
};
|
||||
};
|
||||
};
|
54
app/boards/shields/bat43/bat43.overlay
Normal file
54
app/boards/shields/bat43/bat43.overlay
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <dt-bindings/zmk/matrix_transform.h>
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
zmk,matrix_transform = &default_transform;
|
||||
};
|
||||
|
||||
default_transform: keymap_transform_0 {
|
||||
compatible = "zmk,matrix-transform";
|
||||
columns = <6>;
|
||||
rows = <7>;
|
||||
|
||||
map = <
|
||||
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5)
|
||||
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(3,0) RC(5,0) RC(5,1) RC(5,2) RC(5,3) RC(5,4) RC(5,5)
|
||||
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(6,0) RC(6,1) RC(6,2) RC(6,3) RC(6,4) RC(6,5)
|
||||
RC(3,3) RC(3,4) RC(3,5) RC(7,0) RC(7,1) RC(7,2)
|
||||
RC(7,5) RC(7,4) RC(7,3) RC(3,1) RC(3,2)
|
||||
>;
|
||||
};
|
||||
|
||||
kscan0: kscan_0 {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
label = "KSCAN";
|
||||
diode-direction = "col2row";
|
||||
|
||||
col-gpios
|
||||
= <&pro_micro 10 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 16 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 14 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 15 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 9 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 8 GPIO_ACTIVE_HIGH>
|
||||
;
|
||||
|
||||
row-gpios
|
||||
= <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
;
|
||||
};
|
||||
};
|
8
app/boards/shields/bat43/bat43.zmk.yml
Normal file
8
app/boards/shields/bat43/bat43.zmk.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
file_format: "1"
|
||||
id: bat43
|
||||
name: BAT43
|
||||
type: shield
|
||||
url: https://kbd.dailycraft.jp/bat43/
|
||||
requires: [pro_micro]
|
||||
features:
|
||||
- keys
|
|
@ -6,7 +6,7 @@ if SHIELD_BFO9000_LEFT
|
|||
config ZMK_KEYBOARD_NAME
|
||||
default "BFO-9000"
|
||||
|
||||
config ZMK_SPLIT_BLE_ROLE_CENTRAL
|
||||
config ZMK_SPLIT_ROLE_CENTRAL
|
||||
default y
|
||||
|
||||
endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include <dt-bindings/led/led.h>
|
||||
|
||||
&spi1 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
status = "okay";
|
||||
|
@ -18,6 +20,8 @@
|
|||
chain-length = <14>; /* arbitrary; change at will */
|
||||
spi-one-frame = <0x70>;
|
||||
spi-zero-frame = <0x40>;
|
||||
|
||||
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include <dt-bindings/led/led.h>
|
||||
|
||||
&spi1 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
status = "okay";
|
||||
|
@ -18,6 +20,8 @@
|
|||
chain-length = <14>; /* arbitrary; change at will */
|
||||
spi-one-frame = <0x70>;
|
||||
spi-zero-frame = <0x40>;
|
||||
|
||||
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
19
app/boards/shields/clog/Kconfig.defconfig
Normal file
19
app/boards/shields/clog/Kconfig.defconfig
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Copyright (c) 2022 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if SHIELD_CLOG_LEFT
|
||||
|
||||
config ZMK_KEYBOARD_NAME
|
||||
default "Clog"
|
||||
|
||||
config ZMK_SPLIT_ROLE_CENTRAL
|
||||
default y
|
||||
|
||||
endif
|
||||
|
||||
if SHIELD_CLOG_LEFT || SHIELD_CLOG_RIGHT
|
||||
|
||||
config ZMK_SPLIT
|
||||
default y
|
||||
|
||||
endif
|
8
app/boards/shields/clog/Kconfig.shield
Normal file
8
app/boards/shields/clog/Kconfig.shield
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Copyright (c) 2022 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config SHIELD_CLOG_LEFT
|
||||
def_bool $(shields_list_contains,clog_left)
|
||||
|
||||
config SHIELD_CLOG_RIGHT
|
||||
def_bool $(shields_list_contains,clog_right)
|
8
app/boards/shields/clog/README.md
Normal file
8
app/boards/shields/clog/README.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
# The Clog
|
||||
|
||||
The Clog is a 34-key choc v1 split board by S'mores. This firmware works for both the [Clog][clog],
|
||||
as well as the [Sephirette][sephirette], the MX version. You can purchase kits for both boards
|
||||
at smoresboards.com.
|
||||
|
||||
[clog]: https://github.com/smores56/clog
|
||||
[sephirette]: https://github.com/smores56/sephirette
|
0
app/boards/shields/clog/clog.conf
Normal file
0
app/boards/shields/clog/clog.conf
Normal file
51
app/boards/shields/clog/clog.dtsi
Normal file
51
app/boards/shields/clog/clog.dtsi
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <dt-bindings/zmk/matrix_transform.h>
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
zmk,matrix_transform = &default_transform;
|
||||
};
|
||||
|
||||
default_transform: keymap_transform_0 {
|
||||
compatible = "zmk,matrix-transform";
|
||||
columns = <34>;
|
||||
rows = <1>;
|
||||
map = <
|
||||
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,20) RC(0,19) RC(0,18) RC(0,17)
|
||||
RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,26) RC(0,25) RC(0,24) RC(0,23) RC(0,22) RC(0,21)
|
||||
RC(0,10) RC(0,11) RC(0,12) RC(0,13) RC(0,14) RC(0,31) RC(0,30) RC(0,29) RC(0,28) RC(0,27)
|
||||
RC(0,15) RC(0,16) RC(0,33) RC(0,32)
|
||||
>;
|
||||
};
|
||||
|
||||
kscan0: kscan {
|
||||
compatible = "zmk,kscan-gpio-direct";
|
||||
label = "KSCAN";
|
||||
|
||||
input-gpios
|
||||
= <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 20 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
;
|
||||
};
|
||||
};
|
113
app/boards/shields/clog/clog.keymap
Normal file
113
app/boards/shields/clog/clog.keymap
Normal file
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/bt.h>
|
||||
|
||||
#define MAIN 0
|
||||
#define SYM 1
|
||||
#define NAV 2
|
||||
#define BT 3
|
||||
|
||||
&mt {
|
||||
flavor = "tap-preferred";
|
||||
tapping_term_ms = <140>;
|
||||
};
|
||||
|
||||
/ {
|
||||
combos {
|
||||
compatible = "zmk,combos";
|
||||
|
||||
combo_esc {
|
||||
timeout-ms = <100>;
|
||||
key-positions = <21 22>;
|
||||
bindings = <&kp ESC>;
|
||||
};
|
||||
|
||||
combo_tab {
|
||||
timeout-ms = <100>;
|
||||
key-positions = <22 23>;
|
||||
bindings = <&kp TAB>;
|
||||
};
|
||||
|
||||
combo_minus {
|
||||
timeout-ms = <100>;
|
||||
key-positions = <26 27>;
|
||||
bindings = <&kp MINUS>;
|
||||
};
|
||||
|
||||
combo_underscore {
|
||||
timeout-ms = <100>;
|
||||
key-positions = <26 28>;
|
||||
bindings = <&kp UNDERSCORE>;
|
||||
};
|
||||
|
||||
combo_colon {
|
||||
timeout-ms = <100>;
|
||||
key-positions = <7 8>;
|
||||
bindings = <&kp COLON>;
|
||||
};
|
||||
|
||||
combo_semicolon {
|
||||
timeout-ms = <100>;
|
||||
key-positions = <6 8>;
|
||||
bindings = <&kp SEMICOLON>;
|
||||
};
|
||||
|
||||
combo_backslash {
|
||||
timeout-ms = <100>;
|
||||
key-positions = <27 28>;
|
||||
bindings = <&kp BSLH>;
|
||||
};
|
||||
|
||||
combo_grave {
|
||||
timeout-ms = <100>;
|
||||
key-positions = <8 9>;
|
||||
bindings = <&kp GRAVE>;
|
||||
};
|
||||
};
|
||||
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
|
||||
MAIN_layer {
|
||||
bindings = <
|
||||
&kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O
|
||||
&kp Q &kp A &kp S &kp D < SYM F &kp G &kp H < SYM J &kp K &kp L &kp SQT &kp P
|
||||
&mt LSHFT Z &mt LALT X &mt LCTRL C &mt LGUI V &kp B &kp N &mt RGUI M &mt RCTRL COMMA &mt RALT DOT &mt RSHFT FSLH
|
||||
< BT ENTER < NAV SPACE &sk RSHFT &kp BSPC
|
||||
>;
|
||||
};
|
||||
|
||||
SYM_layer {
|
||||
bindings = <
|
||||
&kp N7 &kp N8 &kp N9 &kp STAR &kp DLLR &kp LBRC &kp RBRC &kp HASH
|
||||
&kp AMPS &kp EXCL &kp N1 &kp N2 &kp N3 &kp EQUAL &kp LT &kp LPAR &kp RPAR &kp GT &kp PIPE &none
|
||||
&kp CARET &kp N4 &kp N5 &kp N6 &kp PLUS &kp TILDE &kp LBKT &kp RBKT &kp AT &kp PRCNT
|
||||
&kp DOT &kp N0 &trans &none
|
||||
>;
|
||||
};
|
||||
|
||||
NAV_layer {
|
||||
bindings = <
|
||||
&kp C_VOL_DN &kp C_VOL_UP &kp C_NEXT &kp C_PP &none &kp F7 &kp F8 &kp F9
|
||||
&kp C_PREV &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp LC(TAB) &kp PSCRN &kp F1 &kp F2 &kp F3 &kp F10 &kp F12
|
||||
&kp HOME &kp PG_DN &kp PG_UP &kp END &kp LS(LC(TAB)) &kp CAPS &kp F4 &kp F5 &kp F6 &kp F11
|
||||
&none &none &trans &kp DEL
|
||||
>;
|
||||
};
|
||||
|
||||
BT_layer {
|
||||
bindings = <
|
||||
&none &none &none &none &none &none &none &none
|
||||
&none &none &none &none &none &none &none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &none
|
||||
&none &none &none &none &none &none &bt BT_CLR &none &none &none
|
||||
&none &none &none &none
|
||||
>;
|
||||
};
|
||||
};
|
||||
};
|
11
app/boards/shields/clog/clog.zmk.yml
Normal file
11
app/boards/shields/clog/clog.zmk.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
file_format: "1"
|
||||
id: clog
|
||||
name: Clog
|
||||
type: shield
|
||||
url: https://github.com/smores56/clog
|
||||
requires: [pro_micro]
|
||||
features:
|
||||
- keys
|
||||
siblings:
|
||||
- clog_left
|
||||
- clog_right
|
7
app/boards/shields/clog/clog_left.overlay
Normal file
7
app/boards/shields/clog/clog_left.overlay
Normal file
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include "clog.dtsi"
|
11
app/boards/shields/clog/clog_right.overlay
Normal file
11
app/boards/shields/clog/clog_right.overlay
Normal file
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include "clog.dtsi"
|
||||
|
||||
&default_transform {
|
||||
col-offset = <17>;
|
||||
};
|
9
app/boards/shields/contra/Kconfig.defconfig
Normal file
9
app/boards/shields/contra/Kconfig.defconfig
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Copyright (c) 2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if SHIELD_CONTRA
|
||||
|
||||
config ZMK_KEYBOARD_NAME
|
||||
default "Contra Keyboard"
|
||||
|
||||
endif
|
5
app/boards/shields/contra/Kconfig.shield
Normal file
5
app/boards/shields/contra/Kconfig.shield
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Copyright (c) 2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config SHIELD_CONTRA
|
||||
def_bool $(shields_list_contains,contra)
|
0
app/boards/shields/contra/contra.conf
Normal file
0
app/boards/shields/contra/contra.conf
Normal file
46
app/boards/shields/contra/contra.keymap
Normal file
46
app/boards/shields/contra/contra.keymap
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/bt.h>
|
||||
|
||||
#define DEFAULT 0
|
||||
#define NUM_MODS 1
|
||||
#define BT_CTRL 2
|
||||
|
||||
/ {
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
|
||||
default_layer {
|
||||
bindings = <
|
||||
&kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC
|
||||
&kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
|
||||
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp ENTER
|
||||
&kp LCTRL &kp LGUI &kp LALT &kp BSLH &to DEFAULT &kp SPACE &trans &to NUM_MODS &kp LEFT &kp RIGHT &kp UP &kp DOWN
|
||||
>;
|
||||
};
|
||||
|
||||
num_mods {
|
||||
bindings = <
|
||||
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp DEL
|
||||
&kp TAB &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp MINUS &kp PG_UP &kp LBKT &kp RBKT &kp BSLH
|
||||
&kp LSHFT &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp EQUAL &kp PG_DN &kp HOME &kp END &kp ENTER
|
||||
&kp LCTRL &kp LGUI &kp LALT &reset &to DEFAULT &kp SPACE &trans &mo BT_CTRL &kp LEFT &kp RIGHT &kp UP &kp DOWN
|
||||
>;
|
||||
};
|
||||
|
||||
bt_control {
|
||||
bindings = <
|
||||
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans
|
||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
||||
&trans &trans &trans &trans &trans &trans &trans &trans &bt BT_PRV &bt BT_NXT &trans &trans
|
||||
>;
|
||||
};
|
||||
};
|
||||
};
|
39
app/boards/shields/contra/contra.overlay
Normal file
39
app/boards/shields/contra/contra.overlay
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
};
|
||||
|
||||
kscan0: kscan_0 {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
label = "KSCAN";
|
||||
diode-direction = "col2row";
|
||||
|
||||
col-gpios
|
||||
= <&pro_micro 21 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 20 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 9 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 8 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 7 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 6 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 5 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 4 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 3 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 2 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 0 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 1 GPIO_ACTIVE_HIGH>
|
||||
;
|
||||
|
||||
row-gpios
|
||||
= <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
, <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||
;
|
||||
};
|
||||
};
|
8
app/boards/shields/contra/contra.zmk.yml
Normal file
8
app/boards/shields/contra/contra.zmk.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
file_format: "1"
|
||||
id: contra
|
||||
name: Contra
|
||||
type: shield
|
||||
url: https://github.com/ai03-2725/Contra
|
||||
requires: [pro_micro]
|
||||
features:
|
||||
- keys
|
|
@ -3,7 +3,7 @@ if SHIELD_CORNE_LEFT
|
|||
config ZMK_KEYBOARD_NAME
|
||||
default "Corne"
|
||||
|
||||
config ZMK_SPLIT_BLE_ROLE_CENTRAL
|
||||
config ZMK_SPLIT_ROLE_CENTRAL
|
||||
default y
|
||||
|
||||
endif
|
||||
|
@ -12,7 +12,7 @@ if SHIELD_CORNE_LEFT || SHIELD_CORNE_RIGHT
|
|||
|
||||
config ZMK_SPLIT
|
||||
default y
|
||||
|
||||
|
||||
if ZMK_DISPLAY
|
||||
|
||||
config I2C
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue