⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serialconsolestdio_comp.c

📁 用于TM1300/PNX1300系列DSP(主要用于视频处理)的设备库的源码
💻 C
字号:
/*
 * Copyright (c) 1999 by TriMedia Technologies. 
 *
 * +------------------------------------------------------------------+
 * | This software is furnished under a license and may only be used  |
 * | and copied in accordance with the terms and conditions of  such  |
 * | a license and with the inclusion of this copyright notice. This  |
 * | software or any other copies of this software may not be provided|
 * | or otherwise made available to any other person.  The ownership  |
 * | and title of this software is not transferred.                   |
 * |                                                                  |
 * | The information in this software is subject  to change without   |
 * | any  prior notice and should not be construed as a commitment by |
 * | TriMedia Technologies.                                           |
 * |                                                                  |
 * | this code and information is provided "as is" without any        |
 * | warranty of any kind, either expressed or implied, including but |
 * | not limited to the implied warranties of merchantability and/or  |
 * | fitness for any particular purpose.                              |
 * +------------------------------------------------------------------+
 *
 *  Module name              : SerialConsoleStdio_Comp.c    1.5
 *
 *
 *  Last update              : 08:15:10 - 99/04/16
 *
 *  Description              : Component for opening  
 *                             standard io streams on 
 *                             simple serial IO driver
 *
 */

#include <tm1/tsaComponent.h>
#include <tm1/tmLibdevErr.h>
#include <tmlib/HostCall.h>
#include "IOComponents.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <tmlib/dprintf.h>

static tmLibdevErr_t activate(pcomponent_t comp)
{
    _open(CONSOLE, O_RDONLY, 0666);
    _open(CONSOLE, O_WRONLY | O_CREAT | O_TRUNC, 0666);
    _open(CONSOLE, O_WRONLY | O_CREAT | O_TRUNC, 0666);

    IDENTIFY(SerialConsoleStdio);

    return TMLIBDEV_OK;
}


TSA_COMP_DEF_IO_COMPONENT(SerialConsoleStdio,
                          TSA_COMP_BUILD_ARG_LIST_1(ID(SerialConsoleDriver)),
                          TSA_COMP_BUILD_ARG_LIST_1(ID(SerialConsoleStdio)),
                          activate);
                          

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -