Reply to thread

Firmware Prototype!


As I wrote earlier, the button has four GPIOs, which are labelled SW0, SW1, HDD0 and HDD1. With the stock firmware, these pins have the following functions:


SW0 and SW1 can either be connected to the PWR_SW pins on the mainboard, or to an external LED. In both cases, the internal button can be read out by the firmware.


HDD0 and HDD1 can either be connected to the HDD_LED pins on the mainboard or to an external LED or to an external button/switch that can then be read out by the firmware.


All those functions are hot-plug capable and polarity invariant. Hot-plug capability means that no reboot or changing of settings is required to activate those functions. Polarity invariance means that these functions work regardless of which way you plug the connectors in. For this to work, the firmware monitors those GPIOs and changes the output depending on the results. Basically, it can detect what is connected to it and which way around.


I just now tested this with my current PC and an Arduino. Everything works just as expected. It's not that easy to show, but maybe this demonstrates it somewhat sufficiently:


[MEDIA=vine]5Utbz5dzY7b[/MEDIA]


And this is what the microcontroller sees:



It tracks button presses, LED polarity, HDD indicator activity and PWR_SW sense connection. All with less than 140 lines of code.