Merge branch 'zmkfirmware:main' into xo-status-fx
This commit is contained in:
commit
f851651b35
35 changed files with 702 additions and 95 deletions
2
.github/workflows/build-user-config.yml
vendored
2
.github/workflows/build-user-config.yml
vendored
|
@ -61,7 +61,7 @@ jobs:
|
||||||
set -x
|
set -x
|
||||||
if [ -n "${{ matrix.shield }}" ]
|
if [ -n "${{ matrix.shield }}" ]
|
||||||
then
|
then
|
||||||
EXTRA_CMAKE_ARGS="-DSHIELD=${{ matrix.shield }}"
|
EXTRA_CMAKE_ARGS="-DSHIELD=\"${{ matrix.shield }}\""
|
||||||
ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk"
|
ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk"
|
||||||
DISPLAY_NAME="${{ matrix.shield }} - ${{ matrix.board }}"
|
DISPLAY_NAME="${{ matrix.shield }} - ${{ matrix.board }}"
|
||||||
else
|
else
|
||||||
|
|
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
|
@ -35,11 +35,11 @@ jobs:
|
||||||
tools/
|
tools/
|
||||||
zephyr/
|
zephyr/
|
||||||
bootloader/
|
bootloader/
|
||||||
key: 4-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }}
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
4-${{ runner.os }}-build-${{ env.cache-name }}-
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||||
4-${{ runner.os }}-build-
|
${{ runner.os }}-build-
|
||||||
4-${{ runner.os }}-
|
${{ runner.os }}-
|
||||||
timeout-minutes: 2
|
timeout-minutes: 2
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Initialize workspace (west init)
|
- name: Initialize workspace (west init)
|
||||||
|
@ -71,7 +71,7 @@ jobs:
|
||||||
|
|
||||||
for (const shieldArgs of buildShieldArgs) {
|
for (const shieldArgs of buildShieldArgs) {
|
||||||
try {
|
try {
|
||||||
const output = execSync(`west build -s app -p -b ${{ matrix.board }} -- ${shieldArgs.shield ? '-DSHIELD=' + shieldArgs.shield : ''} ${shieldArgs['cmake-args'] || ''}`);
|
const output = execSync(`west build -s app -p -b ${{ matrix.board }} -- ${shieldArgs.shield ? '-DSHIELD="' + shieldArgs.shield + '"' : ''} ${shieldArgs['cmake-args'] || ''}`);
|
||||||
|
|
||||||
console.log(`::group::${{ matrix.board}} ${shieldArgs.shield} Build`)
|
console.log(`::group::${{ matrix.board}} ${shieldArgs.shield} Build`)
|
||||||
console.log(output.toString());
|
console.log(output.toString());
|
||||||
|
@ -246,6 +246,9 @@ jobs:
|
||||||
return hm.requires.flatMap(i =>
|
return hm.requires.flatMap(i =>
|
||||||
metadata.interconnects[i].boards.flatMap(b => boardAndShield(b, hm))
|
metadata.interconnects[i].boards.flatMap(b => boardAndShield(b, hm))
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
console.warn("Unhandled shield without keys");
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "interconnect":
|
case "interconnect":
|
||||||
|
|
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
|
@ -47,11 +47,11 @@ jobs:
|
||||||
tools/
|
tools/
|
||||||
zephyr/
|
zephyr/
|
||||||
bootloader/
|
bootloader/
|
||||||
key: 4-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }}
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
4-${{ runner.os }}-build-${{ env.cache-name }}-
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||||
4-${{ runner.os }}-build-
|
${{ runner.os }}-build-
|
||||||
4-${{ runner.os }}-
|
${{ runner.os }}-
|
||||||
timeout-minutes: 2
|
timeout-minutes: 2
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Initialize workspace (west init)
|
- name: Initialize workspace (west init)
|
||||||
|
|
22
app/boards/shields/nice_view/Kconfig.defconfig
Normal file
22
app/boards/shields/nice_view/Kconfig.defconfig
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# Copyright (c) 2022 The ZMK Contributors
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
if SHIELD_NICE_VIEW
|
||||||
|
|
||||||
|
config ZMK_DISPLAY
|
||||||
|
select LVGL_FONT_MONTSERRAT_26
|
||||||
|
|
||||||
|
if ZMK_DISPLAY
|
||||||
|
|
||||||
|
config SPI
|
||||||
|
default y
|
||||||
|
|
||||||
|
config LS0XX
|
||||||
|
default y
|
||||||
|
|
||||||
|
config ZMK_WIDGET_WPM_STATUS
|
||||||
|
default y if !ZMK_SPLIT || ZMK_SPLIT_ROLE_CENTRAL
|
||||||
|
|
||||||
|
endif # ZMK_DISPLAY
|
||||||
|
|
||||||
|
endif
|
5
app/boards/shields/nice_view/Kconfig.shield
Normal file
5
app/boards/shields/nice_view/Kconfig.shield
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Copyright (c) 2022 The ZMK Contributors
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
config SHIELD_NICE_VIEW
|
||||||
|
def_bool $(shields_list_contains,nice_view)
|
5
app/boards/shields/nice_view/README.md
Normal file
5
app/boards/shields/nice_view/README.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# 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` labelled SPI bus is provided with *at least* MOSI, SCK, and CS pins defined.
|
4
app/boards/shields/nice_view/nice_view.conf
Normal file
4
app/boards/shields/nice_view/nice_view.conf
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Enable nice!view
|
||||||
|
CONFIG_ZMK_DISPLAY=y
|
||||||
|
CONFIG_LVGL_THEME_DEFAULT_FONT_SMALL_MONTSERRAT_26=y
|
||||||
|
CONFIG_LVGL_THEME_DEFAULT_FONT_NORMAL_MONTSERRAT_26=y
|
23
app/boards/shields/nice_view/nice_view.overlay
Normal file
23
app/boards/shields/nice_view/nice_view.overlay
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
&nice_view_spi {
|
||||||
|
status = "okay";
|
||||||
|
nice_view: ls0xx@0 {
|
||||||
|
compatible = "sharp,ls0xx";
|
||||||
|
label = "DISPLAY";
|
||||||
|
spi-max-frequency = <1000000>;
|
||||||
|
reg = <0>;
|
||||||
|
width = <160>;
|
||||||
|
height = <68>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/ {
|
||||||
|
chosen {
|
||||||
|
zephyr,display = &nice_view;
|
||||||
|
};
|
||||||
|
};
|
8
app/boards/shields/nice_view/nice_view.zmk.yml
Normal file
8
app/boards/shields/nice_view/nice_view.zmk.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
file_format: "1"
|
||||||
|
id: nice_view
|
||||||
|
name: nice!view
|
||||||
|
type: shield
|
||||||
|
url: https://nicekeyboards.com/nice-view
|
||||||
|
requires: [nice_view_header]
|
||||||
|
features:
|
||||||
|
- display
|
2
app/boards/shields/nice_view_adapter/Kconfig.defconfig
Normal file
2
app/boards/shields/nice_view_adapter/Kconfig.defconfig
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Copyright (c) 2022 The ZMK Contributors
|
||||||
|
# SPDX-License-Identifier: MIT
|
5
app/boards/shields/nice_view_adapter/Kconfig.shield
Normal file
5
app/boards/shields/nice_view_adapter/Kconfig.shield
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Copyright (c) 2022 The ZMK Contributors
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
config SHIELD_NICE_VIEW_ADAPTER
|
||||||
|
def_bool $(shields_list_contains,nice_view_adapter)
|
11
app/boards/shields/nice_view_adapter/README.md
Normal file
11
app/boards/shields/nice_view_adapter/README.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# nice!view Adapter
|
||||||
|
|
||||||
|
This shield is used as an adapter between the nice!view and existing shields/boards that expose an I2C OLED header.
|
||||||
|
|
||||||
|
To use this shield, you should add this shield to your list of shields *before* `nice_view`.
|
||||||
|
|
||||||
|
The nice!view will use the SDA/SCL pins of the OLED, and then the adapter expects a final pin to be "bodged" from your microcontroller to the nice!view CS pin. This adapter assumes that the CS pin bodged is the `&pro_micro 1` pin or "D1", which is the top left pin when looking at the front of the board. If you can't use this pin, you'll need to override the `cs-gpios` for the `&nice_view_spi` bus (in your `zmk-config` keymap for example) or you will want to define your own `&nice_view_spi` bus without using this adapter.
|
||||||
|
|
||||||
|
```
|
||||||
|
west build -b nice_nano_v2 -- -DSHIELD="lily58_left nice_view_adapter nice_view"
|
||||||
|
```
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
nice_view_spi: &spi0 {
|
||||||
|
compatible = "nordic,nrf-spim";
|
||||||
|
sck-pin = <17>;
|
||||||
|
mosi-pin = <15>;
|
||||||
|
miso-pin = <25>;
|
||||||
|
cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&pro_micro_i2c {
|
||||||
|
status = "disabled";
|
||||||
|
};
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
nice_view_spi: &spi0 {
|
||||||
|
compatible = "nordic,nrf-spim";
|
||||||
|
sck-pin = <20>;
|
||||||
|
mosi-pin = <17>;
|
||||||
|
miso-pin = <5>;
|
||||||
|
cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&pro_micro_i2c {
|
||||||
|
status = "disabled";
|
||||||
|
};
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
nice_view_spi: &spi0 {
|
||||||
|
compatible = "nordic,nrf-spim";
|
||||||
|
sck-pin = <20>;
|
||||||
|
mosi-pin = <17>;
|
||||||
|
miso-pin = <25>;
|
||||||
|
cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&pro_micro_i2c {
|
||||||
|
status = "disabled";
|
||||||
|
};
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
nice_view_spi: &spi0 {
|
||||||
|
compatible = "nordic,nrf-spim";
|
||||||
|
sck-pin = <20>;
|
||||||
|
mosi-pin = <17>;
|
||||||
|
miso-pin = <25>;
|
||||||
|
cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&pro_micro_i2c {
|
||||||
|
status = "disabled";
|
||||||
|
};
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
nice_view_spi: &spi0 {
|
||||||
|
compatible = "nordic,nrf-spim";
|
||||||
|
sck-pin = <17>;
|
||||||
|
mosi-pin = <15>;
|
||||||
|
miso-pin = <25>;
|
||||||
|
cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&pro_micro_i2c {
|
||||||
|
status = "disabled";
|
||||||
|
};
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
nice_view_spi: &spi0 {
|
||||||
|
compatible = "nordic,nrf-spim";
|
||||||
|
sck-pin = <31>;
|
||||||
|
mosi-pin = <30>;
|
||||||
|
miso-pin = <25>;
|
||||||
|
cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&pro_micro_i2c {
|
||||||
|
status = "disabled";
|
||||||
|
};
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
nice_view_spi: &spi0 {
|
||||||
|
compatible = "nordic,nrf-spim";
|
||||||
|
sck-pin = <17>;
|
||||||
|
mosi-pin = <15>;
|
||||||
|
miso-pin = <25>;
|
||||||
|
cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&pro_micro_i2c {
|
||||||
|
status = "disabled";
|
||||||
|
};
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
nice_view_spi: &spi0 {
|
||||||
|
compatible = "nordic,nrf-spim";
|
||||||
|
sck-pin = <17>;
|
||||||
|
mosi-pin = <15>;
|
||||||
|
miso-pin = <25>;
|
||||||
|
cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&pro_micro_i2c {
|
||||||
|
status = "disabled";
|
||||||
|
};
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Disable OLED
|
||||||
|
CONFIG_SSD1306=n
|
|
@ -0,0 +1,5 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
|
@ -0,0 +1,7 @@
|
||||||
|
file_format: "1"
|
||||||
|
id: nice_view_adapter
|
||||||
|
name: nice!view adapter
|
||||||
|
type: shield
|
||||||
|
url: https://nicekeyboards.com/nice-view
|
||||||
|
requires: [i2c_oled]
|
||||||
|
exposes: [nice_view_header]
|
|
@ -30,3 +30,6 @@ include:
|
||||||
shield: romac_plus
|
shield: romac_plus
|
||||||
cmake-args: "-DCONFIG_ZMK_RGB_UNDERGLOW=y -DCONFIG_WS2812_STRIP=y"
|
cmake-args: "-DCONFIG_ZMK_RGB_UNDERGLOW=y -DCONFIG_WS2812_STRIP=y"
|
||||||
nickname: "underglow"
|
nickname: "underglow"
|
||||||
|
- board: nice_nano_v2
|
||||||
|
shield: lily58_left nice_view_adapter nice_view
|
||||||
|
nickname: "niceview"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2020 The ZMK Contributors
|
# Copyright (c) 2022 The ZMK Contributors
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
zephyr_library_named(zmk__drivers__gpio)
|
zephyr_library_named(zmk__drivers__gpio)
|
||||||
|
@ -6,3 +6,4 @@ zephyr_library_include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||||
|
|
||||||
zephyr_library_sources_ifdef(CONFIG_GPIO_595 gpio_595.c)
|
zephyr_library_sources_ifdef(CONFIG_GPIO_595 gpio_595.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_GPIO_MCP23017 gpio_mcp23017.c)
|
zephyr_library_sources_ifdef(CONFIG_GPIO_MCP23017 gpio_mcp23017.c)
|
||||||
|
zephyr_library_sources_ifdef(CONFIG_GPIO_MAX7318 gpio_max7318.c)
|
||||||
|
|
|
@ -2,4 +2,5 @@ menuconfig ZMK_DRIVERS_GPIO
|
||||||
bool "GPIO"
|
bool "GPIO"
|
||||||
|
|
||||||
rsource "Kconfig.mcp23017"
|
rsource "Kconfig.mcp23017"
|
||||||
|
rsource "Kconfig.max7318"
|
||||||
rsource "Kconfig.595"
|
rsource "Kconfig.595"
|
25
app/drivers/gpio/Kconfig.max7318
Normal file
25
app/drivers/gpio/Kconfig.max7318
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# MAX7318 GPIO configuration options
|
||||||
|
|
||||||
|
# Copyright (c) 2022 The ZMK Contributors
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
DT_COMPAT_MAXIM_MAX7318 := maxim,max7318
|
||||||
|
|
||||||
|
menuconfig GPIO_MAX7318
|
||||||
|
bool "MAX7318 I2C-based GPIO chip"
|
||||||
|
default $(dt_compat_enabled,$(DT_COMPAT_MAXIM_MAX7318))
|
||||||
|
depends on I2C
|
||||||
|
select HAS_DTS_GPIO
|
||||||
|
select ZMK_DRIVERS_GPIO
|
||||||
|
help
|
||||||
|
Enable driver for MAX7318 I2C-based GPIO chip.
|
||||||
|
|
||||||
|
if GPIO_MAX7318
|
||||||
|
|
||||||
|
config GPIO_MAX7318_INIT_PRIORITY
|
||||||
|
int "Init priority"
|
||||||
|
default 75
|
||||||
|
help
|
||||||
|
Device driver initialization priority.
|
||||||
|
|
||||||
|
endif #GPIO_MAX7318
|
336
app/drivers/gpio/gpio_max7318.c
Normal file
336
app/drivers/gpio/gpio_max7318.c
Normal file
|
@ -0,0 +1,336 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define DT_DRV_COMPAT maxim_max7318
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file Driver for MAX7318 I2C-based GPIO driver.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <kernel.h>
|
||||||
|
#include <device.h>
|
||||||
|
#include <init.h>
|
||||||
|
#include <sys/byteorder.h>
|
||||||
|
#include <drivers/gpio.h>
|
||||||
|
#include <drivers/i2c.h>
|
||||||
|
#include <drivers/ext_power.h>
|
||||||
|
|
||||||
|
#define LOG_LEVEL CONFIG_GPIO_LOG_LEVEL
|
||||||
|
#include <logging/log.h>
|
||||||
|
|
||||||
|
LOG_MODULE_REGISTER(gpio_max7318);
|
||||||
|
|
||||||
|
// Register definitions
|
||||||
|
#define REG_INPUT_PORTA 0x00
|
||||||
|
#define REG_INPUT_PORTB 0x01
|
||||||
|
#define REG_OUTPUT_PORTA 0x02
|
||||||
|
#define REG_OUTPUT_PORTB 0x03
|
||||||
|
#define REG_IPOL_PORTA 0x04
|
||||||
|
#define REG_IPOL_PORTB 0x05
|
||||||
|
#define REG_CONFIG_PORTA 0x06
|
||||||
|
#define REG_CONFIG_PORTB 0x07
|
||||||
|
|
||||||
|
// Configuration data
|
||||||
|
struct max7318_config {
|
||||||
|
struct gpio_driver_config common;
|
||||||
|
|
||||||
|
struct i2c_dt_spec i2c_bus;
|
||||||
|
uint8_t ngpios;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Runtime driver data
|
||||||
|
struct max7318_drv_data {
|
||||||
|
// gpio_driver_data needs to be first
|
||||||
|
struct gpio_driver_config data;
|
||||||
|
|
||||||
|
struct k_sem lock;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
uint16_t ipol;
|
||||||
|
uint16_t config;
|
||||||
|
uint16_t output;
|
||||||
|
} reg_cache;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Read the value of two consecutive registers
|
||||||
|
*
|
||||||
|
* Read two consecutive bytes from the register at address `reg` and `reg + 1`,
|
||||||
|
* typically reading from registers for port 0 and 1 simultaneously.
|
||||||
|
*
|
||||||
|
* @param dev The max7318 device.
|
||||||
|
* @param reg Register to read (the PORT0 of the pair of registers).
|
||||||
|
* @param buf Buffer to read data into.
|
||||||
|
*
|
||||||
|
* @return 0 if successful, failed otherwise.
|
||||||
|
*/
|
||||||
|
static int read_registers(const struct device *dev, uint8_t reg, uint16_t *buf) {
|
||||||
|
const struct max7318_config *config = dev->config;
|
||||||
|
|
||||||
|
uint16_t data = 0;
|
||||||
|
int ret = i2c_burst_read_dt(&config->i2c_bus, reg, (uint8_t *)&data, sizeof(data));
|
||||||
|
if (ret) {
|
||||||
|
LOG_DBG("i2c_write_read FAIL %d\n", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
*buf = sys_le16_to_cpu(data);
|
||||||
|
|
||||||
|
LOG_DBG("max7318: read: reg[0x%X] = 0x%X, reg[0x%X] = 0x%X", reg, (*buf & 0xFF), (reg + 1),
|
||||||
|
(*buf >> 8));
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Write the value of two consecutive registers
|
||||||
|
*
|
||||||
|
* Write two consecutive bytes from the register at address `reg` and `reg + 1`,
|
||||||
|
* typically to registers for port 0 and 1 simultaneously.
|
||||||
|
*
|
||||||
|
* @param dev The max7318 device.
|
||||||
|
* @param reg Register to write (usually the register for PORT0).
|
||||||
|
* @param value The value to write
|
||||||
|
*
|
||||||
|
* @return 0 if successful, failed otherwise.
|
||||||
|
*/
|
||||||
|
static int write_registers(const struct device *dev, uint8_t reg, uint16_t value) {
|
||||||
|
const struct max7318_config *config = dev->config;
|
||||||
|
|
||||||
|
LOG_DBG("max7318: write: reg[0x%X] = 0x%X, reg[0x%X] = 0x%X", reg, (value & 0xFF), (reg + 1),
|
||||||
|
(value >> 8));
|
||||||
|
|
||||||
|
uint16_t data = sys_cpu_to_le16(value);
|
||||||
|
|
||||||
|
return i2c_burst_write_dt(&config->i2c_bus, reg, (uint8_t *)&data, sizeof(data));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Setup the pin direction (input or output)
|
||||||
|
*
|
||||||
|
* @param dev The max7318 device.
|
||||||
|
* @param pin The pin number.
|
||||||
|
* @param flags Flags of pin or port.
|
||||||
|
*
|
||||||
|
* @return 0 if successful, failed otherwise
|
||||||
|
*/
|
||||||
|
static int set_pin_direction(const struct device *dev, uint32_t pin, int flags) {
|
||||||
|
struct max7318_drv_data *const drv_data = (struct max7318_drv_data *const)dev->data;
|
||||||
|
uint16_t *dir = &drv_data->reg_cache.config;
|
||||||
|
uint16_t *output = &drv_data->reg_cache.output;
|
||||||
|
|
||||||
|
/*
|
||||||
|
The output register is 1=high, 0=low; the direction (config) register
|
||||||
|
is 1=input, 0=output.
|
||||||
|
*/
|
||||||
|
if ((flags & GPIO_OUTPUT) != 0U) {
|
||||||
|
if ((flags & GPIO_OUTPUT_INIT_HIGH) != 0U) {
|
||||||
|
*output |= BIT(pin);
|
||||||
|
} else if ((flags & GPIO_OUTPUT_INIT_LOW) != 0U) {
|
||||||
|
*output &= ~BIT(pin);
|
||||||
|
}
|
||||||
|
*dir &= ~BIT(pin);
|
||||||
|
} else {
|
||||||
|
*dir |= BIT(pin);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ret = write_registers(dev, REG_OUTPUT_PORTA, *output);
|
||||||
|
if (ret != 0) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
return write_registers(dev, REG_CONFIG_PORTA, *dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Setup the pin pull up/pull down status. This function doesn't actually set any
|
||||||
|
* registers, since the max7318 only supports a pullup, and it can't be controlled.
|
||||||
|
*
|
||||||
|
* @param dev The max7318 device.
|
||||||
|
* @param pin The pin number
|
||||||
|
* @param flags Flags of pin or port
|
||||||
|
*
|
||||||
|
* @return 0 if successful, failed otherwise
|
||||||
|
*/
|
||||||
|
static int set_pin_pull_direction(const struct device *dev, uint32_t pin, int flags) {
|
||||||
|
// actually, this chip only supports pull-up, and it can't be disabled.
|
||||||
|
// so, if we try to set anything else, return enotsup; we don't actually
|
||||||
|
// need to set any registers.
|
||||||
|
if ((flags & GPIO_PULL_DOWN) != 0U) {
|
||||||
|
return -ENOTSUP;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int max7318_config(const struct device *dev, gpio_pin_t pin, gpio_flags_t flags) {
|
||||||
|
struct max7318_drv_data *const drv_data = (struct max7318_drv_data *const)dev->data;
|
||||||
|
|
||||||
|
/* Can't do I2C bus operations from an ISR */
|
||||||
|
if (k_is_in_isr()) {
|
||||||
|
return -EWOULDBLOCK;
|
||||||
|
}
|
||||||
|
|
||||||
|
k_sem_take(&drv_data->lock, K_FOREVER);
|
||||||
|
|
||||||
|
int ret = 0;
|
||||||
|
if ((flags & GPIO_OPEN_DRAIN) != 0U) {
|
||||||
|
ret = -ENOTSUP;
|
||||||
|
goto done;
|
||||||
|
};
|
||||||
|
|
||||||
|
ret = set_pin_direction(dev, pin, flags);
|
||||||
|
if (ret != 0) {
|
||||||
|
LOG_ERR("error setting pin direction (%d)", ret);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = set_pin_pull_direction(dev, pin, flags);
|
||||||
|
if (ret != 0) {
|
||||||
|
LOG_ERR("error setting pin pull up/down (%d)", ret);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
k_sem_give(&drv_data->lock);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int max7318_port_get_raw(const struct device *dev, uint32_t *value) {
|
||||||
|
struct max7318_drv_data *const drv_data = (struct max7318_drv_data *const)dev->data;
|
||||||
|
|
||||||
|
/* Can't do I2C bus operations from an ISR */
|
||||||
|
if (k_is_in_isr()) {
|
||||||
|
return -EWOULDBLOCK;
|
||||||
|
}
|
||||||
|
|
||||||
|
k_sem_take(&drv_data->lock, K_FOREVER);
|
||||||
|
|
||||||
|
uint16_t buf = 0;
|
||||||
|
int ret = read_registers(dev, REG_INPUT_PORTA, &buf);
|
||||||
|
if (ret != 0) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
*value = buf;
|
||||||
|
|
||||||
|
done:
|
||||||
|
k_sem_give(&drv_data->lock);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int max7318_port_set_masked_raw(const struct device *dev, uint32_t mask, uint32_t value) {
|
||||||
|
struct max7318_drv_data *const drv_data = (struct max7318_drv_data *const)dev->data;
|
||||||
|
|
||||||
|
/* Can't do I2C bus operations from an ISR */
|
||||||
|
if (k_is_in_isr()) {
|
||||||
|
return -EWOULDBLOCK;
|
||||||
|
}
|
||||||
|
|
||||||
|
k_sem_take(&drv_data->lock, K_FOREVER);
|
||||||
|
|
||||||
|
uint16_t buf = drv_data->reg_cache.output;
|
||||||
|
buf = (buf & ~mask) | (mask & value);
|
||||||
|
|
||||||
|
int ret = write_registers(dev, REG_OUTPUT_PORTA, buf);
|
||||||
|
if (ret == 0) {
|
||||||
|
drv_data->reg_cache.output = buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
k_sem_give(&drv_data->lock);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int max7318_port_set_bits_raw(const struct device *dev, uint32_t mask) {
|
||||||
|
return max7318_port_set_masked_raw(dev, mask, mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int max7318_port_clear_bits_raw(const struct device *dev, uint32_t mask) {
|
||||||
|
return max7318_port_set_masked_raw(dev, mask, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int max7318_port_toggle_bits(const struct device *dev, uint32_t mask) {
|
||||||
|
struct max7318_drv_data *const drv_data = (struct max7318_drv_data *const)dev->data;
|
||||||
|
|
||||||
|
/* Can't do I2C bus operations from an ISR */
|
||||||
|
if (k_is_in_isr()) {
|
||||||
|
return -EWOULDBLOCK;
|
||||||
|
}
|
||||||
|
|
||||||
|
k_sem_take(&drv_data->lock, K_FOREVER);
|
||||||
|
|
||||||
|
uint16_t buf = drv_data->reg_cache.output;
|
||||||
|
buf ^= mask;
|
||||||
|
|
||||||
|
int ret = write_registers(dev, REG_OUTPUT_PORTA, buf);
|
||||||
|
if (ret == 0) {
|
||||||
|
drv_data->reg_cache.output = buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
k_sem_give(&drv_data->lock);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int max7318_pin_interrupt_configure(const struct device *dev, gpio_pin_t pin,
|
||||||
|
enum gpio_int_mode mode, enum gpio_int_trig trig) {
|
||||||
|
return -ENOTSUP;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct gpio_driver_api api_table = {
|
||||||
|
.pin_configure = max7318_config,
|
||||||
|
.port_get_raw = max7318_port_get_raw,
|
||||||
|
.port_set_masked_raw = max7318_port_set_masked_raw,
|
||||||
|
.port_set_bits_raw = max7318_port_set_bits_raw,
|
||||||
|
.port_clear_bits_raw = max7318_port_clear_bits_raw,
|
||||||
|
.port_toggle_bits = max7318_port_toggle_bits,
|
||||||
|
.pin_interrupt_configure = max7318_pin_interrupt_configure,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialisation function of MAX7318
|
||||||
|
*
|
||||||
|
* @param dev Device struct
|
||||||
|
* @return 0 if successful, failed otherwise.
|
||||||
|
*/
|
||||||
|
static int max7318_init(const struct device *dev) {
|
||||||
|
const struct max7318_config *const config = dev->config;
|
||||||
|
struct max7318_drv_data *const drv_data = (struct max7318_drv_data *const)dev->data;
|
||||||
|
|
||||||
|
if (!device_is_ready(config->i2c_bus.bus)) {
|
||||||
|
LOG_WRN("i2c bus not ready!");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_INF("device initialised at 0x%x", config->i2c_bus.addr);
|
||||||
|
|
||||||
|
k_sem_init(&drv_data->lock, 1, 1);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define GPIO_PORT_PIN_MASK_FROM_NGPIOS(ngpios) ((gpio_port_pins_t)(((uint64_t)1 << (ngpios)) - 1U))
|
||||||
|
|
||||||
|
#define GPIO_PORT_PIN_MASK_FROM_DT_INST(inst) \
|
||||||
|
GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(inst, ngpios))
|
||||||
|
|
||||||
|
#define MAX7318_INIT(inst) \
|
||||||
|
static struct max7318_config max7318_##inst##_config = { \
|
||||||
|
.common = {.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(inst)}, \
|
||||||
|
.i2c_bus = I2C_DT_SPEC_INST_GET(inst)}; \
|
||||||
|
\
|
||||||
|
static struct max7318_drv_data max7318_##inst##_drvdata = { \
|
||||||
|
/* Default for registers according to datasheet */ \
|
||||||
|
.reg_cache.ipol = 0x0, \
|
||||||
|
.reg_cache.config = 0xFFFF, \
|
||||||
|
.reg_cache.output = 0xFFFF, \
|
||||||
|
}; \
|
||||||
|
\
|
||||||
|
DEVICE_DT_INST_DEFINE(inst, max7318_init, NULL, &max7318_##inst##_drvdata, \
|
||||||
|
&max7318_##inst##_config, POST_KERNEL, \
|
||||||
|
CONFIG_GPIO_MAX7318_INIT_PRIORITY, &api_table);
|
||||||
|
|
||||||
|
DT_INST_FOREACH_STATUS_OKAY(MAX7318_INIT)
|
|
@ -32,6 +32,16 @@ config ZMK_KSCAN_GPIO_MATRIX
|
||||||
|
|
||||||
if ZMK_KSCAN_GPIO_MATRIX
|
if ZMK_KSCAN_GPIO_MATRIX
|
||||||
|
|
||||||
|
config ZMK_KSCAN_MATRIX_WAIT_BEFORE_INPUTS
|
||||||
|
int "Ticks to wait before reading inputs after an output set active"
|
||||||
|
default 0
|
||||||
|
help
|
||||||
|
When iterating over each output to drive it active, read inputs, then set
|
||||||
|
inactive again, some boards may take time for output to propagate to the
|
||||||
|
inputs. In that scenario, set this value to a positive value to configure
|
||||||
|
the number of ticks to wait after setting an output active before reading
|
||||||
|
the inputs for their active state.
|
||||||
|
|
||||||
config ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS
|
config ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS
|
||||||
int "Ticks to wait between each output when scanning"
|
int "Ticks to wait between each output when scanning"
|
||||||
default 0
|
default 0
|
||||||
|
@ -40,7 +50,7 @@ config ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS
|
||||||
inactive again, some boards may take time for the previous output to
|
inactive again, some boards may take time for the previous output to
|
||||||
"settle" before reading inputs for the next active output column. In that
|
"settle" before reading inputs for the next active output column. In that
|
||||||
scenario, set this value to a positive value to configure the number of
|
scenario, set this value to a positive value to configure the number of
|
||||||
usecs to wait after reading each column of keys.
|
ticks to wait after reading each column of keys.
|
||||||
|
|
||||||
endif # ZMK_KSCAN_GPIO_MATRIX
|
endif # ZMK_KSCAN_GPIO_MATRIX
|
||||||
|
|
||||||
|
|
|
@ -235,6 +235,10 @@ static int kscan_matrix_read(const struct device *dev) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG_ZMK_KSCAN_MATRIX_WAIT_BEFORE_INPUTS > 0
|
||||||
|
k_busy_wait(CONFIG_ZMK_KSCAN_MATRIX_WAIT_BEFORE_INPUTS);
|
||||||
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < config->inputs.len; i++) {
|
for (int i = 0; i < config->inputs.len; i++) {
|
||||||
const struct gpio_dt_spec *in_gpio = &config->inputs.gpios[i];
|
const struct gpio_dt_spec *in_gpio = &config->inputs.gpios[i];
|
||||||
|
|
||||||
|
|
29
app/drivers/zephyr/dts/bindings/gpio/maxim,max7318.yaml
Normal file
29
app/drivers/zephyr/dts/bindings/gpio/maxim,max7318.yaml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#
|
||||||
|
# Copyright (c) 2022 The ZMK Contributors
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
#
|
||||||
|
|
||||||
|
description: >
|
||||||
|
This is a representation of the Maxim MAX7318 I2C Gpio Expander.
|
||||||
|
|
||||||
|
compatible: "maxim,max7318"
|
||||||
|
|
||||||
|
include: [gpio-controller.yaml, i2c-device.yaml]
|
||||||
|
|
||||||
|
properties:
|
||||||
|
label:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
"#gpio-cells":
|
||||||
|
const: 2
|
||||||
|
|
||||||
|
ngpios:
|
||||||
|
type: int
|
||||||
|
required: true
|
||||||
|
const: 16
|
||||||
|
description: Number of gpios supported
|
||||||
|
|
||||||
|
gpio-cells:
|
||||||
|
- pin
|
||||||
|
- flags
|
|
@ -93,9 +93,11 @@ Keyboard scan driver where keys are arranged on a matrix with one GPIO per row a
|
||||||
|
|
||||||
Definition file: [zmk/app/drivers/kscan/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/kscan/Kconfig)
|
Definition file: [zmk/app/drivers/kscan/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/kscan/Kconfig)
|
||||||
|
|
||||||
| Config | Type | Description | Default |
|
| Config | Type | Description | Default |
|
||||||
| --------------------------------- | ---- | ------------------------------------------------ | ------- |
|
| ---------------------------------------------- | ----------- | ------------------------------------------------------------------------- | ------- |
|
||||||
| `CONFIG_ZMK_KSCAN_MATRIX_POLLING` | bool | Poll for key presses instead of using interrupts | n |
|
| `CONFIG_ZMK_KSCAN_MATRIX_POLLING` | bool | Poll for key presses instead of using interrupts | n |
|
||||||
|
| `CONFIG_ZMK_KSCAN_MATRIX_WAIT_BEFORE_INPUTS` | int (ticks) | How long to wait before reading input pins after setting output active | 0 |
|
||||||
|
| `CONFIG_ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS` | int (ticks) | How long to wait between each output to allow previous output to "settle" | 0 |
|
||||||
|
|
||||||
### Devicetree
|
### Devicetree
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,13 @@ export const toc = [
|
||||||
id: "composite",
|
id: "composite",
|
||||||
level: 2,
|
level: 2,
|
||||||
},
|
},
|
||||||
...Object.values(groupedMetadata(Metadata).interconnects).map(
|
...Object.values(groupedMetadata(Metadata).interconnects)
|
||||||
({ interconnect }) => ({
|
.filter((ic) => ic.interconnect !== undefined)
|
||||||
|
.map(({ interconnect }) => ({
|
||||||
value: `${interconnect.name} Interconnect`,
|
value: `${interconnect.name} Interconnect`,
|
||||||
id: interconnect.id,
|
id: interconnect.id,
|
||||||
level: 3,
|
level: 3,
|
||||||
})
|
})),
|
||||||
),
|
|
||||||
{
|
{
|
||||||
value: "Other Hardware",
|
value: "Other Hardware",
|
||||||
id: "other-hardware",
|
id: "other-hardware",
|
||||||
|
|
102
docs/package-lock.json
generated
102
docs/package-lock.json
generated
|
@ -3323,6 +3323,15 @@
|
||||||
"node": ">=6.0.0"
|
"node": ">=6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@jridgewell/source-map": {
|
||||||
|
"version": "0.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz",
|
||||||
|
"integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==",
|
||||||
|
"dependencies": {
|
||||||
|
"@jridgewell/gen-mapping": "^0.3.0",
|
||||||
|
"@jridgewell/trace-mapping": "^0.3.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@jridgewell/sourcemap-codec": {
|
"node_modules/@jridgewell/sourcemap-codec": {
|
||||||
"version": "1.4.11",
|
"version": "1.4.11",
|
||||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz",
|
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz",
|
||||||
|
@ -8413,36 +8422,6 @@
|
||||||
"node": ">= 12"
|
"node": ">= 12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/html-minifier-terser/node_modules/source-map": {
|
|
||||||
"version": "0.7.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
|
|
||||||
"integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/html-minifier-terser/node_modules/terser": {
|
|
||||||
"version": "5.12.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz",
|
|
||||||
"integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"acorn": "^8.5.0",
|
|
||||||
"commander": "^2.20.0",
|
|
||||||
"source-map": "~0.7.2",
|
|
||||||
"source-map-support": "~0.5.20"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"terser": "bin/terser"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/html-minifier-terser/node_modules/terser/node_modules/commander": {
|
|
||||||
"version": "2.20.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
|
||||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
|
|
||||||
},
|
|
||||||
"node_modules/html-tags": {
|
"node_modules/html-tags": {
|
||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.2.0.tgz",
|
||||||
|
@ -13561,12 +13540,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/terser": {
|
"node_modules/terser": {
|
||||||
"version": "5.9.0",
|
"version": "5.14.2",
|
||||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
|
||||||
"integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==",
|
"integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@jridgewell/source-map": "^0.3.2",
|
||||||
|
"acorn": "^8.5.0",
|
||||||
"commander": "^2.20.0",
|
"commander": "^2.20.0",
|
||||||
"source-map": "~0.7.2",
|
|
||||||
"source-map-support": "~0.5.20"
|
"source-map-support": "~0.5.20"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -13614,14 +13594,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
|
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
|
||||||
},
|
},
|
||||||
"node_modules/terser/node_modules/source-map": {
|
|
||||||
"version": "0.7.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
|
|
||||||
"integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/text-table": {
|
"node_modules/text-table": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
||||||
|
@ -17436,6 +17408,15 @@
|
||||||
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz",
|
||||||
"integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ=="
|
"integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ=="
|
||||||
},
|
},
|
||||||
|
"@jridgewell/source-map": {
|
||||||
|
"version": "0.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz",
|
||||||
|
"integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==",
|
||||||
|
"requires": {
|
||||||
|
"@jridgewell/gen-mapping": "^0.3.0",
|
||||||
|
"@jridgewell/trace-mapping": "^0.3.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@jridgewell/sourcemap-codec": {
|
"@jridgewell/sourcemap-codec": {
|
||||||
"version": "1.4.11",
|
"version": "1.4.11",
|
||||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz",
|
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz",
|
||||||
|
@ -21282,29 +21263,6 @@
|
||||||
"version": "8.3.0",
|
"version": "8.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
|
||||||
"integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="
|
"integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="
|
||||||
},
|
|
||||||
"source-map": {
|
|
||||||
"version": "0.7.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
|
|
||||||
"integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ=="
|
|
||||||
},
|
|
||||||
"terser": {
|
|
||||||
"version": "5.12.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz",
|
|
||||||
"integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==",
|
|
||||||
"requires": {
|
|
||||||
"acorn": "^8.5.0",
|
|
||||||
"commander": "^2.20.0",
|
|
||||||
"source-map": "~0.7.2",
|
|
||||||
"source-map-support": "~0.5.20"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"commander": {
|
|
||||||
"version": "2.20.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
|
||||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -25015,12 +24973,13 @@
|
||||||
"integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ=="
|
"integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ=="
|
||||||
},
|
},
|
||||||
"terser": {
|
"terser": {
|
||||||
"version": "5.9.0",
|
"version": "5.14.2",
|
||||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
|
||||||
"integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==",
|
"integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"@jridgewell/source-map": "^0.3.2",
|
||||||
|
"acorn": "^8.5.0",
|
||||||
"commander": "^2.20.0",
|
"commander": "^2.20.0",
|
||||||
"source-map": "~0.7.2",
|
|
||||||
"source-map-support": "~0.5.20"
|
"source-map-support": "~0.5.20"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -25028,11 +24987,6 @@
|
||||||
"version": "2.20.3",
|
"version": "2.20.3",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
|
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
|
||||||
},
|
|
||||||
"source-map": {
|
|
||||||
"version": "0.7.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
|
|
||||||
"integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ=="
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -41,7 +41,11 @@ function groupedShield(agg: GroupedMetadata, shield: Shield) {
|
||||||
ic.shields.push(shield);
|
ic.shields.push(shield);
|
||||||
agg.interconnects[id] = ic;
|
agg.interconnects[id] = ic;
|
||||||
});
|
});
|
||||||
|
shield.exposes?.forEach((id) => {
|
||||||
|
let ic = agg.interconnects[id] ?? { boards: [], shields: [] };
|
||||||
|
ic.shields.push(shield);
|
||||||
|
agg.interconnects[id] = ic;
|
||||||
|
});
|
||||||
return agg;
|
return agg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue