4848#include  " driverlib/uart.h" 
4949#include  " HardwareSerial.h" 
5050
51- 
5251#define  TX_BUFFER_EMPTY     (txReadIndex == txWriteIndex)
5352#define  TX_BUFFER_FULL      (((txWriteIndex + 1 ) % SERIAL_BUFFER_SIZE) == txReadIndex)
5453
@@ -87,7 +86,7 @@ static const unsigned long g_ulUARTPeriph[8] =
8786};
8887// *****************************************************************************
8988// 
90- //  The list of UART gpio  configurations.
89+ //  The list of UART GPIO  configurations.
9190// 
9291// *****************************************************************************
9392static  const  unsigned  long  g_ulUARTConfig[8 ][2 ] =
@@ -104,11 +103,6 @@ static const unsigned long g_ulUARTPort[8] =
104103	GPIO_PORTC_BASE, GPIO_PORTE_BASE, GPIO_PORTD_BASE, GPIO_PORTE_BASE
105104};
106105
107- // *****************************************************************************
108- // 
109- //  The list of i2c gpio configurations.
110- // 
111- // *****************************************************************************
112106static  const  unsigned  long  g_ulUARTPins[8 ] =
113107{
114108    GPIO_PIN_0 | GPIO_PIN_1, GPIO_PIN_4 | GPIO_PIN_5,
@@ -233,6 +227,23 @@ HardwareSerial::setModule(unsigned long module)
233227	begin (baudRate);
234228
235229}
230+ void  
231+ HardwareSerial::setPins (unsigned  long  pins)
232+ {
233+ 	if (pins == UART1_PORTB)
234+ 	{
235+ 		ROM_GPIOPinConfigure (GPIO_PB0_U1RX);
236+ 		ROM_GPIOPinConfigure (GPIO_PB1_U1TX);
237+ 		ROM_GPIOPinTypeUART (GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
238+ 	}
239+ 	else 
240+ 	{
241+ 		// Default UART1 Pin Muxing
242+ 		ROM_GPIOPinConfigure (g_ulUARTConfig[1 ][0 ]);
243+ 		ROM_GPIOPinConfigure (g_ulUARTConfig[1 ][1 ]);
244+ 		ROM_GPIOPinTypeUART (g_ulUARTPort[1 ], g_ulUARTPins[1 ]);
245+ 	}
246+ }
236247
237248void  HardwareSerial::end ()
238249{
0 commit comments