diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-02-21 10:30:30 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-02-21 12:11:44 +0100 |
commit | 6b2fcc40ac8013d37e4c8aa4ea162316e2388ada (patch) | |
tree | 07ec46694c72aadd225dcc15d56c17e4419b8304 /c/src/lib/libbsp/arm/xilinx-zynq/include/zynq-uart.h | |
parent | spextensions01: Fix extension create order (diff) | |
download | rtems-6b2fcc40ac8013d37e4c8aa4ea162316e2388ada.tar.bz2 |
bsp/xilinx-zynq: Use new Termios device driver
Diffstat (limited to 'c/src/lib/libbsp/arm/xilinx-zynq/include/zynq-uart.h')
-rw-r--r-- | c/src/lib/libbsp/arm/xilinx-zynq/include/zynq-uart.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/arm/xilinx-zynq/include/zynq-uart.h b/c/src/lib/libbsp/arm/xilinx-zynq/include/zynq-uart.h index 07c883af87..57412d7ec9 100644 --- a/c/src/lib/libbsp/arm/xilinx-zynq/include/zynq-uart.h +++ b/c/src/lib/libbsp/arm/xilinx-zynq/include/zynq-uart.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2013 embedded brains GmbH. All rights reserved. + * Copyright (c) 2013, 2017 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Dornierstr. 4 @@ -21,7 +21,7 @@ #ifndef LIBBSP_ARM_XILINX_ZYNQ_UART_H #define LIBBSP_ARM_XILINX_ZYNQ_UART_H -#include <libchip/serial.h> +#include <rtems/termiostypes.h> #ifdef __cplusplus extern "C" { @@ -33,12 +33,31 @@ extern "C" { * @brief UART Support */ -extern const console_fns zynq_uart_fns; +typedef struct { + rtems_termios_device_context base; + volatile struct zynq_uart *regs; + rtems_vector_number irq; +} zynq_uart_context; + +const rtems_termios_device_handler zynq_uart_handler; + +extern zynq_uart_context zynq_uart_instances[2]; + +#define ZYNQ_UART_DEFAULT_BAUD 115200 + +void zynq_uart_initialize(rtems_termios_device_context *base); + +int zynq_uart_read_polled(rtems_termios_device_context *base); + +void zynq_uart_write_polled( + rtems_termios_device_context *base, + char c +); /** * Flush TX FIFO and wait until it is empty. Used in bsp_reset. */ -void zynq_uart_reset_tx_flush(int minor); +void zynq_uart_reset_tx_flush(zynq_uart_context *ctx); #ifdef __cplusplus } |