aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Kconfig
blob: 5068e91fdfcf56a7e7b126719a99b933050b264b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT

mainmenu "ZMK Firmware"

menu "ZMK"

menu "Basic Keyboard Setup"

config ZMK_KEYBOARD_NAME
    string "Keyboard Name"

config USB_DEVICE_PRODUCT
    default ZMK_KEYBOARD_NAME

config BT_DEVICE_NAME
    default ZMK_KEYBOARD_NAME

config USB_DEVICE_VID
    default 0x1D50

config USB_DEVICE_PID
    default 0x615E

config USB_DEVICE_MANUFACTURER
    default "ZMK Project"

config BT_DIS_PNP_VID
    default 0x1D50

config BT_DIS_PNP_PID
    default 0x615E

config BT_DIS_MODEL
    default ZMK_KEYBOARD_NAME

config BT_DIS_MANUF
    default "ZMK Project"

# Hardware specific overrides

if SOC_SERIES_NRF52X

# Default on for our usage until boards implement retained bootmode.
config NRF_STORE_REBOOT_TYPE_GPREGRET
    bool
    default y

endif

menu "HID"

choice ZMK_HID_REPORT_TYPE
    prompt "HID Report Type"

config ZMK_HID_REPORT_TYPE_HKRO
    bool "#-Key Roll Over (HKRO) HID Report"
    help
      Enable # key roll over for HID report. This selection is "boot keyboard" compatible
      but limits the total number of possible keys to report as held to #.

config ZMK_HID_REPORT_TYPE_NKRO
    bool "Full N-Key Roll Over (NKRO) HID Report"
    help
      Enable full N-Key Roll Over for HID output. This selection will prevent the keyboard
      from working with some BIOS/UEFI versions that only support "boot keyboard" support.
      This option also prevents using some infrequently used higher range HID usages (notably F13-F24 and INTL1-9)
      These usages can be re enabled with ZMK_HID_KEYBOARD_NKRO_EXTENDED_REPORT.

endchoice

config ZMK_HID_KEYBOARD_NKRO_EXTENDED_REPORT
    bool "Enable extended NKRO reporting"
    depends on ZMK_HID_REPORT_TYPE_NKRO
    help
      Enables higher usage range for NKRO (F13-F24 and INTL1-9).
      Please note this is not compatible with Android currently and you will get no input


if ZMK_HID_REPORT_TYPE_HKRO

config ZMK_HID_KEYBOARD_REPORT_SIZE
    int "# Keyboard Keys Reportable"
    default 6

endif

config ZMK_HID_CONSUMER_REPORT_SIZE
    int "# Consumer Keys Reportable"
    default 6


choice ZMK_HID_CONSUMER_REPORT_USAGES
    prompt "HID Report Type"

config ZMK_HID_CONSUMER_REPORT_USAGES_FULL
    bool "Full Consumer HID Usage Support"
    help
      Enable full Consumer usage ID values to be sent to hosts. Allows for less
      frequently used usages, but has compatibability issues with some host OSes.

config ZMK_HID_CONSUMER_REPORT_USAGES_BASIC
    bool "Basic Consumer HID Usage Support"
    help
      Enable Consumer usage ID values up to "Playback Speed - Slow" to be sent to
      hosts. Allows for broader compatibability with more host OSes.

endchoice

config ZMK_HID_INDICATORS
    bool "HID Indicators"
    help
      Enable HID indicators, used for detecting state of Caps/Scroll/Num Lock,
      Kata, and Compose.

menu "Output Types"

config ZMK_USB
    bool "USB"
    depends on (!ZMK_SPLIT || (ZMK_SPLIT && ZMK_SPLIT_ROLE_CENTRAL))
    select USB
    select USB_DEVICE_STACK
    select USB_DEVICE_HID

config ZMK_USB_BOOT
    bool "USB Boot Protocol Support"
    depends on ZMK_USB
    select USB_HID_BOOT_PROTOCOL
    select USB_DEVICE_SOF

