From a9b949cd94e6f2f0233e6cc9f79435334798e1b0 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Mon, 6 Jul 2020 00:43:03 -0400 Subject: [PATCH] Fixes for WIP planck board definition. --- app/boards/arm/planck/Kconfig.defconfig | 34 +---- app/boards/arm/planck/keymap/keymap.overlay | 34 +++++ app/boards/arm/planck/planck_rev6.dts | 145 +++----------------- app/boards/arm/planck/planck_rev6_defconfig | 19 --- 4 files changed, 59 insertions(+), 173 deletions(-) create mode 100644 app/boards/arm/planck/keymap/keymap.overlay diff --git a/app/boards/arm/planck/Kconfig.defconfig b/app/boards/arm/planck/Kconfig.defconfig index 855cf450..2e8e3e71 100644 --- a/app/boards/arm/planck/Kconfig.defconfig +++ b/app/boards/arm/planck/Kconfig.defconfig @@ -1,39 +1,11 @@ # Planck keyboard configuration -# Copyright (c) 2017 I-SENSE group of ICCS +# Copyright (c) 2020 Peter Johanson # SPDX-License-Identifier: MIT if BOARD_PLANCK_REV6 -config BOARD - default "planck_rev6" - -config UART_1 - default y - depends on UART_CONSOLE - -if I2C - -config I2C_1 - default y - -config I2C_2 - default y - -endif # I2C - -if SPI - -config SPI_1 - default y - -config SPI_2 - default y - -endif # SPI - -config CAN_1 - default y - depends on CAN +config ZMK_KEYBOARD_NAME + default "Planck V6" endif # BOARD_PLANCK_REV6 diff --git a/app/boards/arm/planck/keymap/keymap.overlay b/app/boards/arm/planck/keymap/keymap.overlay new file mode 100644 index 00000000..f474ec92 --- /dev/null +++ b/app/boards/arm/planck/keymap/keymap.overlay @@ -0,0 +1,34 @@ +#include +#include +#include + +/ { + chosen { + zmk,keymap = &keymap0; + }; + + keymap0: keymap { + compatible = "zmk,keymap"; + label ="Default Planck Keymap"; + layers = <&default>; + }; + + layers { + compatible = "zmk,layers"; + + default: layer_0 { + label = "DEFAULT"; +// ----------------------------------------------------------------------------------------- +// | TAB | Q | W | E | R | T | Y | U | I | O | P | BSPC | +// | ESC | A | S | D | F | G | H | J | K | L | ; | ' | +// | SHIFT | Z | X | C | V | B | N | M | , | . | / | RET | +// | FN | LGUI | LALT | LCTL | LOWR | SPACE | RAIS | LARW | DARW | UARW | RARW | + bindings = < + &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp DEL + &kp ESC &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SCLN &kp QUOT + &kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp CMMA &kp DOT &kp BSLH &kp RET + &trans &kp LGUI &kp LALT &kp LCTL &trans &trans &kp SPC &trans &kp LARW &kp DARW &kp UARW &kp RARW + >; + }; + }; +}; diff --git a/app/boards/arm/planck/planck_rev6.dts b/app/boards/arm/planck/planck_rev6.dts index ae002cdd..be453419 100644 --- a/app/boards/arm/planck/planck_rev6.dts +++ b/app/boards/arm/planck/planck_rev6.dts @@ -5,142 +5,41 @@ */ /dts-v1/; -#include +#include / { model = "Plack PCD, rev6"; compatible = "planck,rev6", "st,stm32f303"; chosen { - zephyr,console = &usart1; - zephyr,shell-uart = &usart1; zephyr,sram = &sram0; zephyr,flash = &flash0; + zmk,kscan = &kscan0; }; - leds { - compatible = "gpio-leds"; - red_led_3: led_3 { - gpios = <&gpioe 9 GPIO_ACTIVE_HIGH>; - label = "User LD3"; - }; - blue_led_4: led_4 { - gpios = <&gpioe 8 GPIO_ACTIVE_HIGH>; - label = "User LD4"; - }; - orange_led_5: led_5 { - gpios = <&gpioe 10 GPIO_ACTIVE_HIGH>; - label = "User LD5"; - }; - green_led_6: led_6 { - gpios = <&gpioe 15 GPIO_ACTIVE_HIGH>; - label = "User LD6"; - }; - green_led_7: led_7 { - gpios = <&gpioe 11 GPIO_ACTIVE_HIGH>; - label = "User LD7"; - }; - orange_led_8: led_8 { - gpios = <&gpioe 14 GPIO_ACTIVE_HIGH>; - label = "User LD8"; - }; - blue_led_9: led_9 { - gpios = <&gpioe 12 GPIO_ACTIVE_HIGH>; - label = "User LD9"; - }; - red_led_10: led_10 { - gpios = <&gpioe 13 GPIO_ACTIVE_HIGH>; - label = "User LD10"; - }; - }; - - kscan { + kscan0: kscan { compatible = "zmk,kscan-gpio-matrix"; - label = "Keyscan Matrix"; - row-gpios = <&gpioa 10 GPIO_ACTIVE_HIGH>, - <&gpioa 9 GPIO_ACTIVE_HIGH>, - <&gpioa 8 GPIO_ACTIVE_HIGH>, - <&gpiob 15 GPIO_ACTIVE_HIGH>, - <&gpioc 13 GPIO_ACTIVE_HIGH>, - <&gpioc 14 GPIO_ACTIVE_HIGH>, - <&gpioc 15 GPIO_ACTIVE_HIGH>, - <&gpioa 2 GPIO_ACTIVE_HIGH>; - col-gpios = <&gpiob 11 GPIO_ACTIVE_HIGH>, - <&gpiob 10 GPIO_ACTIVE_HIGH>, - <&gpiob 2 GPIO_ACTIVE_HIGH>, - <&gpiob 1 GPIO_ACTIVE_HIGH>, - <&gpioa 7 GPIO_ACTIVE_HIGH>, - <&gpiob 0 GPIO_ACTIVE_HIGH>; + label = "KSCAN"; + row-gpios + = <&gpioa 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpioa 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpioa 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpiob 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpioc 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpioc 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpioc 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpioa 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + col-gpios + = <&gpiob 11 GPIO_ACTIVE_HIGH> + , <&gpiob 10 GPIO_ACTIVE_HIGH> + , <&gpiob 2 GPIO_ACTIVE_HIGH> + , <&gpiob 1 GPIO_ACTIVE_HIGH> + , <&gpioa 7 GPIO_ACTIVE_HIGH> + , <&gpiob 0 GPIO_ACTIVE_HIGH> + ; }; - gpio_keys { - compatible = "gpio-keys"; - user_button: button { - label = "User"; - gpios = <&gpioa 0 GPIO_ACTIVE_LOW>; - }; - }; - - aliases { - led0 = &green_led_6; - led1 = &green_led_7; - sw0 = &user_button; - can-primary = &can1; - }; -}; - -&usart1 { - current-speed = <115200>; - status = "okay"; -}; - -&usart2 { - current-speed = <115200>; - status = "okay"; -}; - -&i2c1 { - status = "okay"; - clock-frequency = ; - - lsm303dlhc-magn@1e { - compatible = "st,lsm303dlhc-magn"; - reg = <0x1e>; - label = "LSM303DLHC-MAGN"; - }; - - lsm303dlhc-accel@19 { - compatible = "st,lis2dh", "st,lsm303dlhc-accel"; - reg = <0x19>; - irq-gpios = <&gpioe 4 GPIO_ACTIVE_HIGH>, - <&gpioe 5 GPIO_ACTIVE_HIGH>; - label = "LSM303DLHC-ACCEL"; - }; -}; - -&i2c2 { - status = "okay"; - clock-frequency = ; -}; - -&spi1 { - status = "okay"; -}; - -&spi2 { - status = "okay"; -}; - -&usb { - status = "okay"; -}; - -&rtc { - status = "okay"; -}; - -&can1 { - status = "okay"; }; &flash0 { diff --git a/app/boards/arm/planck/planck_rev6_defconfig b/app/boards/arm/planck/planck_rev6_defconfig index caa93604..a440ff17 100644 --- a/app/boards/arm/planck/planck_rev6_defconfig +++ b/app/boards/arm/planck/planck_rev6_defconfig @@ -5,21 +5,6 @@ CONFIG_SOC_STM32F303XC=y # 72MHz system clock CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000 -# Floating Point Options -CONFIG_FLOAT=y - -# enable uart driver -CONFIG_SERIAL=y - -# enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -#enable I2C -CONFIG_I2C=y - -#enable SPI -CONFIG_SPI=y # enable pinmux CONFIG_PINMUX=y @@ -30,10 +15,6 @@ CONFIG_GPIO=y # clock configuration CONFIG_CLOCK_CONTROL=y -# kscan matrix -CONFIG_KSCAN=y -CONFIG_KSCAN_GPIO=y - # Clock configuration for Cube Clock control driver CONFIG_CLOCK_STM32_HSE_CLOCK=8000000 CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y