I found two of the buttons are connected to PC7 and PD1, I believe the other two are connected to the UART pins PD6 and PD7 which will make them useless for my needs since I want the serial port more than the buttons.
I know that this will be a completely new program but let's immagine we would be modifying the current program for this example.
I'd suggest having the 4 button operationnal like the current program. I would add an option in the boot menu, the one accessible by holding OK on boot, an option to start automatically oin serial controlled mode. In this mode, pressing the OK or Set button (or those which are not mapped to serial) would return to button controlled mode and to return to serial controlled mode you would press and hold Set and OK.
In this way, it would be possible to modify the settings both from the serial mode and button controlled mode.
Also, ideas for the power supply itself are welcome as well. I'm starting to work on the code for the alternative STM8 firmware and have put a serial protocol definition at https://github.com/baruch/b3603/blob/master/stm8/PROTOCOL.md and my feature wishlist in the wiki at https://github.com/baruch/b3603/wiki
What would you think of having the protocol supporting GET/SET/SHOW in parallel with action keywords? I think it would made interfacing with other device a bit easier since you would not have to parse the output as much.
Then having aliases/shortcuts for case-insensitive fast to type commands like "seti 0.33" would be a piece of cake. Plus, having GET/SET interface could allow a COMMIT command if someone implements this. SHOW would be a listing of all available settings and HELP a list of all available actions.
Example session, all lines terminated by \r\n, < and > represent serial data direction.
> SET max_voltage=10.1
> SET max_amperage=0.41
> SET output_enabled=1
> GET max_voltage
< 10.10
> GET max_amperage
> 0.410
> GET output_voltage
> 9.231
> SHOW
< max_voltage=10.10
< max_amperage=0.410
< output_enabled=1
< output_voltage=9.231
< other_settings=...
< \r\n (empty line)
I'm willing to be writing some code to implement this; if it makes sense!
Maybe I missed it, but right, how do you upload code to the STM8 device? I don't have a dev environment set-up for those devices at the moment.
Edit: I forgot about read only variables, they could just be prefixed with something so the user know they are read only/status data.