Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
M165437 committed Oct 20, 2024
0 parents commit 1ba56e3
Show file tree
Hide file tree
Showing 35 changed files with 2,904 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BasedOnStyle: LLVM
IndentWidth: 4
ColumnLimit: 100
SortIncludes: false
Binary file added .github/assets/preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Michael Schmidt-Voigt

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
73 changes: 73 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# nice-view-gem

![Preview](https://github.com/m165437/nice-view-gem/blob/main/.github/assets/preview.jpg?raw=true)

### A sleek customization for the nice!view shield

Add this shield to your keymap repo (see usage below) and run the GitHub action to build your firmware.

### Features

- Uses a **fixed range for the chart and gauge deflection**. 📈
- Includes a **beautiful animation** for the peripheral of split keyboards. 💎
- Comes with **pixel-perfect symbols** for BLE and USB connections. 📡

## Usage

To use this shield, first add it to your `config/west.yml` by adding a new entry to remotes and projects:

```yml
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
- name: m165437 #new entry
url-base: https://github.com/M165437 #new entry
projects:
- name: zmk
remote: zmkfirmware
revision: main
import: app/west.yml
- name: nice-view-gem #new entry
remote: m165437 #new entry
revision: main #new entry
self:
path: config
```
Now, simply swap out the default nice_view shield on the board for nice_view_gem in your `build.yaml` file.

```yml
---
include:
- board: nice_nano_v2
shield: kyria_left nice_view_adapter nice_view_gem #updated entry
- board: nice_nano_v2
shield: kyria_right nice_view_adapter nice_view_gem #updated entry
```

Finally, make sure to enable the custom status screen in your ZMK configuration:

```conf
CONFIG_ZMK_DISPLAY=y
CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM=y
```

## Configuration

Modify the behavior of this shield by adjusting these options in your personal configuration files. For a more detailed explanation, refer to [Configuration in the ZMK documentation](https://zmk.dev/docs/config).

| Option | Type | Description | Default |
| ------------------------------------------ | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `CONFIG_NICE_VIEW_GEM_WPM_FIXED_RANGE` | bool | This shield uses a fixed range for the chart and gauge deflection. If you set this option to `n`, it will switch to a dynamic range, like the default nice!view shield, which dynamically adjusts based on the last 10 WPM values provided by ZMK. | y |
| `CONFIG_NICE_VIEW_GEM_WPM_FIXED_RANGE_MAX` | int | You can adjust the maximum value of the fixed range to align with your current goal. | 100 |
| `CONFIG_NICE_VIEW_GEM_ANIMATION` | bool | If you find the animation distracting (or want to save on battery usage), you can turn it off by setting this option to `n`. It will instead pick a random frame of the animation every time you restart your keyboard. | y |
| `CONFIG_NICE_VIEW_GEM_ANIMATION_MS` | int | Alternatively, you can slow down the animation. A high value, such as 96000, slows the animation considerably, showing the next frame every couple of seconds. The animation consists of 16 frames, and the default value of 960 milliseconds plays it at 60 fps. | 960 |

## Credits

Shoutout to Teenage Engineering for their [TX-6](https://teenage.engineering/products/tx-6), from which the inspiration (and maybe even a few pixel strokes) originated. 😬

As for the floating crystal, appreciation goes to the pixel wizardry of Trixelized, who graciously lent their art to this project. 💎

The font, Pixel Operator, is the work of Jayvee Enaguas, kindly shared under a [Creative Commons Zero (CC0) 1.0](https://creativecommons.org/publicdomain/zero/1.0/) license. 🖋️
19 changes: 19 additions & 0 deletions boards/shields/nice_view_gem/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if(CONFIG_ZMK_DISPLAY AND CONFIG_NICE_VIEW_WIDGET_STATUS)
zephyr_library_include_directories(${CMAKE_SOURCE_DIR}/include)
zephyr_library_sources(custom_status_screen.c)
zephyr_library_sources(assets/images.c)
zephyr_library_sources(widgets/battery.c)
zephyr_library_sources(widgets/output.c)
zephyr_library_sources(widgets/util.c)

if(NOT CONFIG_ZMK_SPLIT OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
zephyr_library_sources(widgets/layer.c)
zephyr_library_sources(widgets/profile.c)
zephyr_library_sources(widgets/screen.c)
zephyr_library_sources(widgets/wpm.c)
else()
zephyr_library_sources(assets/crystal.c)
zephyr_library_sources(widgets/animation.c)
zephyr_library_sources(widgets/screen_peripheral.c)
endif()
endif()
63 changes: 63 additions & 0 deletions boards/shields/nice_view_gem/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
if SHIELD_NICE_VIEW_GEM

config LV_Z_VDB_SIZE
default 100

config LV_DPI_DEF
default 161

config LV_Z_BITS_PER_PIXEL
default 1

choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_1
endchoice

choice ZMK_DISPLAY_WORK_QUEUE
default ZMK_DISPLAY_WORK_QUEUE_DEDICATED
endchoice

choice ZMK_DISPLAY_STATUS_SCREEN
default ZMK_DISPLAY_STATUS_SCREEN_CUSTOM
endchoice

config LV_Z_MEM_POOL_SIZE
default 4096 if ZMK_DISPLAY_STATUS_SCREEN_CUSTOM

config ZMK_DISPLAY_STATUS_SCREEN_CUSTOM
imply NICE_VIEW_WIDGET_STATUS

config NICE_VIEW_GEM_WPM_FIXED_RANGE
bool "Enable fixed range for WPM gauge/chart"
default y

config NICE_VIEW_GEM_WPM_FIXED_RANGE_MAX
int "Fixed range maximum for WPM gauge/chart"
default 100

config NICE_VIEW_GEM_ANIMATION
bool "Enable animation on peripheral"
default y

config NICE_VIEW_GEM_ANIMATION_MS
int "Animation length in milliseconds"
default 960

config NICE_VIEW_WIDGET_STATUS
select LV_USE_LABEL
select LV_USE_IMG
select LV_USE_CANVAS
select LV_USE_ANIMIMG
select LV_USE_ANIMATION

config NICE_VIEW_WIDGET_INVERTED
bool "Invert display colors"

if !ZMK_SPLIT || ZMK_SPLIT_ROLE_CENTRAL

config NICE_VIEW_WIDGET_STATUS
select ZMK_WPM

endif # !ZMK_SPLIT || ZMK_SPLIT_ROLE_CENTRAL

endif # SHIELD_NICE_VIEW_GEM
2 changes: 2 additions & 0 deletions boards/shields/nice_view_gem/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config SHIELD_NICE_VIEW_GEM
def_bool $(shields_list_contains,nice_view_gem)
5 changes: 5 additions & 0 deletions boards/shields/nice_view_gem/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# A 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` labeled SPI bus is provided with _at least_ MOSI, SCK, and CS pins defined.
Loading

0 comments on commit 1ba56e3

Please sign in to comment.