if ZMK_USB

config USB_NUMOF_EP_WRITE_RETRIES
    default 10

config USB_HID_POLL_INTERVAL_MS
    default 1

#ZMK_USB
endif

menuconfig ZMK_BLE
    bool "BLE (HID over GATT)"
    select BT
    select BT_SMP
    select BT_SMP_SC_PAIR_ONLY
    select BT_SMP_APP_PAIRING_ACCEPT
    select BT_PERIPHERAL
    select BT_DIS
    imply BT_SETTINGS if !ARCH_POSIX
    imply SETTINGS if !ARCH_POSIX
    imply ZMK_BATTERY_REPORTING if !ARCH_POSIX

if ZMK_BLE

config ZMK_BLE_EXPERIMENTAL_CONN
    bool "Experimental BLE connection changes"
    help
      Enables a combination of settings that are planned to be default in future versions of ZMK
      to improve connection stability. This includes changes to timing on BLE pairing initation,
      restores use of the updated/new LLCP implementation, and disables 2M PHY support.

config ZMK_BLE_EXPERIMENTAL_SEC
    bool "Experimental BLE security changes"
    imply BT_SMP_ALLOW_UNAUTH_OVERWRITE
    help
      Enables a combination of settings that are planned to be officially supported in the future.
      This includes enabling BT Secure Connection passkey entry, and allows overwrite of keys from
      previously paired hosts.

config ZMK_BLE_EXPERIMENTAL_FEATURES
    bool "Experimental BLE connection and security settings/features"
    select ZMK_BLE_EXPERIMENTAL_CONN
    select ZMK_BLE_EXPERIMENTAL_SEC
    help
      Enables experimental connection changes and security features.

config ZMK_BLE_PASSKEY_ENTRY
    bool "Require passkey entry on the keyboard to complete pairing"
    select RING_BUFFER

config BT_SMP_ALLOW_UNAUTH_OVERWRITE
    imply ZMK_BLE_PASSKEY_ENTRY

config BT_CTLR_PHY_2M
    default n if ZMK_BLE_EXPERIMENTAL_CONN

# BT_TINYCRYPT_ECC is required for BT_SMP_SC_PAIR_ONLY when using HCI
config BT_TINYCRYPT_ECC
    default y if BT_HCI && !BT_CTLR

config SYSTEM_WORKQUEUE_STACK_SIZE
    default 4096 if SOC_RP2040
    default 2048

config ZMK_BLE_THREAD_STACK_SIZE
    int "BLE notify thread stack size"
    default 768

config ZMK_BLE_THREAD_PRIORITY
    int "BLE notify thread priority"
    default 5

config ZMK_BLE_KEYBOARD_REPORT_QUEUE_SIZE
    int "Max number of keyboard HID reports to queue for sending over BLE"
    default 20

config ZMK_BLE_CONSUMER_REPORT_QUEUE_SIZE
    int "Max number of consumer HID reports to queue for sending over BLE"
    default 5

config ZMK_BLE_MOUSE_REPORT_QUEUE_SIZE
    int "Max number of mouse HID reports to queue for sending over BLE"
    default 20

config ZMK_BLE_CLEAR_BONDS_ON_START
    bool "Configuration that clears all bond information from the keyboard on startup."

# HID GATT notifications sent this way are *not* picked up by Linux, and possibly others.
config BT_GATT_NOTIFY_MULTIPLE
    default n

config BT_GATT_AUTO_SEC_REQ
    default (ZMK_SPLIT_BLE && !ZMK_SPLIT_ROLE_CENTRAL)

config BT_DEVICE_APPEARANCE
    default 961

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

#Output Types
endmenu

# HID
endmenu

rsource "src/split/Kconfig"

#Basic Keyboard Setup
endmenu

menu "Display/LED Options"

rsource "src/display/Kconfig"

