1 /*******************************************************************
2 Components for embedded applications builded for
3 laboratory and medical instruments firmware
5 cmd_uartcon.c - interconnection of text command processor
8 Copyright (C) 2001 by Pavel Pisa pisa@cmp.felk.cvut.cz
9 (C) 2002 by PiKRON Ltd. http://www.pikron.com
11 *******************************************************************/
19 #define ED_LINE_CHARS 512
21 cmd_io_t cmd_io_uartcon_dev;
23 char ed_line_chars_uartcon_in[ED_LINE_CHARS + 1];
24 char ed_line_chars_uartcon_out[ED_LINE_CHARS + 1];
26 ed_line_buf_t ed_line_buf_uartcon_in =
32 sizeof(ed_line_chars_uartcon_in),
36 ed_line_chars_uartcon_in
39 ed_line_buf_t ed_line_buf_uartcon_out =
45 sizeof(ed_line_chars_uartcon_out),
49 ed_line_chars_uartcon_out
52 cmd_io_t cmd_io_uartcon =
67 &ed_line_buf_uartcon_in,
69 &ed_line_buf_uartcon_out,
76 int cmd_io_putc_uartcon(struct cmd_io *cmd_io, int ch)
78 int uartch = cmd_io->priv.uart.uartch;
80 ch = uart0PutchNW(ch);
88 int cmd_io_getc_uartcon(struct cmd_io *cmd_io)
91 int uartch = cmd_io->priv.uart.uartch;
101 cmd_io_t cmd_io_uartcon_dev =
103 .putc = cmd_io_putc_uartcon,
104 .getc = cmd_io_getc_uartcon,
105 .write = cmd_io_write_bychar,
106 .read = cmd_io_read_bychar,