Browse Source

Fixes for WIP planck board definition.

xmkb
Pete Johanson 4 years ago
parent
commit
a9b949cd94
  1. 34
      app/boards/arm/planck/Kconfig.defconfig
  2. 34
      app/boards/arm/planck/keymap/keymap.overlay
  3. 145
      app/boards/arm/planck/planck_rev6.dts
  4. 19
      app/boards/arm/planck/planck_rev6_defconfig

34
app/boards/arm/planck/Kconfig.defconfig

@ -1,39 +1,11 @@ @@ -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

34
app/boards/arm/planck/keymap/keymap.overlay

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/matrix-transform.h>
/ {
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
>;
};
};
};

145
app/boards/arm/planck/planck_rev6.dts

@ -5,142 +5,41 @@ @@ -5,142 +5,41 @@
*/
/dts-v1/;
#include <st/f3/stm32f303.dtsi>
#include <st/f3/stm32f303Xc.dtsi>
/ {
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>;
};
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 = <I2C_BITRATE_FAST>;
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 = <I2C_BITRATE_FAST>;
};
&spi1 {
status = "okay";
};
&spi2 {
status = "okay";
};
&usb {
status = "okay";
};
&rtc {
status = "okay";
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>
;
};
&can1 {
status = "okay";
};
&flash0 {

19
app/boards/arm/planck/planck_rev6_defconfig

@ -5,21 +5,6 @@ CONFIG_SOC_STM32F303XC=y @@ -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 @@ -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

Loading…
Cancel
Save