s4l2.c
来自「德州仪器公司的6000系列的程序示例,可以看看实现什么功能,如果需要可以继续上传」· C语言 代码 · 共 39 行
C
39 行
/*********************************************************************
* S4L2.c - (Section 4, Lesson 2) CONSIDERATIONS FOR FLUSH
* This is the RTDX Target Code for Section 4, Lesson 2
********************************************************************/
#include <rtdx.h> /* defines RTDX target API calls */
#include "target.h" /* defines TARGET_INITIALIZE() */
#include <stdio.h> /* C_I/O */
/* declare a global input channel */
RTDX_CreateInputChannel( ichan );
void main()
{
int data[2];
int status;
TARGET_INITIALIZE();
/* enable the input channel */
RTDX_enableInput( &ichan );
/* receive an integer from the host */
status = RTDX_read( &ichan, data, sizeof(data) );
if ( status != sizeof(data) )
printf( "Target application requested %d bytes " \
"and only received %d bytes\n", \
sizeof(data), \
RTDX_sizeofInput(&ichan) );
else
printf( "Value %d was received from the host\n", data[0] );
/* disable the input channel */
RTDX_disableInput( &ichan );
printf( "Program Complete!\n" );
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?