📄 jc5xxevm.c
字号:
/*********************************************************************
* (C) COPYRIGHT TEXAS INSTRUMENTS, INC. 1996 *
**********************************************************************/
/* jc5xxevm.c
* 'C54x EVM JPEG Compression - EVM Functions
* This file contains all functions used by the EVM to communicate
* with the host.
*
* Kamal Swamidoss
* Texas Instruments
* 2 July 1996
*/
#include "jc5xx.h"
/* EVM I/O addresses for PC/EVM interface (see EVM Tech. Ref. p.3-7) */
ioport unsigned int port10; /* EVM CHANNEL A */
ioport int port12; /* EVM CHANNEL B */
ioport unsigned int port14; /* EVM STATUS REG */
void send_command(unsigned int);
void send_data(int);
unsigned int receive_command(void);
void initialize(void)
{
int i;
for (i=0;i<3;++i)
{
asm("init1 XC 2,BIO ");
asm(" B init1 ");
asm("init2 XC 2,NBIO");
asm(" B init2 ");
asm("init3 XC 2,BIO ");
asm(" B init3 ");
send_command(ACK);
}
}
void send_command(unsigned int cmd)
{
port10 = cmd;
while (axst());
}
void send_data(int data)
{
port12 = data;
}
int receive_data(void)
{
static int tmp;
tmp=port12;
return(tmp);
}
unsigned int receive_command(void)
{
static unsigned int tmp;
while (!arst());
tmp = port10;
return(tmp);
}
int axst(void)
{
unsigned int tmp;
tmp = port14;
tmp = tmp & AXST;
if (tmp == AXST)
return(1);
return(0);
}
int arst(void)
{
unsigned int tmp=port14;
tmp = tmp & ARST;
if (tmp == ARST)
return(1);
return(0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -