text: /*
   * UART.c
   *
   *  Created on: 20.12.2020
   *      Author: Andreas Roth, Kevin Schultz, Sebastian Hofmaier
   */
  #include <stdbool.h>
  #include <stdint.h>
  #include "inc/hw_memmap.h"
  #include "driverlib/gpio.h"
  #include "driverlib/pin_map.h"
  #include "driverlib/sysctl.h"
  #include "driverlib/uart.h"
  #include "utils/uartstdio.h"
  #include "../header/UART.h"
  
  /** @brief This function sets up UART0 to be used for a console to display information
  */
  void InitConsole(void)
  {
      //
      // Enable GPIO port A which is used for UART0 pins.
      // change this to whichever GPIO port you are using.
      //
      SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
  
      //
      // Configure the pin muxing for UART0 functions on port A0 and A1.
      // This step is not necessary if your part does not support pin muxing.
      // change this to select the port/pin you are using.
      //
      GPIOPinConfigure(GPIO_PA0_U0RX);
      GPIOPinConfigure(GPIO_PA1_U0TX);
  
      //
      // Enable UART0 so that we can configure the clock.
      //
      SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
  
      //
      // Use the internal 16MHz oscillator as the UART clock source.
      //
      UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
  
      //
      // Select the alternate (UART) function for these pins.
      // change this to select the port/pin you are using.
      //
      GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
  
      //
      // Initialize the UART for console I/O.
      //
      UARTStdioConfig(0, 115200, 16000000);
  }
  
  /** @brief Display content of "str" on the console.
  * @param  str       : char *
  * @return  1: Success
  */
  int UART_print(char * str)
  {
      // Display content of "str" on the console.
      UARTprintf(str);
  
      return (1); // Success
  }
  