% var moduleName = "uart"
% var module = system.modules['/driverlib/' + moduleName + '.js'];
% let Common   = system.getScript("/driverlib/Common.js");
%if (module != null)
% {
//*****************************************************************************
//
// UART Configurations
//
//*****************************************************************************
% for(var inst of module.$instances) {
        % let modInst  = inst[moduleName];
        % let solution    = modInst.$solution;
        % let peripheral  = system.deviceData.peripherals[solution.peripheralName];
//
// `inst.$name` Configuration
//
#define `inst.$name`_BASE `peripheral.name`_BASE
#define `inst.$name`_BAUDRATE `inst.baud`
#define `inst.$name`_CONFIG_WLEN `inst.wlen`
#define `inst.$name`_CONFIG_STP2 `inst.stp2`
#define `inst.$name`_CONFIG_EPS `inst.eps`
#define `inst.$name`_CONFIG_SPS `inst.sps == true ? "1" : "0"`
    % if (inst.fen)
    % {
    %   // if the user chose EOT, set txifsel to the default value of UART_FIFO_TX4_8
    %   // otherwise just use the value the user chose
    %   var actual_txiflsel = (inst.txiflsel == "EOT") ? "UART_FIFO_TX4_8" : inst.txiflsel;
#define `inst.$name`_FIFO_TXIFLSEL `actual_txiflsel`
#define `inst.$name`_FIFO_RXIFLSEL `inst.rxiflsel`
    % }
    % if (inst.useDMARX) {
#define `inst.uartRXDMA.$name`_TRIGGER DMA_TRIGGER_`peripheral.name`RX           
#define `inst.uartRXDMA.$name`_ADDRESS ((uint16_t *)(`peripheral.name`_BASE + UART_O_DR))
    % }
    % if (inst.useDMATX) {
#define `inst.uartTXDMA.$name`_TRIGGER DMA_TRIGGER_`peripheral.name`TX  
#define `inst.uartTXDMA.$name`_ADDRESS ((uint16_t *)(`peripheral.name`_BASE + UART_O_DR))
    % }
void    `inst.$name`_init();
% }
% }