UART API optimization