Example #1
0
static void uart_init(void) {
  MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

  // Configure PD0 and PD1 for UART
  MAP_GPIOPinConfigure(GPIO_PA0_U0RX);
  MAP_GPIOPinConfigure(GPIO_PA1_U0TX);
  MAP_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
  /*UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 115200,
                      UART_CONFIG_WLEN_8| UART_CONFIG_STOP_ONE| UART_CONFIG_PAR_NONE);*/
  UARTStdioInitExpClk(0, 115200);
}
Example #2
0
/**
 * \brief   This function initializes the specified UART instance for use.
 *          This does the following:
 *          1> Sets the baud rate of communication as 115200.
 *          2> Configures the line characteristics to a typical value being
 *              8-N-1 which means 8 data bits per frame, No parity bit and 
 *              1 stop bit/frame.
 *          3> Enables the FIFO for transmitter and receiver.
 *          4> Sets the receiver trigger level to be 1 byte.
 *
 * \return  None.
 *
 * \note    This function invokes UARTStdioInitExpClk() to perform the above
 *          configurations. The function UARTStdioInitExpClk() could be
 *          directly invoked for more customized configurations.
 */
void UARTConsoleInit(void)
{
     #if (0 == UART_STDIO_INSTANCE)
     {
          PSCModuleControl(SOC_PSC_0_REGS,9, 0, PSC_MDCTL_NEXT_ENABLE);
          UARTPinMuxSetup(0, FALSE);
     }
     
     #elif (1 == UART_STDIO_INSTANCE)
     {
          PSCModuleControl(SOC_PSC_1_REGS,12, 0, PSC_MDCTL_NEXT_ENABLE);
          UARTPinMuxSetup(1, FALSE);
     }

     #else 
     {
          PSCModuleControl(SOC_PSC_1_REGS,13, 0, PSC_MDCTL_NEXT_ENABLE);
          UARTPinMuxSetup(2, FALSE);
     }
     #endif
     
     UARTStdioInitExpClk(BAUD_115200, UART_RX_TRIG_LEVEL_1);
}
Example #3
0
void StdioInitExpClk(unsigned long ulPort, unsigned long ulBaud)
{
  UARTStdioInitExpClk(ulPort, ulBaud);
}