/* baudrate Baudrate at which the UART should operate (in Hz). masterClock Frequency of the system master clock (in Hz). uses PA9 and PA10, RXD2 and TXD2  */
void SECOND_UART_Configure(uint32_t baudrate, uint32_t masterClock)
/* baudrate Baudrate at which the UART should operate (in Hz). masterClock Frequency of the system master clock (in Hz). uses PA9 and PA10, RXD2 and TXD2  */
void SECOND_UART_Configure(uint32_t baudrate, uint32_t masterClock)
{
  Uart *pUart = SECOND_SERIAL_UART;
  configure_pins( (PIO_PA9 | PIO_PA10), PIN_PERIPHERAL | PIN_INPUT | PIN_PER_A | PIN_PORTA | PIN_NO_PULLUP ) ;
  PMC->PMC_PCER0 = 1 << SECOND_SERIAL_ID;
  pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX
                 | UART_CR_RXDIS | UART_CR_TXDIS;
  pUart->UART_MR = 0x800 ;
  pUart->UART_BRGR = (masterClock / baudrate) / 16;
  pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS;
  pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN;
  pUart->UART_IER = UART_IER_RXRDY;
  NVIC_EnableIRQ(UART0_IRQn);
}