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