1 /*******************************************************************
2 Components for embedded applications builded for
3 laboratory and medical instruments firmware
5 cmd_proc_io_tisci.c - IO layer functions for SCI on TMS570 and FreeRTOS
7 Copyright (C) 2001-2009 by Pavel Pisa pisa@cmp.felk.cvut.cz
8 (C) 2002-2009 by PiKRON Ltd. http://www.pikron.com
9 (C) 2007 by Michal Sojka <sojkam1@fel.cvut.cz>
10 (C) 2012 by Michal Horn <hornmich@fel.cvut.cz>
12 This file can be used and copied according to next
14 - MPL - Mozilla Public License
15 - GPL - GNU Public License
16 - other license provided by project originators
17 *******************************************************************/
21 #include "cmdproc_io_tisci.h"
26 * @brief Print character on SCI
27 * @param cmd_io cmd_io structure
28 * @param ch character to be printed
32 int tisci_putc(cmd_io_t *cmd_io, int ch) {
33 rpp_sci_putc((uint8_t)ch);
38 * @brief Read character from SCI
39 * @param cmd_io cmd_io structure
40 * @return character ASCII code
43 int tisci_getc(cmd_io_t *cmd_io) {
53 * @brief Print string on SCI
54 * @param cmd_io cmd_io structure
55 * @param buf String buffer to be printed
56 * @param count maximum character number to be printed
57 * @return number of printed characters
60 int tisci_write(cmd_io_t *cmd_io, const void *buf, int count) {
61 const char *tmpBuf = buf;
63 return rpp_sci_printf("%s", tmpBuf);
67 * @brief Read string from SCI
68 * @param cmd_io cmd_io structure
69 * @param buf String buffer
70 * @param count maximum character number to be read
73 int tisci_read(cmd_io_t *cmd_io, void *buf, int count) {
74 uint8_t* tmpBuf = buf;
75 return rpp_sci_read(count, tmpBuf);
79 * IO stack for cmdProc