Skip to content

Commit

Permalink
UART to Zynq support
Browse files Browse the repository at this point in the history
  • Loading branch information
pwittich committed Jun 7, 2019
1 parent 6ab38ff commit dd29e5e
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions common/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
#include "FreeRTOS.h"
#endif // USE_FREERTOS

// Initialize the UART
// based on uart_echo demo project
// we use UART4 (front panel)
// Initialize the UART(s)
// It is hard to generalize these initialization functions as they use
// a bunch of #define's that are not iterable
// UART4 is the front panel
void
UART4Init(uint32_t ui32SysClock)
{
Expand All @@ -48,6 +49,34 @@ UART4Init(uint32_t ui32SysClock)
return;
}

// UART1 is the Zynq
void
UART1Init(uint32_t ui32SysClock)
{
// Turn on the UART peripheral
MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);


//
// Configure the UART for 115,200, 8-N-1 operation.
//
MAP_UARTConfigSetExpClk(UART1_BASE, ui32SysClock, 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));

//
// Enable the UART interrupt.
//
#ifdef USE_FREERTOS
IntPrioritySet( INT_UART1, configKERNEL_INTERRUPT_PRIORITY );
#endif // USE_FREERTOS
MAP_IntEnable(INT_UART1);
MAP_UARTIntEnable(UART1_BASE, UART_INT_RX | UART_INT_RT);

return;
}




//*****************************************************************************
Expand Down

0 comments on commit dd29e5e

Please sign in to comment.