示例#1
0
TYPE 
main()
{
  STORAGE_CLASS TYPE input_data[2*N_FFT]; 
  int j;
  pin_down(&input_data[0]) ; 

  main16_inpsca(&input_data[0]);
  
  for(j=0;j<(2*N_FFT);j++)
	printf("input_data[%d]: %d\n",j,input_data[j]);
  
#ifdef __DEBUG__
  dump_to_file(&input_data[0]);
#endif

  return (0) ; 
  
}
示例#2
0
/** Send a pulse on the ENABLE line */
void _lcd_clk()
{
	pin_up(LCD_E);
	delay_ns(420);
	pin_down(LCD_E);
}
示例#3
0
/** Write an instruction byte */
void lcd_write_command(uint8_t bb)
{
	_lcd_wait_bf();
	pin_down(LCD_RS);  // select instruction register
	_lcd_write_byte(bb);    // send instruction byte
}
示例#4
0
/** Read BF & Address */
uint8_t lcd_read_bf_addr()
{
	pin_down(LCD_RS);
	return _lcd_read_byte();
}
示例#5
0
文件: startup.c 项目: alekob/tce
int main()
{
  int i, x, y, Out[240];
  int N, tmp;
  int temp1, temp2;
  int *Input, *Output;

  zero_table(&Out[0], 240);

  Input = In;
  Output = Out;

  pin_down(&In[0], &Out[0]);

  START_PROFILING;
  
  /* here the ANS check has to be performed. Because of complexity reasons 
    we skip this an assume to be in the startup mode already */
  
  /* now that the ANS sequence has been detected start Outputmitting signal A
    as long as no signal combination CC is detected. CC is detected when 
    two successive received samples are equal for the first time */  
  
  temp1 = *Input++;
  temp2 = *Input;
  
  while (temp1 != temp2) 
    {
      *Output++ = A;
      Input++;
      temp1 = *(Input);
      
      if (temp1 != temp2)
	{ 
	  *Output++ = A;
          Input++;
	  temp2 = *(Input);
	}
    }
  
  /*now CC has been detected, so continue sending A 64 times */
  
  for (i=0; i<64; i++)
    *Output++ = A;     
  
  /* while sending A 64 times ,new input samples have been detected which 
    do not influence the transmitted sequence */
  
  Input = Input + 64; 
  
  /* send C as long as no AA is detected (see above)
    it has to be stored by N how many samples C are transmitted. */
  N = 0;              
  temp1 = *Input++;   
  temp2 = *Input;     
  
  while (temp1 != temp2)
    {
      *Output++ = C;
      Input++;
      temp1 = *(Input);
      N++;
      
      if (temp1 != temp2)
	{
	  *Output++ = C;
          Input++;
	  temp2 = *(Input);
	  N++;
	}
    }
  
  /* Detection of the received sequence R1 starts here.
    Sequence R1 is detected when two 16-bit sequences match exactly.
    We assume that the sequence is already descrambled and decoded so that 
    it is only necessary to compare the last 8 symbols */
  
  i = 0;
  do {                 
    /* loop has to be executed at least once */  
    while (i<8)
      {
	Input++;
	(*(Input-8) == *(Input)) ? i++ : (i=0);
      }
    
    /* now we have detected two sequences of length 8. If these do not 
      match the R1 requirements, it becomes only necessary to compare
      one additional symbol */
    
    i=7;
    
    tmp = ((*(Input-7) == 0) && 
	   (*(Input-6) == 0) && 
	   ((*(Input-4) & 1) == 1)  &&
	   ((*(Input-2) & 1) == 1)  &&
	   ((*(Input) & 1) == 1));     
    
  } while (tmp == 0);           
  
  /* R1 includes the information concerning the possible data rates and 
    encoding schemes. These have to be identified */
  
  /* now that R1 has been detected, sequence S (AB) is transmitted N/2 times.
    N is the time that has been achieved above. */
  
  N = (N/2);  /*  We can save a few program steps if we don't have to 
    count N/2 on every cycle of the for loop.  */
  
  for (i=0; i <= N; i++) /* < replaced with <= because N is an int (value 31) */
    {
      *Output++ = A;
      *Output++ = B;
    }
  
  END_PROFILING;

  pin_down(&In[0], &Out[0]);

  return(0);
}