menuconfig ZMK_RGB_UNDERGLOW
    bool "RGB Adressable LED Underglow"
    select LED_STRIP
    select ZMK_LOW_PRIORITY_WORK_QUEUE

if ZMK_RGB_UNDERGLOW

# This default value cuts down on tons of excess .conf files, if you're using GPIO, manually disable this
config SPI
    default y

config ZMK_RGB_UNDERGLOW_EXT_POWER
    bool "RGB underglow toggling also controls external power"
    default y

config ZMK_RGB_UNDERGLOW_BRT_MIN
    int "RGB underglow minimum brightness in percent"
    range 0 100
    default 0

config ZMK_RGB_UNDERGLOW_BRT_MAX
    int "RGB underglow maximum brightness in percent"
    range ZMK_RGB_UNDERGLOW_BRT_MIN 100
    default 100

config ZMK_RGB_UNDERGLOW_HUE_STEP
    int "RGB underglow hue step in degrees"
    range 0 359
    default 10

config ZMK_RGB_UNDERGLOW_SAT_STEP
    int "RGB underglow saturation step in percent"
    range 0 100
    default 10

config ZMK_RGB_UNDERGLOW_BRT_STEP
    int "RGB underglow brightness step in percent"
    range 0 100
    default 10

config ZMK_RGB_UNDERGLOW_HUE_START
    int "RGB underglow start hue value in degrees"
    range 0 359
    default 0

config ZMK_RGB_UNDERGLOW_SAT_START
    int "RGB underglow start saturations value in percent"
    range 0 100
    default 100

config ZMK_RGB_UNDERGLOW_BRT_START
    int "RGB underglow start brightness value in percent"
    range ZMK_RGB_UNDERGLOW_BRT_MIN ZMK_RGB_UNDERGLOW_BRT_MAX
    default ZMK_RGB_UNDERGLOW_BRT_MAX

config ZMK_RGB_UNDERGLOW_SPD_START
    int "RGB underglow start animation speed value"
    range 1 5
    default 3

config ZMK_RGB_UNDERGLOW_EFF_START
    int "RGB underglow start effect int value related to the effect enum list"
    range 0 3
    default 0

config ZMK_RGB_UNDERGLOW_ON_START
    bool "RGB underglow starts on by default"
    default y

config ZMK_RGB_UNDERGLOW_AUTO_OFF_IDLE
    bool "Turn off RGB underglow when keyboard goes into idle state"

config ZMK_RGB_UNDERGLOW_AUTO_OFF_USB
    bool "Turn off RGB underglow when USB is disconnected"
    depends on USB_DEVICE_STACK

#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

menu "Mouse Options"

config ZMK_MOUSE
    bool "Enable ZMK mouse emulation"

#Mouse Options
endmenu

menu "Power Management"

config ZMK_BATTERY_REPORTING
    bool "Battery level detection/reporting"
    select SENSOR
    select ZMK_LOW_PRIORITY_WORK_QUEUE
    imply BT_BAS if ZMK_BLE

if ZMK_BATTERY_REPORTING

choice ZMK_BATTERY_REPORTING_FETCH_MODE
    prompt "Battery Reporting Fetch Mode"

config ZMK_BATTERY_REPORTING_FETCH_MODE_STATE_OF_CHARGE
    bool "State of charge"

config ZMK_BATTERY_REPORTING_FETCH_MODE_LITHIUM_VOLTAGE
    bool "Lithium Voltage"

endchoice
endif

config ZMK_IDLE_TIMEOUT
    int "Milliseconds of inactivity before entering idle state (OLED shutoff, etc)"
    default 30000

config ZMK_SLEEP
    bool "Enable deep sleep support"
    depends on HAS_POWEROFF
    select POWEROFF
    select ZMK_PM_DEVICE_SUSPEND_RESUME
    imply USB

if ZMK_SLEEP

config PM_DEVICE
    default y

config ZMK_IDLE_SLEEP_TIMEOUT
    int "Milliseconds of inactivity before entering deep sleep"
    default 900000

