Browse Source

Finish DZ60RGB board definition

xmkb
Nick 4 years ago
parent
commit
6b433fdefd
  1. 2
      app/boards/arm/dz60rgb/CMakeLists.txt
  2. 3
      app/boards/arm/dz60rgb/board.cmake
  3. 5
      app/boards/arm/dz60rgb/dz60rgb_rev1.dts
  4. 16
      app/boards/arm/dz60rgb/dz60rgb_rev1.keymap
  5. 3
      app/boards/arm/dz60rgb/dz60rgb_rev1_defconfig
  6. 28
      app/boards/arm/dz60rgb/pinmux.c

2
app/boards/arm/dz60rgb/CMakeLists.txt

@ -1,7 +1,5 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
list(APPEND EXTRA_DTC_FLAGS "-qq")
if(CONFIG_PINMUX) if(CONFIG_PINMUX)
zephyr_library() zephyr_library()
zephyr_library_sources(pinmux.c) zephyr_library_sources(pinmux.c)

3
app/boards/arm/dz60rgb/board.cmake

@ -1,6 +1,7 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
board_runner_args(jlink "--device=STM32F303VC" "--speed=4000") board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse")
board_runner_args(jlink "--device=STM32F303CC" "--speed=4000")
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

5
app/boards/arm/dz60rgb/dz60rgb_rev1.dts

