Hummingboard Mate IMX8. Booting it externally

Hi everywhere, I would like to know if there is any way to take the control of power on power on process because Hummingboard have a button which behaviour i don’t understand (S2). When I plug the board and I press the button, the board switches on, but if I use “shutdown now” command, the board switches off, but when i press the button, the board doesn’t switch on. What is this button function? On SolidRun documentation I can’t find nothing.

I would like how to use GPIO pins too, and if there is any similar libraries like gpio libraries in Raspberry, to take the control of Mikrobus pins.