📄 mcbsp_main.c
字号:
/******************************************************************************/
/* Copyright 2004 by SEED Electronic Technology LTD. */
/* All rights reserved. SEED Electronic Technology LTD. */
/* Restricted rights to use, duplicate or disclose this code are */
/* granted through contract. */
/* */
/* MODULE NAME... Mcbsp */
/* FILENAME...... mcbsp_main.c */
/* DESCRIPTION: */
/* This is an fuction which is just for comunication btween 5402 with 6713 */
/* */
/* 作者:黄林生 */
/* 版本:1.0 */
/* 日期:06.12.01 */
/******************************************************************************/
#include <stdio.h>
#include <csl.h>
#include <csl_mcbsp.h>
#include <csl_gpio.h>
#include "gui_string.h"
#include "DEC6713.h"
#include "type.h"
#include "comm.h"
#define Word 0xaa55 //代表文字
#define Number 0x55aa //代表数字
//////////////////
unsigned int Test,i;
#define DATATYPE 1 /* 0代表文字;1代表数字*/
/////////////////////////////////////////////////////////////////////////////
#define w_num 10 /*通过w_num来控制输出文字的个数,通过gui_string.sam控制内容。*/
#define n_num 5 /*通过n_num控制输出选项数字的个数,通过数组dataer控制内容*/
///////////////////////////////////////////////////////////////////////////////
volatile unsigned int * p_DECCTL=(volatile unsigned int *)0xB0000000;
/*******************************************************/
short databuffer[6]={1234,5678,3333,4444,5555,6666};
short num=6; //can modfied ,but limit <=6
/*******************************************************/
void main()
{
/* Initialize CSL */
CSL_init();
#if DATATYPE==0
Test =Word; //文字 0xAA55
#endif
#if DATATYPE==1
Test =Number; //数据 0x55AA
#endif
*p_DECCTL=0x40;
/* Initialize DEC6713 board. */
DEC6713_init();
/*config McBSP*/
McBSP_int();
/*delay*/
for(i=0;i<2000;i++);
for(;;)
{
switch(Test)
{
case Word:
Mcbsp_wordsend(w_num,&strMcBSP[0],CHAR_DATASEND);
Test=0;
break;
case Number:
Mcbsp_Datasend(n_num,&databuffer[0],NUM_DATASEND);
Test=0;
break;
default:
break;
}
}
}
/***********************************************************************/
// No more
/***********************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -