From d6af65f4ef09d75d9aebb617d3cb02fe06e37864 Mon Sep 17 00:00:00 2001 From: Roman Priesol Date: Fri, 4 Dec 2026 16:16:15 +0100 Subject: [PATCH] Keypads: the XIAO's knobs by their discovered names (mcu-stm32-xiao-c5.encoder_1, encoder_button_1), the action that sets them turning freely (entity 7, REAL32 at 0x2072) --- docs/deployment.adoc | 11 ++++++++--- lib/maptool/keypad.rb | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/deployment.adoc b/docs/deployment.adoc index 8b2c17f..a684ad6 100644 --- a/docs/deployment.adoc +++ b/docs/deployment.adoc @@ -361,11 +361,16 @@ in the server knows what a key is for. ---- "keypads": [ { "name": "pad", "protocol": "pkp", "node": 20, "keys": 8, "heartbeat_node": 32, - "inputs": { "E1": "XIAO STM32C5.Encoder 1", "E1 press": "XIAO STM32C5.Encoder Button 1", - "E2": "XIAO STM32C5.Encoder 2", "E3": "XIAO STM32C5.Encoder 3", - "E3 press": "XIAO STM32C5.Encoder Button 3" } } ] + "inputs": { "E1": "mcu-stm32-xiao-c5.encoder_1", "E1 press": "mcu-stm32-xiao-c5.encoder_button_1", + "E2": "mcu-stm32-xiao-c5.encoder_2", "E3": "mcu-stm32-xiao-c5.encoder_3", + "E3 press": "mcu-stm32-xiao-c5.encoder_button_3" } } ] ---- +The knobs turn freely once entity 7's bits are set — an action writes it +(a number is REAL32 at `0x2002 + 0x10 × entity`, sub 1; 7.0 = knobs 1–3): +`{ "name": "Encoders 1-3 free turning", "node": 32, "index": "0x2072", +"subindex": 1, "data": "0000e040" }`, once (the node keeps it). + `name` prefixes its channels (`pad.K1`, `pad.E3`, `pad.E3 press`). `"protocol": "pkp"` — a Blink Marine PKP CANopen keypad, or ours speaking its protocol (home-gitops `docs/canopen-nodes.adoc`): K1… come from its diff --git a/lib/maptool/keypad.rb b/lib/maptool/keypad.rb index c0e0a22..0b6a2ff 100644 --- a/lib/maptool/keypad.rb +++ b/lib/maptool/keypad.rb @@ -11,7 +11,7 @@ module Maptool # # can.json: "keypads": [ # { "name": "pad", "protocol": "pkp", "node": 20, "keys": 8, "heartbeat_node": 32, - # "inputs": { "E1": "XIAO STM32C5.Encoder 1", "E1 press": "XIAO STM32C5.Encoder Button 1" } }, + # "inputs": { "E1": "mcu-stm32-xiao-c5.encoder_1", "E1 press": "mcu-stm32-xiao-c5.encoder_button_1" } }, # { "name": "wheel", "heartbeat_node": 40, "inputs": { "K1": "wheel.Button 1" } } ] # name the channels' prefix # protocol "pkp": K1…K from its TPDO1 (0x180+node, a bit each), LEDs by RPDO