UART getche function improved with option for modes