keil_examples/SSP/ssptest.c
/*****************************************************************************
** Function name:		LoopbackTest
**
** Descriptions:		Loopback test
**				
** parameters:			None
** Returned value:		None
** 
*****************************************************************************/
Function name:         LoopbackTest
Descriptions:          Loopback test

None
Returned value:                None
Function name : LoopbackTest Descriptions : Loopback test None Returned value : None
void LoopbackTest( uint32_t portnum, uint32_t location )
{
  uint32_t i;
#if !USE_CS
  SSP_SSELToggle( portnum, 0 );
#endif
  i = 0;
  while ( i <= SSP_BUFSIZE )
  {
	SSPSend( portnum, (uint8_t *)&src_addr[i], FIFOSIZE );
	SSPReceive( portnum, (uint8_t *)&dest_addr[i], FIFOSIZE );
	i += FIFOSIZE;
  }
#if !USE_CS
  SSP_SSELToggle( portnum, 1 );
#endif
  for ( i = 0; i < SSP_BUFSIZE; i++ )
  {
	if ( src_addr[i] != dest_addr[i] )
	{
	  while( 1 );			
	}
  }
  return;
}
void LoopbackTest ( uint32_t portnum , uint32_t location ) { uint32_t i ; #if ! USE_CS SSP_SSELToggle ( portnum , 0 ) ; #endif i = 0 ; while ( i <= SSP_BUFSIZE ) { SSPSend ( portnum , ( uint8_t * ) & src_addr [ i ] , FIFOSIZE ) ; SSPReceive ( portnum , ( uint8_t * ) & dest_addr [ i ] , FIFOSIZE ) ; i += FIFOSIZE ; } #if ! USE_CS SSP_SSELToggle ( portnum , 1 ) ; #endif for ( i = 0 ; i < SSP_BUFSIZE ; i ++ ) { if ( src_addr [ i ] != dest_addr [ i ] ) { while ( 1 ) ; } } return ; }
Function name:         LoopbackTest
Descriptions:          Loopback test
Function name : LoopbackTest Descriptions : Loopback test
/* Set SSEL pin to output low. */ /* to check the RXIM and TXIM interrupt, I send a block data at one time 
	based on the FIFOSIZE(8). */ /* If RX interrupt is enabled, below receive routine can be
	also handled inside the ISR. */ /* Set SSEL pin to output high. */ /* verifying write and read data buffer. */ /* Verification failed */