#ZMK_SLEEP
endif

config ZMK_EXT_POWER
    bool "Enable support to control external power output"
    default y

config ZMK_PM
    bool

config ZMK_PM_DEVICE_SUSPEND_RESUME
    bool
    select ZMK_PM

config ZMK_PM_SOFT_OFF
    bool "Soft-off support"
    select ZMK_PM
    select PM_DEVICE
    select ZMK_PM_DEVICE_SUSPEND_RESUME

config ZMK_GPIO_KEY_WAKEUP_TRIGGER
    bool "Hardware supported wakeup (GPIO)"
    default y
    depends on DT_HAS_ZMK_GPIO_KEY_WAKEUP_TRIGGER_ENABLED && ZMK_PM_SOFT_OFF

#Power Management
endmenu

menu "Combo options"

config ZMK_COMBO_MAX_PRESSED_COMBOS
    int "Maximum number of currently pressed combos"
    default 4

config ZMK_COMBO_MAX_COMBOS_PER_KEY
    int "Maximum number of combos per key"
    default 5

config ZMK_COMBO_MAX_KEYS_PER_COMBO
    int "Maximum number of keys per combo"
    default 4

#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

rsource "Kconfig.behaviors"

config ZMK_MACRO_DEFAULT_WAIT_MS
    int "Default time to wait (in milliseconds) before triggering the next behavior in macros"
    default 15

config ZMK_MACRO_DEFAULT_TAP_MS
    int "Default time to wait (in milliseconds) between the press and release events of a tapped behavior in macros"
    default 30

endmenu

menu "Advanced"

menu "Initialization Priorities"

if USB_DEVICE_STACK

config ZMK_USB_INIT_PRIORITY
    int "USB Init Priority"
    default 50

#USB
endif

if ZMK_BLE || ZMK_SPLIT_BLE

config ZMK_BLE_INIT_PRIORITY
    int "BLE Init Priority"
    default 50

#ZMK_BLE || ZMK_SPLIT_BLE
endif

#Initialization Priorities
endmenu

menuconfig ZMK_KSCAN
    bool "ZMK KScan Integration"
    default y
    select KSCAN

if ZMK_KSCAN

config ZMK_KSCAN_EVENT_QUEUE_SIZE
    int "Size of the event queue for KSCAN events to buffer events"
    default 4

endif # ZMK_KSCAN

config ZMK_KSCAN_SIDEBAND_BEHAVIORS
    bool
    default y
    depends on DT_HAS_ZMK_KSCAN_SIDEBAND_BEHAVIORS_ENABLED
    select KSCAN

if ZMK_KSCAN_SIDEBAND_BEHAVIORS

config ZMK_KSCAN_SIDEBAND_BEHAVIORS_INIT_PRIORITY
    int "Keyboard scan sideband behaviors driver init priority"
    # The default kscan init priority is 90, so be sure we are initialized later.
    default 95

endif # ZMK_KSCAN_SIDEBAND_BEHAVIORS

menu "Logging"

config ZMK_LOGGING_MINIMAL
    bool "Suppress all ZMK debug log messages"
    default false

if !ZMK_LOGGING_MINIMAL

config ZMK_LOG_LEVEL
    default 4

endif

config ZMK_USB_LOGGING
    bool "Enable USB CDC ACM logging to help debug"
    select LOG
    select USB
    select USB_DEVICE_STACK
    select USB_CDC_ACM
    select SERIAL
    select CONSOLE
    select UART_INTERRUPT_DRIVEN
    select UART_LINE_CTRL
    select UART_CONSOLE
    select USB_UART_CONSOLE

if ZMK_USB_LOGGING

choice USB_CDC_ACM_LOG_LEVEL_CHOICE
    default USB_CDC_ACM_LOG_LEVEL_OFF
endchoice

