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

📄 s1l1.c

📁 TMS320c6000系列dsp软件模拟器在集成开发环境CCS中应用实例
💻 C
字号:
/*********************************************************************

 * S1L1.c - (Section 1, Lesson 1) SENDING AN INTEGER TO THE HOST

 *          This is the RTDX Target Code for Section 1, Lesson 1

 *

 * This example sends integer value 5 to the host

 ********************************************************************/



/*********************************************************************

 * Insert code from Step #2 here - to include the rtdx header file,

 *                                 which defines the RTDX target API

 ********************************************************************/

#include <rtdx.h>



#include "target.h"     /* defines TARGET_INITIALIZE()              */

#include <stdio.h>      /* C_I/O                                    */



/* This is the value we are going to send to the host               */

#define VALUE_TO_SEND 5



/*********************************************************************

 * Insert code from Step #3 here - to declare a global output channel

 ********************************************************************/

RTDX_CreateOutputChannel( ochan );

 

void main()

{

        int data = VALUE_TO_SEND;

        int status;



        TARGET_INITIALIZE();



        /*************************************************************

         * Insert code from Step #5 here - to enable the output

         *                                 channel

         ************************************************************/

        RTDX_enableOutput( &ochan );





        /*************************************************************

         * Insert code from Step #6 here - to send the data to

         *                                 the host

         ************************************************************/

        status = RTDX_write( &ochan, &data, sizeof(data) );





        if ( status == 0 ) {

                puts( "ERROR: RTDX_write failed!\n" );

                exit( -1 );

        }



        while ( RTDX_writing != NULL ) {

#if RTDX_POLLING_IMPLEMENTATION

                RTDX_Poll();

#endif

        }



        /*************************************************************

         * Insert code from Step #7 here - to disable the output

         *                                 channel

         ************************************************************/

        RTDX_disableOutput( &ochan );



        puts( "Program Complete!\n" );

} 

⌨️ 快捷键说明

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