peripherals/c/serial_debug.c
//************************************************************************
// Configures the serial debug interface at 115200.
// UART IRQs can be anbled using the two paramters to the function.
//************************************************************************
Configures the serial debug interface at 115200.
UART IRQs can be anbled using the two paramters to the function.
Configures the serial debug interface at 115200 . UART IRQs can be anbled using the two paramters to the function .
bool init_serial_debug(bool enable_rx_irq, bool enable_tx_irq)
{
	gpio_enable_port(SERIAL_DBG_GPIO_BASE);
	gpio_config_digital_enable(SERIAL_DBG_GPIO_BASE, SERIAL_DBG_RX_PIN);
	gpio_config_digital_enable(SERIAL_DBG_GPIO_BASE, SERIAL_DBG_TX_PIN);
	gpio_config_alternate_function(SERIAL_DBG_GPIO_BASE, SERIAL_DBG_RX_PIN);
	gpio_config_alternate_function(SERIAL_DBG_GPIO_BASE, SERIAL_DBG_TX_PIN);
	gpio_config_port_control(SERIAL_DBG_GPIO_BASE, 
													(SERIAL_DBG_RX_PCTL_M | SERIAL_DBG_TX_PCTL_M),
													(SERIAL_DBG_RX_PCTL | SERIAL_DBG_TX_PCTL));
  Rx_Interrupts_Enabled = enable_rx_irq;
  Tx_Interrupts_Enabled = enable_tx_irq;
  pc_buffer_init(&UART0_Tx_Buffer, UART_BUFFER_SIZE);
  pc_buffer_init(&UART0_Rx_Buffer, UART_BUFFER_SIZE); 
  if(uart_init(UART0_BASE, enable_rx_irq, enable_tx_irq) == false)
  { 
    return false;
  }
  return true;
}
bool init_serial_debug ( bool enable_rx_irq , bool enable_tx_irq ) { gpio_enable_port ( SERIAL_DBG_GPIO_BASE ) ; gpio_config_digital_enable ( SERIAL_DBG_GPIO_BASE , SERIAL_DBG_RX_PIN ) ; gpio_config_digital_enable ( SERIAL_DBG_GPIO_BASE , SERIAL_DBG_TX_PIN ) ; gpio_config_alternate_function ( SERIAL_DBG_GPIO_BASE , SERIAL_DBG_RX_PIN ) ; gpio_config_alternate_function ( SERIAL_DBG_GPIO_BASE , SERIAL_DBG_TX_PIN ) ; gpio_config_port_control ( SERIAL_DBG_GPIO_BASE , ( SERIAL_DBG_RX_PCTL_M | SERIAL_DBG_TX_PCTL_M ) , ( SERIAL_DBG_RX_PCTL | SERIAL_DBG_TX_PCTL ) ) ; Rx_Interrupts_Enabled = enable_rx_irq ; Tx_Interrupts_Enabled = enable_tx_irq ; pc_buffer_init ( & UART0_Tx_Buffer , UART_BUFFER_SIZE ) ; pc_buffer_init ( & UART0_Rx_Buffer , UART_BUFFER_SIZE ) ; if ( uart_init ( UART0_BASE , enable_rx_irq , enable_tx_irq ) == false ) { return false ; } return true ; }
Configures the serial debug interface at 115200.
Configures the serial debug interface at 115200 .
// ADD CODE  // Initialize the GPIO pins used for the serial debug interface // Initialize the circular buffer(s)