choice USB_DRIVER_LOG_LEVEL_CHOICE
    default USB_DRIVER_LOG_LEVEL_OFF
endchoice

# We do this to avoid log loop where logging to USB generates more log messages.

config USB_CDC_ACM_RINGBUF_SIZE
    default 1024

config LOG_PROCESS_THREAD_STARTUP_DELAY_MS
    default 1000

#ZMK_USB_LOGGING
endif

config ZMK_RTT_LOGGING
    bool "Enable RTT logging to help debug"
    select LOG
    select DEBUG
    select ASSERT
    select USE_SEGGER_RTT
    select CONSOLE
    select RTT_CONSOLE

if ZMK_RTT_LOGGING

config SEGGER_RTT_BUFFER_SIZE_UP
    default 8192

#ZMK_RTT_LOGGING
endif

if ZMK_USB_LOGGING || ZMK_RTT_LOGGING

config LOG_BUFFER_SIZE
    default 8192

config LOG_PROCESS_THREAD_SLEEP_MS
    default 100

#ZMK_USB_LOGGING || ZMK_RTT_LOGGING
endif

#Logging
endmenu

if SETTINGS

config ZMK_SETTINGS_RESET_ON_START
    bool "Delete all persistent settings when the keyboard boots"

if ZMK_SETTINGS_RESET_ON_START

config ZMK_SETTINGS_RESET_ON_START_INIT_PRIORITY
    int "Settings Reset ON Start Initialization Priority"
    default 60
    help
      Initialization priority for the settings reset on start. Must be lower priority/
      higher value than FLASH_INIT_PRIORITY if using the NVS/Flash settings backend.


endif


config ZMK_SETTINGS_SAVE_DEBOUNCE
    int "Milliseconds to debounce settings saves"
    default 60000

#SETTINGS
endif

config ZMK_BATTERY_REPORT_INTERVAL
    depends on ZMK_BATTERY_REPORTING
    int "Battery level report interval in seconds"
    default 60

config ZMK_LOW_PRIORITY_WORK_QUEUE
    bool "Work queue for low priority items"

if ZMK_LOW_PRIORITY_WORK_QUEUE

config ZMK_LOW_PRIORITY_THREAD_STACK_SIZE
    int "Low priority thread stack size"
    default 768

config ZMK_LOW_PRIORITY_THREAD_PRIORITY
    int "Low priority thread priority"
    default 10

endif

#Advanced
endmenu

#ZMK
endmenu

config KERNEL_BIN_NAME
    default "zmk"

config REBOOT
    default y

config USB_DEVICE_STACK
    default y if HAS_HW_NRF_USBD

config FPU
    default CPU_HAS_FPU

config ZMK_WPM
    bool "Calculate WPM"

config ZMK_KEYMAP_SENSORS
    bool "Enable Keymap Sensors support"
    default y
    depends on DT_HAS_ZMK_KEYMAP_SENSORS_ENABLED
    select SENSOR

if ZMK_KEYMAP_SENSORS

config ZMK_KEYMAP_SENSORS_DEFAULT_TRIGGERS_PER_ROTATION
    int "Default triggers per rotation"
    help
      Unless overridden for a sensor in the board/shield/devicetree, this value
      determines how many times to trigger the bound behavior per full rotation.
      For tactile encoders with detents, this usually should match the number of
      detents per rotation of the encoder.
    default 20

endif # ZMK_KEYMAP_SENSORS

choice CBPRINTF_IMPLEMENTATION
    default CBPRINTF_NANO

endchoice

module = ZMK
module-str = zmk
source "subsys/logging/Kconfig.template.log_config"

rsource "boards/Kconfig"
rsource "boards/shields/*/Kconfig.defconfig"
rsource "boards/shields/*/Kconfig.shield"

osource "$(ZMK_CONFIG)/boards/shields/*/Kconfig.defconfig"
osource "$(ZMK_CONFIG)/boards/shields/*/Kconfig.shield"


source "Kconfig.zephyr"