Files
SDD 3fd1e13b2e docs: keyboard/mouse protocol spec — LK401 (LK201 protocol) + VSXXX-AA mouse, sources, MAME lk201 device
Distils public docs into reference/keyboard-mouse/PROTOCOL.md for the level-1
Keyboard (27) / Mouse (26) device tests:
- keyboard: 4800 8N1 RS-423, self-test via FD -> 01 00 00 00 (errors 3D/3E)
- mouse: 4800 8O1 RS-232, self-test via 'T' -> 4-byte report (errors 3D/3E, >=0x20 fatal)
- separate ports: DUART2 A=keyboard, B=mouse (NOT daisy-chained)
MAME already has an LK201 device (src/mame/dec/lk201.cpp/.h) but no DEC mouse.
2026-10-16 11:38:52 +03:00

109 lines
2.2 KiB
Plaintext

/*
* Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/led/led.h>
#include <zephyr/dt-bindings/pwm/pwm.h>
&uart0 {
current-speed = <4800>;
};
&spi2 {
/* Workaround to support WS2812 driver */
line-idle-low;
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <6400000>;
/* WS2812 */
chain-length = <1>; /* arbitrary; change at will */
spi-cpha;
spi-one-frame = <0xf0>; /* 11110000: 625 ns high and 625 ns low */
spi-zero-frame = <0xc0>; /* 11000000: 312.5 ns high and 937.5 ns low */
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
};
};
&pinctrl {
spim2_default: spim2_default {
group2 {
pinmux = <SPIM2_MOSI_GPIO8>;
};
};
ledc0_default: ledc0_default {
group1 {
pinmux = <LEDC_CH0_GPIO3>;
output-enable;
};
};
};
/ {
aliases {
led-strip = &led_strip;
};
chosen {
zephyr,vt-uart = &uart0;
};
// chosen {
// /delete-property/ zephyr,console;
// };
uart_tx_enable: uart_tx_enable {
compatible = "uart-tx-enable";
gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
};
leds {
compatible = "gpio-leds";
led0: led0 {
gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
};
led1: led1 {
gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
};
led2: led2 {
gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
};
led3: led3 {
gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
};
};
aliases {
pwm-0 = &ledc0;
pwm-beeper0 = &pwm_beeper;
};
pwmbeepers {
compatible = "pwm-leds";
pwm_beeper: pwm_led_gpio0_3 {
label = "PWM BEEPER0";
/* ~2 KHz */
pwms = <&ledc0 0 40000000 PWM_POLARITY_NORMAL>;
};
};
};
&ledc0 {
pinctrl-0 = <&ledc0_default>;
pinctrl-names = "default";
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
channel0@0 {
reg = <0x0>;
timer = <0>;
};
};