@ -17,6 +17,7 @@
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zmk,kscan = &kscan0; zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
}; };
default_transform: keymap_transform_0 { default_transform: keymap_transform_0 {
@ -28,7 +29,7 @@ RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13) RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,13) RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,13)
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,13) RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,13)
RC(4,0) RC(4,1) RC(4,2) RC(4,5) RC(4,9) RC(4,10) RC(4,11) RC(4,12) RC(4,13) RC(4,0) RC(4,1) RC(4,2) RC(4,5) RC(4,8) RC(4,9) RC(4,10) RC(4,11) RC(4,13)
>; >;
}; };
@ -55,7 +56,7 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) RC(4
, <&gpiob 3 GPIO_ACTIVE_HIGH> , <&gpiob 3 GPIO_ACTIVE_HIGH>
, <&gpiob 4 GPIO_ACTIVE_HIGH> , <&gpiob 4 GPIO_ACTIVE_HIGH>
, <&gpiob 5 GPIO_ACTIVE_HIGH> , <&gpiob 5 GPIO_ACTIVE_HIGH>
, <&gpiob 6 GPIO_ACTIVE_HIGH> , <&gpiob 8 GPIO_ACTIVE_HIGH>
, <&gpiob 9 GPIO_ACTIVE_HIGH> , <&gpiob 9 GPIO_ACTIVE_HIGH>
, <&gpioc 13 GPIO_ACTIVE_HIGH> , <&gpioc 13 GPIO_ACTIVE_HIGH>
, <&gpioc 14 GPIO_ACTIVE_HIGH> , <&gpioc 14 GPIO_ACTIVE_HIGH>

16
app/boards/arm/dz60rgb/keymap/keymap.overlay → app/boards/arm/dz60rgb/dz60rgb_rev1.keymap

@ -1,23 +1,11 @@
#include <behaviors.dtsi> #include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/matrix-transform.h>
/ { / {
chosen { keymap {
zmk,keymap = &keymap0;
};
keymap0: keymap {
compatible = "zmk,keymap"; compatible = "zmk,keymap";
label ="Default DZ60RGB Keymap";
layers = <&default>;
};
layers {
compatible = "zmk,layers";
default: layer_0 { default_layer {
label = "DEFAULT";
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | // | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | "|" | // | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | "|" |

3
app/boards/arm/dz60rgb/dz60rgb_rev1_defconfig

@ -19,9 +19,6 @@ CONFIG_CLOCK_STM32_HSE_CLOCK=8000000
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# use HSE as PLL input # use HSE as PLL input
CONFIG_CLOCK_STM32_PLL_SRC_HSE=y CONFIG_CLOCK_STM32_PLL_SRC_HSE=y
# however, the board does not have an external oscillator, so just use
# the 8MHz clock signal coming from integrated STLink
CONFIG_CLOCK_STM32_HSE_BYPASS=y
# produce 72MHz clock at PLL output # produce 72MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_PREDIV=1 CONFIG_CLOCK_STM32_PLL_PREDIV=1
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9 CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9

28
app/boards/arm/dz60rgb/pinmux.c

@ -14,46 +14,46 @@
/* pin assignments for STM32F3DISCOVERY board */ /* pin assignments for STM32F3DISCOVERY board */
static const struct pin_config pinconf[] = { static const struct pin_config pinconf[] = {
#ifdef CONFIG_UART_1 #if DT_NODE_HAS_STATUS(DT_NODELABEL(usart1), okay) && CONFIG_SERIAL
{STM32_PIN_PC4, STM32F3_PINMUX_FUNC_PC4_USART1_TX}, {STM32_PIN_PC4, STM32F3_PINMUX_FUNC_PC4_USART1_TX},
{STM32_PIN_PC5, STM32F3_PINMUX_FUNC_PC5_USART1_RX}, {STM32_PIN_PC5, STM32F3_PINMUX_FUNC_PC5_USART1_RX},
#endif /* CONFIG_UART_1 */ #endif
#ifdef CONFIG_UART_2 #if DT_NODE_HAS_STATUS(DT_NODELABEL(usart2), okay) && CONFIG_SERIAL
{STM32_PIN_PA2, STM32F3_PINMUX_FUNC_PA2_USART2_TX}, {STM32_PIN_PA2, STM32F3_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F3_PINMUX_FUNC_PA3_USART2_RX}, {STM32_PIN_PA3, STM32F3_PINMUX_FUNC_PA3_USART2_RX},
#endif /* CONFIG_UART_2 */ #endif
#ifdef CONFIG_I2C_1 #if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C
{STM32_PIN_PB6, STM32F3_PINMUX_FUNC_PB6_I2C1_SCL}, {STM32_PIN_PB6, STM32F3_PINMUX_FUNC_PB6_I2C1_SCL},
{STM32_PIN_PB7, STM32F3_PINMUX_FUNC_PB7_I2C1_SDA}, {STM32_PIN_PB7, STM32F3_PINMUX_FUNC_PB7_I2C1_SDA},
#endif /* CONFIG_I2C_1 */ #endif
#ifdef CONFIG_I2C_2 #if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C
{STM32_PIN_PA9, STM32F3_PINMUX_FUNC_PA9_I2C2_SCL}, {STM32_PIN_PA9, STM32F3_PINMUX_FUNC_PA9_I2C2_SCL},
{STM32_PIN_PA10, STM32F3_PINMUX_FUNC_PA10_I2C2_SDA}, {STM32_PIN_PA10, STM32F3_PINMUX_FUNC_PA10_I2C2_SDA},
#endif /* CONFIG_I2C_2 */ #endif
#ifdef CONFIG_SPI_1 #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS}, {STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS},
#endif /* CONFIG_SPI_STM32_USE_HW_SS */ #endif /* CONFIG_SPI_STM32_USE_HW_SS */
{STM32_PIN_PA5, STM32F3_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PA5, STM32F3_PINMUX_FUNC_PA5_SPI1_SCK},
{STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO}, {STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO},
{STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI}, {STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI},
#endif /* CONFIG_SPI_1 */ #endif
#ifdef CONFIG_SPI_2 #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{STM32_PIN_PB12, STM32F3_PINMUX_FUNC_PB12_SPI2_NSS}, {STM32_PIN_PB12, STM32F3_PINMUX_FUNC_PB12_SPI2_NSS},
#endif /* CONFIG_SPI_STM32_USE_HW_SS */ #endif /* CONFIG_SPI_STM32_USE_HW_SS */
{STM32_PIN_PB13, STM32F3_PINMUX_FUNC_PB13_SPI2_SCK}, {STM32_PIN_PB13, STM32F3_PINMUX_FUNC_PB13_SPI2_SCK},
{STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO}, {STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO},
{STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI}, {STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI},
#endif /* CONFIG_SPI_2 */ #endif
#ifdef CONFIG_USB_DC_STM32 #ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F3_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA11, STM32F3_PINMUX_FUNC_PA11_USB_DM},
{STM32_PIN_PA12, STM32F3_PINMUX_FUNC_PA12_USB_DP}, {STM32_PIN_PA12, STM32F3_PINMUX_FUNC_PA12_USB_DP},
#endif /* CONFIG_USB_DC_STM32 */ #endif /* CONFIG_USB_DC_STM32 */
#ifdef CONFIG_CAN_1 #if DT_NODE_HAS_STATUS(DT_NODELABEL(can1), okay) && CONFIG_CAN
{STM32_PIN_PD0, STM32F3_PINMUX_FUNC_PD0_CAN1_RX}, {STM32_PIN_PD0, STM32F3_PINMUX_FUNC_PD0_CAN1_RX},
{STM32_PIN_PD1, STM32F3_PINMUX_FUNC_PD1_CAN1_TX}, {STM32_PIN_PD1, STM32F3_PINMUX_FUNC_PD1_CAN1_TX},
#endif /* CONFIG_CAN_1 */ #endif
}; };
static int pinmux_stm32_init(struct device *port) static int pinmux_stm32_init(struct device *port)

Loading…
Cancel
Save