#!/bin/bash

# UART Xceiver Enable Lines
#UART1_SHUTDOWN (0x4)
#UART2_SHUTDOWN (0x8)
#UART3_SHUTDOWN (0x10)
#UART5_SHUTDOWN (0x40)
#UART6_SHUTDOWN (0x20)
#UART7_SHUTDOWN (0x80)

# Clear the loopback register if set
devmem2 0x40054008 w 0x00

#        LPC3Reg::P0OutpSetPhys_ = UART2_SHUTDOWN
devmem2 0x40028124 w 0x00000008 # P0.3 mux set 
devmem2 0x40028050 w 0x00000008 # Set direction of P0.3 output
devmem2 0x40028044 w 0x00000008 # UART 2 (TX1) enable
#devmem2 0x40028048 w 0x00000008 # UART 2 (TX1) disable

devmem2 0x40028124 w 0x00000004 # P0.2 mux set
devmem2 0x40028050 w 0x00000004 # Set direction of P0.2 output
devmem2 0x40028044 w 0x00000004 # UART 1 (TX0) enable
#devmem2 0x40028048 w 0x00000004 # UART 1 (TX0) disable


devmem2 0x40028124 w 0x00000020 # P0.5 mux set                
devmem2 0x40028050 w 0x00000020 # Set direction of P0.5 output
devmem2 0x40028044 w 0x00000020 # UART 6 (S3) enable
#devmem2 0x40028048 w 0x00000020 # UART 6 (S3) disable


devmem2 0x40028124 w 0x00000080 # P0.7 mux set
devmem2 0x40028050 w 0x00000080 # Set direction of P0.7 output
devmem2 0x40028104 w 0x8000 # Set U7_TX from LCD
devmem2 0x40028044 w 0x00000080 # UART 7 (TX2) enable
#devmem2 0x40028048 w 0x00000080 # UART 7 (TX2) disable

