Emulating BluePill pins from Linux
exebook opened this issue · comments
exebook commented
Hey, I want to develop a mechanical keyboard controller based on BluePill, but I want to develop on Qemu STM32. The question is how do I emulate contact on pins that will be connected to actual keyboard switches on the hardware? I already figured, thanks to someone on Stack Overflow I can do send-keys { b }
to emulate the onboard button. But pins are probably GPIO but I am still learning this.
This is what I've been able to do so far with QMP:
sleep 0.1s
echo '{ "execute": "qmp_capabilities" }'
sleep 0.1s
echo '{"execute":"send-key","arguments":{"hold-time": 1000, "keys":[{ "type": "qcode", "data": "b" }]}}'
echo '{"execute":"qom-list","arguments":{"path":"/machine/stm32/gpio[c]"}}'
sleep 0.1s
echo '{"execute":"qom-get","arguments":{"path":"/machine/stm32/gpio[c]","property":"gpio[0]"}}'
sleep 0.1s
echo '{"execute":"qom-get","arguments":{"path":"/machine/stm32/gpio[c]","property":"periph"}}'
sleep 0.1s
echo '{"execute":"qom-get","arguments":{"path":"/machine/stm32/gpio[c]","property":"legacy-stm32_rcc"}}'
sleep 0.1s
echo '{"execute":"quit","arguments":{}}'
sleep 0.1s
Andre Beckus commented
Sorry I never responded @exebook, I hope you were able to figure this out. Given how much time has passed, I am going to close the issue...