text: // UART.h
  // Runs on LM3S811, LM3S1968, LM3S8962, LM4F120
  // Simple device driver for the UART.  This version of the UART
  // driver uses UART1 instead of UART0 and has fewer character
  // I/O functions compared to the example project UART_4F120.
  // Daniel Valvano
  // August 1, 2013
  // Modified by EE345L students Charlie Gough && Matt Hawk
  // Modified by EE345M students Agustinus Darmawan && Mingjie Qiu
  
  /* This example accompanies the book
     "Embedded Systems: Real Time Interfacing to Arm Cortex M Microcontrollers",
     ISBN: 978-1463590154, Jonathan Valvano, copyright (c) 2013
     Program 4.12, Section 4.9.4, Figures 4.26 and 4.40
  
   Copyright 2013 by Jonathan W. Valvano, valvano@mail.utexas.edu
      You may use, edit, run or distribute this file
      as long as the above copyright notice remains
   THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
   OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
   VALVANO SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
   OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
   For more information about my classes, my research, and my books, see
   http://users.ece.utexas.edu/~valvano/
   */
  
  // U1Rx connected to PC4
  // U1Tx connected to PC5
  
  // standard ASCII symbols
  #define CR   0x0D
  #define LF   0x0A
  #define BS   0x08
  #define ESC  0x1B
  #define SP   0x20
  #define DEL  0x7F
  
  //------------UART_Init------------
  // Initialize the UART for 115,200 baud rate (assuming 80 MHz clock),
  // 8 bit word length, no parity bits, one stop bit, FIFOs enabled
  // Input: none
  // Output: none
  void UART_Init(void);
  
  //------------UART_InChar------------
  // Wait for new serial port input
  // Input: none
  // Output: ASCII code for key typed
  unsigned char UART_InChar(void);
  
  //------------UART_InCharNonBlocking------------
  // Get oldest serial port input and return immediately
  // if there is no data.
  // Input: none
  // Output: ASCII code for key typed or 0 if no character
  unsigned char UART_InCharNonBlocking(void);
  
  //------------UART_OutChar------------
  // Output 8-bit to serial port
  // Input: letter is an 8-bit ASCII character to be transferred
  // Output: none
  void UART_OutChar(unsigned char data);
  