This is a TMK based keyboard firmware for nRF52 series, now support both nRF52810 and nRF52832. Firmware for nRF51822 see here.
- application: contians the bootloader and application for nrf52
- main: main program for nrf52
- src: source
- ble: bluetooth related code
- config: sdk config
- driver: driver for peripheral device
- keyboard: keyboard logic
- protocol: communication protocol
- tmk: tmk adaptor
- project
- src: source
- bootloader: bootloader for nrf52
- project
- main: main program for nrf52
- doc: documents
- keyboard: keyboard config
- SDK: directory for placing nrf SDK
- template: nrf SDK makefile template
- tmk: tmk source code
- usb: code for ch554
- Master: is not stable, may contains some critical bug.
- Develop: is not stable, including some unfinished feature, may not pass compile.
If you want to use this project in your major keyboard, please see the Release page.
- BLE/USB dual mode
- USB NKRO
- Macro support
- Dynamic keymap/macro configuration
- Battery level upload
- Mousekey and media key support
- Low power comsumption. (~200ua when all LED off in Lot60-BLE)
- Support rotary encoder and other peripheral device (see driver directory)
- Highly customable event system
Currently we support both nRF52810 and nRF52832. See keyboard directory for more information.
Firstly, you should download nRF5 SDK 17.1.0, decompress it and put it into the SDK folder. The structure of SDK folder will be SDK/components
, ...
And then, install gcc-arm-none-eabi-9-2019-q4-update
. Copy the Makefile.posix.template
or Makefile.windows.template
to Makefile.posix
or Makefile.windows
(depending your OS), then modify the toolchain path in the file to your gcc installed path.
Install SDCC to compile code for CH554. Note: This project require SDCC 4.0 to compile, older version in ubuntu 18.04 and debian 10 will not work.
If you want to compile the bootloader, you should firstly complie the uECC library. See this article.
Then,
cd keyboard/lot60-ble
make # Compile main program and the USB program
make bootloader # Compile bootloader
We also provide Docker image for you to compile, this image contains toolchain and sdk.
docker run lotlab/nrf52-keyboard
It's recommend to use DAP-Link to flashing nrf52 chip. If you want to do so, please install pyocd. If you want to generate DFU package, you should install nrfutil.
For ch554, you could use the official flasing utility in windows, or third-party usbisp in linux.
Type make help
for all flashing command.
这是一个基于nrf52蓝牙键盘的固件,使用了nRF SDK 17.1.0作为底层硬件驱动,并使用TMK键盘库作为键盘功能的上部实现。
- application/ 固件相关
- main/ 主程序
- src/ 源码
- ble/ 蓝牙相关代码
- config/ 硬件配置相关
- protocol/ 通讯相关
- driver/ 外置驱动
- tmk/ tmk桥接相关
- project/ 工程
- src/ 源码
- bootloader/
- src/ 源码
- project/ 工程
- main/ 主程序
- keyboard/ 各个键盘实现相关
- SDK/ nRF52 SDK
- tmk/ tmk core 相关
- usb/ USB部分代码
- Master 分支是不稳定的分支,可能存在一些BUG
- Develop 分支是更不稳定的分支,可能会出现无法编译通过的问题
若想要日常使用,建议使用Release版本
- 蓝牙/USB双模切换
- USB全键无冲
- 配列下载更新
- 电量上传
- 支持多媒体按键和鼠标键
- 支持按键宏
- 耗电量低至200ua(使用lot60-ble硬件在关闭所有灯光条件下测得,不代表所有条件下的状态)
- 高度自定义的事件系统
- 支持旋钮、WS2812等外设(详见drivers目录)
当前支持nrf52810和nrf52832两种主控硬件,此固件支持的键盘列表见Keyboard目录。
首先下载 nRF5 SDK 17.1.0, 解压并放入SDK文件夹。(本分支已经包含SDK,可略过此步)
然后安装 gcc-arm-none-eabi-9-2019-q4-update,将template目录中对应平台的配置文件模板复制一份,重命名为Makefile.posix
或Makefile.windows
,修改里面工具路径为你的安装目录。
然后安装 SDCC 用于编译CH554相关代码。注意:需要 SDCC 4.0 及以上版本才可编译,部分操作系统(如ubuntu 18.04, debian 10)内的 SDCC 版本无法满足要求。
我们也提供了Docker镜像方便编译,请使用
docker run lotlab/nrf52-keyboard
参见这篇文章,先编译uECC库,然后再编译Bootloader
现在蓝牙和USB控制器程序的Makefile都放在一起了。进入对应的硬件目录,直接make即可。
cd keyboard/lot60-ble
make # 编译主程序和USB控制程序
make bootloader # 编译bootloader
Windows下可直接下载我们制作的烧录工具烧录nrf52及ch554
对于nrf52,若要通过JLink直接写入,则需要安装JLink的驱动;若使用DAP-Link写入,则需要安装pyocd;若使用蓝牙DFU进行升级,则需要安装nrfutil
对于ch554,你可以使用官方的windows烧写工具,或三方的usbisp烧写。
请使用make help
查看所有的烧写和打包指令。
如果对上面的固件编译流程有问题,可参考Lotlab Wiki上的这篇文章,或查看.travis.yml
作为参考。
请参考Keyboard目录下的template移植模板,并查看doc目录下的对应说明。
如果你觉得这个工程有帮助到你,为何不请我喝一杯奶茶呢?