I am looking a code to get the latch switch function using STM32. The below code which I have tried is working in stm32 but only a push button function without latch.