Ejemplo n.º 1
0
#include <bsp/tms570-sci-driver.h>
#include <rtems/console.h>
#include <bsp.h>
#include <bsp/fatal.h>
#include <bsp/irq.h>

#define TMS570_SCI_BUFFER_SIZE 1

/**
 * @brief Table including all serial drivers
 *
 * Definitions of all serial drivers
 */
tms570_sci_context driver_context_table[] = {
  {
    .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("TMS570 SCI1"),
    .device_name = "/dev/console",
    /* TMS570 UART peripheral use subset of LIN registers which are equivalent
     * to SCI ones
     */
    .regs = (volatile tms570_sci_t *) &TMS570_LIN,
    .irq = TMS570_IRQ_SCI_LEVEL_0,
  },
  {
    .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("TMS570 SCI2"),
    .device_name = "/dev/ttyS1",
    .regs = &TMS570_SCI,
    .irq = TMS570_IRQ_SCI2_LEVEL_0,
  }
};
Ejemplo n.º 2
0
static bool lpc176x_uart3_probe(rtems_termios_device_context *ctx)
{
  (void)ctx;

  lpc176x_module_enable( LPC176X_MODULE_UART_3, LPC176X_MODULE_PCLK_DEFAULT );

  lpc176x_pin_select( LPC176X_PIN_UART_3_TXD, LPC176X_PIN_FUNCTION_10 );
  lpc176x_pin_select( LPC176X_PIN_UART_3_RXD, LPC176X_PIN_FUNCTION_10 );

  return true;
}
#endif

#ifdef LPC176X_CONFIG_CONSOLE
static ns16550_context lpc176x_uart_context_0 = {
  .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("UART 0"),
  .get_reg = lpc176x_uart_get_register,
  .set_reg = lpc176x_uart_set_register,
  .port = UART0_BASE_ADDR,
  .irq = LPC176X_IRQ_UART_0,
  .clock = LPC176X_PCLK,
  .initial_baud = LPC176X_UART_BAUD,
  .has_fractional_divider_register = true
};
#endif

#ifdef LPC176X_CONFIG_UART_1
static ns16550_context lpc176x_uart_context_1 = {
  .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("UART 1"),
  .get_reg = lpc176x_uart_get_register,
  .set_reg = lpc176x_uart_set_register,
Ejemplo n.º 3
0
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 * http://www.rtems.org/license/LICENSE.
 */

#include <rtems/serial_mouse.h>
#include <rtems/bspIo.h>

#include <bsp.h>
#include <bsp/irq.h>
#include <bsp/arm-pl011.h>
#include <bsp/arm-pl050.h>
#include <bsp/console-termios.h>

static arm_pl011_context pl011_context = {
  .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("PL011"),
  .regs = (volatile pl011 *) 0x10009000,
  .irq = RVPBXA9_IRQ_UART_0,
  .initial_baud = 115200
};

static arm_pl050_context pl050_context = {
  .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("PL050"),
  .regs = (volatile pl050 *) 0x10007000,
  .irq = RVPBXA9_IRQ_KMI1,
  .initial_baud = 115200
};

static void output_char(char c)
{
  arm_pl011_write_polled(&pl011_context.base, c);