diff --git a/.github/workflows/build-user-config.yml b/.github/workflows/build-user-config.yml index c31b6783..215ccb63 100644 --- a/.github/workflows/build-user-config.yml +++ b/.github/workflows/build-user-config.yml @@ -61,7 +61,7 @@ jobs: set -x if [ -n "${{ matrix.shield }}" ] then - EXTRA_CMAKE_ARGS="-DSHIELD=${{ matrix.shield }}" + EXTRA_CMAKE_ARGS="-DSHIELD=\"${{ matrix.shield }}\"" ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk" DISPLAY_NAME="${{ matrix.shield }} - ${{ matrix.board }}" else diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e945cde..16373673 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,7 +71,7 @@ jobs: 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'] || ''}`); + 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()); @@ -246,6 +246,9 @@ jobs: return hm.requires.flatMap(i => metadata.interconnects[i].boards.flatMap(b => boardAndShield(b, hm)) ); + } else { + console.warn("Unhandled shield without keys"); + return []; } break; case "interconnect": diff --git a/app/boards/shields/nice_view/Kconfig.defconfig b/app/boards/shields/nice_view/Kconfig.defconfig new file mode 100644 index 00000000..622c7498 --- /dev/null +++ b/app/boards/shields/nice_view/Kconfig.defconfig @@ -0,0 +1,22 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_NICE_VIEW + +config ZMK_DISPLAY + select LVGL_FONT_MONTSERRAT_26 + +if ZMK_DISPLAY + +config SPI + default y + +config LS0XX + default y + +config ZMK_WIDGET_WPM_STATUS + default y if !ZMK_SPLIT || ZMK_SPLIT_ROLE_CENTRAL + +endif # ZMK_DISPLAY + +endif diff --git a/app/boards/shields/nice_view/Kconfig.shield b/app/boards/shields/nice_view/Kconfig.shield new file mode 100644 index 00000000..55cba788 --- /dev/null +++ b/app/boards/shields/nice_view/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_NICE_VIEW + def_bool $(shields_list_contains,nice_view) diff --git a/app/boards/shields/nice_view/README.md b/app/boards/shields/nice_view/README.md new file mode 100644 index 00000000..0b4ac21f --- /dev/null +++ b/app/boards/shields/nice_view/README.md @@ -0,0 +1,5 @@ +# nice!view + +The nice!view is a low power, high refresh rate display meant to replace I2C OLEDs traditionally used. + +This shield requires that an `&nice_view_spi` labelled SPI bus is provided with *at least* MOSI, SCK, and CS pins defined. diff --git a/app/boards/shields/nice_view/nice_view.conf b/app/boards/shields/nice_view/nice_view.conf new file mode 100644 index 00000000..368e848a --- /dev/null +++ b/app/boards/shields/nice_view/nice_view.conf @@ -0,0 +1,4 @@ +# Enable nice!view +CONFIG_ZMK_DISPLAY=y +CONFIG_LVGL_THEME_DEFAULT_FONT_SMALL_MONTSERRAT_26=y +CONFIG_LVGL_THEME_DEFAULT_FONT_NORMAL_MONTSERRAT_26=y diff --git a/app/boards/shields/nice_view/nice_view.overlay b/app/boards/shields/nice_view/nice_view.overlay new file mode 100644 index 00000000..eacdd41a --- /dev/null +++ b/app/boards/shields/nice_view/nice_view.overlay @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +&nice_view_spi { + status = "okay"; + nice_view: ls0xx@0 { + compatible = "sharp,ls0xx"; + label = "DISPLAY"; + spi-max-frequency = <1000000>; + reg = <0>; + width = <160>; + height = <68>; + }; +}; + +/ { + chosen { + zephyr,display = &nice_view; + }; +}; diff --git a/app/boards/shields/nice_view/nice_view.zmk.yml b/app/boards/shields/nice_view/nice_view.zmk.yml new file mode 100644 index 00000000..04b98a8a --- /dev/null +++ b/app/boards/shields/nice_view/nice_view.zmk.yml @@ -0,0 +1,8 @@ +file_format: "1" +id: nice_view +name: nice!view +type: shield +url: https://nicekeyboards.com/nice-view +requires: [nice_view_header] +features: + - display diff --git a/app/boards/shields/nice_view_adapter/Kconfig.defconfig b/app/boards/shields/nice_view_adapter/Kconfig.defconfig new file mode 100644 index 00000000..fb23f20c --- /dev/null +++ b/app/boards/shields/nice_view_adapter/Kconfig.defconfig @@ -0,0 +1,2 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT diff --git a/app/boards/shields/nice_view_adapter/Kconfig.shield b/app/boards/shields/nice_view_adapter/Kconfig.shield new file mode 100644 index 00000000..bf9ba7cb --- /dev/null +++ b/app/boards/shields/nice_view_adapter/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_NICE_VIEW_ADAPTER + def_bool $(shields_list_contains,nice_view_adapter) diff --git a/app/boards/shields/nice_view_adapter/README.md b/app/boards/shields/nice_view_adapter/README.md new file mode 100644 index 00000000..ec4665a3 --- /dev/null +++ b/app/boards/shields/nice_view_adapter/README.md @@ -0,0 +1,11 @@ +# nice!view Adapter + +This shield is used as an adapter between the nice!view and existing shields/boards that expose an I2C OLED header. + +To use this shield, you should add this shield to your list of shields *before* `nice_view`. + +The nice!view will use the SDA/SCL pins of the OLED, and then the adapter expects a final pin to be "bodged" from your microcontroller to the nice!view CS pin. This adapter assumes that the CS pin bodged is the `&pro_micro 1` pin or "D1", which is the top left pin when looking at the front of the board. If you can't use this pin, you'll need to override the `cs-gpios` for the `&nice_view_spi` bus (in your `zmk-config` keymap for example) or you will want to define your own `&nice_view_spi` bus without using this adapter. + +``` +west build -b nice_nano_v2 -- -DSHIELD="lily58_left nice_view_adapter nice_view" +``` diff --git a/app/boards/shields/nice_view_adapter/boards/bluemicro840_v1.overlay b/app/boards/shields/nice_view_adapter/boards/bluemicro840_v1.overlay new file mode 100644 index 00000000..9d9ab734 --- /dev/null +++ b/app/boards/shields/nice_view_adapter/boards/bluemicro840_v1.overlay @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +nice_view_spi: &spi0 { + compatible = "nordic,nrf-spim"; + sck-pin = <17>; + mosi-pin = <15>; + miso-pin = <25>; + cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; +}; + +&pro_micro_i2c { + status = "disabled"; +}; diff --git a/app/boards/shields/nice_view_adapter/boards/mikoto_520.overlay b/app/boards/shields/nice_view_adapter/boards/mikoto_520.overlay new file mode 100644 index 00000000..9f6fad1c --- /dev/null +++ b/app/boards/shields/nice_view_adapter/boards/mikoto_520.overlay @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +nice_view_spi: &spi0 { + compatible = "nordic,nrf-spim"; + sck-pin = <20>; + mosi-pin = <17>; + miso-pin = <5>; + cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; +}; + +&pro_micro_i2c { + status = "disabled"; +}; diff --git a/app/boards/shields/nice_view_adapter/boards/nice_nano.overlay b/app/boards/shields/nice_view_adapter/boards/nice_nano.overlay new file mode 100644 index 00000000..3a0ad462 --- /dev/null +++ b/app/boards/shields/nice_view_adapter/boards/nice_nano.overlay @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +nice_view_spi: &spi0 { + compatible = "nordic,nrf-spim"; + sck-pin = <20>; + mosi-pin = <17>; + miso-pin = <25>; + cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; +}; + +&pro_micro_i2c { + status = "disabled"; +}; diff --git a/app/boards/shields/nice_view_adapter/boards/nice_nano_v2.overlay b/app/boards/shields/nice_view_adapter/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..3a0ad462 --- /dev/null +++ b/app/boards/shields/nice_view_adapter/boards/nice_nano_v2.overlay @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +nice_view_spi: &spi0 { + compatible = "nordic,nrf-spim"; + sck-pin = <20>; + mosi-pin = <17>; + miso-pin = <25>; + cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; +}; + +&pro_micro_i2c { + status = "disabled"; +}; diff --git a/app/boards/shields/nice_view_adapter/boards/nrfmicro_11.overlay b/app/boards/shields/nice_view_adapter/boards/nrfmicro_11.overlay new file mode 100644 index 00000000..9d9ab734 --- /dev/null +++ b/app/boards/shields/nice_view_adapter/boards/nrfmicro_11.overlay @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +nice_view_spi: &spi0 { + compatible = "nordic,nrf-spim"; + sck-pin = <17>; + mosi-pin = <15>; + miso-pin = <25>; + cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; +}; + +&pro_micro_i2c { + status = "disabled"; +}; diff --git a/app/boards/shields/nice_view_adapter/boards/nrfmicro_11_flipped.overlay b/app/boards/shields/nice_view_adapter/boards/nrfmicro_11_flipped.overlay new file mode 100644 index 00000000..7b12c252 --- /dev/null +++ b/app/boards/shields/nice_view_adapter/boards/nrfmicro_11_flipped.overlay @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +nice_view_spi: &spi0 { + compatible = "nordic,nrf-spim"; + sck-pin = <31>; + mosi-pin = <30>; + miso-pin = <25>; + cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; +}; + +&pro_micro_i2c { + status = "disabled"; +}; diff --git a/app/boards/shields/nice_view_adapter/boards/nrfmicro_13.overlay b/app/boards/shields/nice_view_adapter/boards/nrfmicro_13.overlay new file mode 100644 index 00000000..9d9ab734 --- /dev/null +++ b/app/boards/shields/nice_view_adapter/boards/nrfmicro_13.overlay @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +nice_view_spi: &spi0 { + compatible = "nordic,nrf-spim"; + sck-pin = <17>; + mosi-pin = <15>; + miso-pin = <25>; + cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; +}; + +&pro_micro_i2c { + status = "disabled"; +}; diff --git a/app/boards/shields/nice_view_adapter/boards/puchi_ble_v1.overlay b/app/boards/shields/nice_view_adapter/boards/puchi_ble_v1.overlay new file mode 100644 index 00000000..9d9ab734 --- /dev/null +++ b/app/boards/shields/nice_view_adapter/boards/puchi_ble_v1.overlay @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +nice_view_spi: &spi0 { + compatible = "nordic,nrf-spim"; + sck-pin = <17>; + mosi-pin = <15>; + miso-pin = <25>; + cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; +}; + +&pro_micro_i2c { + status = "disabled"; +}; diff --git a/app/boards/shields/nice_view_adapter/nice_view_adapter.conf b/app/boards/shields/nice_view_adapter/nice_view_adapter.conf new file mode 100644 index 00000000..c5fe224e --- /dev/null +++ b/app/boards/shields/nice_view_adapter/nice_view_adapter.conf @@ -0,0 +1,2 @@ +# Disable OLED +CONFIG_SSD1306=n diff --git a/app/boards/shields/nice_view_adapter/nice_view_adapter.overlay b/app/boards/shields/nice_view_adapter/nice_view_adapter.overlay new file mode 100644 index 00000000..2b82df5c --- /dev/null +++ b/app/boards/shields/nice_view_adapter/nice_view_adapter.overlay @@ -0,0 +1,5 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ diff --git a/app/boards/shields/nice_view_adapter/nice_view_adapter.zmk.yml b/app/boards/shields/nice_view_adapter/nice_view_adapter.zmk.yml new file mode 100644 index 00000000..e63b01e5 --- /dev/null +++ b/app/boards/shields/nice_view_adapter/nice_view_adapter.zmk.yml @@ -0,0 +1,7 @@ +file_format: "1" +id: nice_view_adapter +name: nice!view adapter +type: shield +url: https://nicekeyboards.com/nice-view +requires: [i2c_oled] +exposes: [nice_view_header] diff --git a/app/core-coverage.yml b/app/core-coverage.yml index 90470ba3..12c03613 100644 --- a/app/core-coverage.yml +++ b/app/core-coverage.yml @@ -30,3 +30,6 @@ include: shield: romac_plus cmake-args: "-DCONFIG_ZMK_RGB_UNDERGLOW=y -DCONFIG_WS2812_STRIP=y" nickname: "underglow" +- board: nice_nano_v2 + shield: lily58_left nice_view_adapter nice_view + nickname: "niceview" diff --git a/docs/docs/hardware.mdx b/docs/docs/hardware.mdx index d2b6aa9d..6f377073 100644 --- a/docs/docs/hardware.mdx +++ b/docs/docs/hardware.mdx @@ -21,13 +21,13 @@ export const toc = [ id: "composite", level: 2, }, - ...Object.values(groupedMetadata(Metadata).interconnects).map( - ({ interconnect }) => ({ + ...Object.values(groupedMetadata(Metadata).interconnects) + .filter((ic) => ic.interconnect !== undefined) + .map(({ interconnect }) => ({ value: `${interconnect.name} Interconnect`, id: interconnect.id, level: 3, - }) - ), + })), { value: "Other Hardware", id: "other-hardware", diff --git a/docs/src/components/hardware-utils.ts b/docs/src/components/hardware-utils.ts index 13ca5eb6..76452dc3 100644 --- a/docs/src/components/hardware-utils.ts +++ b/docs/src/components/hardware-utils.ts @@ -41,7 +41,11 @@ function groupedShield(agg: GroupedMetadata, shield: Shield) { ic.shields.push(shield); agg.interconnects[id] = ic; }); - + shield.exposes?.forEach((id) => { + let ic = agg.interconnects[id] ?? { boards: [], shields: [] }; + ic.shields.push(shield); + agg.interconnects[id] = ic; + }); return agg; }