General operation description – Sundance SMT356 User Manual
Page 21

Version 2.1
Page 21 of 26
SMT356356 User Manual
General Operation Description
(Included as file qwikscope356.c)
This little application runs under SMT6000. It demonstrates the quick method to
configure the Virtex from flash memory on the SMT332. The application displays all 8
channels in an oscilloscope type display on the SMT6000 graphical window.
Include this because we are going to do printf.
#include
volatile unsigned int *comm_status, *comm0_data;
This is a function which converts an ASCII hex character into binary.
unsigned char hex2dec(unsigned char hexnum)
{
if(hexnum<0x3a) return(hexnum-0x30);
else return(hexnum-0x37);
}
This function outputs to comm port 0.
void comm_out(unsigned int d)
{
while( ((*comm_status) & 2) == 0 )
printf("waiting for comm out rdy\n");
*comm0_data=d;
}
this function waits for data input on comm port 0.
unsigned int comm_in()
{
while( ((*comm_status) & 1) == 0 )
printf("waiting for comm in rdy\n");
return(*comm0_data);
}