kerneltest/e32test/iic/iic_psl/spi.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
equal deleted inserted replaced
256:c1f20ce4abcf 257:3e88ff8f41d5
    17 
    17 
    18 #ifdef IIC_INSTRUMENTATION_MACRO
    18 #ifdef IIC_INSTRUMENTATION_MACRO
    19 #include <drivers/iic_trace.h>
    19 #include <drivers/iic_trace.h>
    20 #endif
    20 #endif
    21 
    21 
    22 #ifndef STANDALONE_CHANNEL
       
    23 #define NUM_CHANNELS 4 // Arbitrary
    22 #define NUM_CHANNELS 4 // Arbitrary
    24 
    23 
    25 // Macros to be updated(?) with interaction with Configuration Repository
    24 // Macros to be updated(?) with interaction with Configuration Repository
    26 const TInt KChannelTypeArray[NUM_CHANNELS] = {DIicBusChannel::EMaster, DIicBusChannel::EMaster, DIicBusChannel::ESlave, DIicBusChannel::EMaster};
    25 const TInt KChannelTypeArray[NUM_CHANNELS] = {DIicBusChannel::EMaster, DIicBusChannel::EMaster, DIicBusChannel::ESlave, DIicBusChannel::EMaster};
    27 #define CHANNEL_TYPE(n) (KChannelTypeArray[n])	
    26 #define CHANNEL_TYPE(n) (KChannelTypeArray[n])	
    28 const DIicBusChannel::TChannelDuplex KChannelDuplexArray[NUM_CHANNELS] = {DIicBusChannel::EHalfDuplex, DIicBusChannel::EHalfDuplex, DIicBusChannel::EHalfDuplex, DIicBusChannel::EFullDuplex};
    27 const DIicBusChannel::TChannelDuplex KChannelDuplexArray[NUM_CHANNELS] = {DIicBusChannel::EHalfDuplex, DIicBusChannel::EHalfDuplex, DIicBusChannel::EHalfDuplex, DIicBusChannel::EFullDuplex};
    29 #define CHANNEL_DUPLEX(n) (KChannelDuplexArray[n]) 
    28 #define CHANNEL_DUPLEX(n) (KChannelDuplexArray[n]) 
    30 #endif/*STANDALONE_CHANNEL*/
       
    31 
    29 
    32 #ifdef LOG_SPI
    30 #ifdef LOG_SPI
    33 #define SPI_PRINT(str) Kern::Printf str
    31 #define SPI_PRINT(str) Kern::Printf str
    34 #else
    32 #else
    35 #define SPI_PRINT(str)
    33 #define SPI_PRINT(str)
   122 	if(size>maxLen)
   120 	if(size>maxLen)
   123 	   size=maxLen;
   121 	   size=maxLen;
   124 	aDes.Copy((TUint8*)&caps,size);
   122 	aDes.Copy((TUint8*)&caps,size);
   125     }
   123     }
   126 
   124 
   127 #ifndef STANDALONE_CHANNEL
       
   128 // supported channels for this implementation
   125 // supported channels for this implementation
   129 static DIicBusChannel* ChannelPtrArray[NUM_CHANNELS];
   126 static DIicBusChannel* ChannelPtrArray[NUM_CHANNELS];
   130 #endif
       
   131 
   127 
   132 //DECLARE_EXTENSION_WITH_PRIORITY(BUS_IMPLMENTATION_PRIORITY)	
   128 //DECLARE_EXTENSION_WITH_PRIORITY(BUS_IMPLMENTATION_PRIORITY)	
   133 DECLARE_STANDARD_PDD()		// SPI test driver to be explicitly loaded as an LDD, not kernel extension
   129 DECLARE_STANDARD_PDD()		// SPI test driver to be explicitly loaded as an LDD, not kernel extension
   134 	{
   130 	{
   135 	SPI_PRINT(("\n\nSPI PDD, channel creation loop follows ...\n"));
   131 	SPI_PRINT(("\n\nSPI PDD, channel creation loop follows ...\n"));
   489 	}
   485 	}
   490 
   486 
   491 TInt DSimulatedIicBusChannelMasterSpi::DoSimulatedTransaction()
   487 TInt DSimulatedIicBusChannelMasterSpi::DoSimulatedTransaction()
   492 	{
   488 	{
   493 	TInt r = AsynchStateMachine(EHwTransferDone);
   489 	TInt r = AsynchStateMachine(EHwTransferDone);
   494 	CancelTimeOut();
   490 	if(iTimeoutTimer.Cancel() == FALSE)
       
   491 		{
       
   492 		SPI_PRINT(("timer is not cancelled"));
       
   493 		}
   495 	return r;
   494 	return r;
   496 	}
   495 	}
   497 
   496 
   498 TInt DSimulatedIicBusChannelMasterSpi::DoHwPreparation()
   497 TInt DSimulatedIicBusChannelMasterSpi::DoHwPreparation()
   499 	{
   498 	{