source: rtems/bsps/arm/xilinx-zynq/console/debug-console.c @ e0dd8a5a

5
Last change on this file since e0dd8a5a was d7d66d7, checked in by Sebastian Huber <sebastian.huber@…>, on 04/19/18 at 04:28:01

bsps: Move console drivers to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 * Copyright (c) 2013, 2017 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#include <rtems/bspIo.h>
16#include <rtems/sysinit.h>
17
18#include <bsp/zynq-uart.h>
19
20#include <bspopts.h>
21
22static void zynq_debug_console_out(char c)
23{
24  rtems_termios_device_context *base =
25    &zynq_uart_instances[BSP_CONSOLE_MINOR].base;
26
27  zynq_uart_write_polled(base, c);
28}
29
30static void zynq_debug_console_init(void)
31{
32  rtems_termios_device_context *base =
33    &zynq_uart_instances[BSP_CONSOLE_MINOR].base;
34
35  zynq_uart_initialize(base);
36  BSP_output_char = zynq_debug_console_out;
37}
38
39static void zynq_debug_console_early_init(char c)
40{
41  rtems_termios_device_context *base =
42    &zynq_uart_instances[BSP_CONSOLE_MINOR].base;
43
44  zynq_uart_initialize(base);
45  zynq_debug_console_out(c);
46}
47
48static int zynq_debug_console_in(void)
49{
50  rtems_termios_device_context *base =
51    &zynq_uart_instances[BSP_CONSOLE_MINOR].base;
52
53  return zynq_uart_read_polled(base);
54}
55
56BSP_output_char_function_type BSP_output_char = zynq_debug_console_early_init;
57
58BSP_polling_getchar_function_type BSP_poll_char = zynq_debug_console_in;
59
60RTEMS_SYSINIT_ITEM(
61  zynq_debug_console_init,
62  RTEMS_SYSINIT_BSP_START,
63  RTEMS_SYSINIT_ORDER_LAST
64);
Note: See TracBrowser for help on using the repository browser.