--- a/kerneltest/e32test/iic/iic_psl/i2c.h Tue Feb 02 01:24:03 2010 +0200
+++ b/kerneltest/e32test/iic/iic_psl/i2c.h Fri Apr 16 16:24:37 2010 +0300
@@ -48,6 +48,8 @@
const TInt16 KI2cSlaveChannelIdBase = 0x1D00; // Arbitrary
+const TInt KI2cSlaveAsyncDelaySim = 20; // Arbitrary delay, for timer to simulate asynchronous processing
+
#ifdef MASTER_MODE
class DSimulatedIicBusChannelMasterI2c : public DIicBusChannelMaster
{
@@ -110,6 +112,16 @@
inline void SetChanNum(TInt8 aChanNum) {iChannelNumber = aChanNum;};
+ enum TAsyncEvent
+ {
+ ENoEvent = 0,
+ EAsyncChanCapture,
+ ERxWords,
+ ETxWords,
+ ERxTxWords
+ };
+ inline void ChanNotifyClient(TInt aTrigger) {NotifyClient(aTrigger);}
+
protected:
virtual void SendBusErrorAndReturn() {return;} // Not implemented in simulated PSL
@@ -132,7 +144,11 @@
TInt iBlockedTrigger;
TBool iBlockNotification;
+ TAsyncEvent iAsyncEvent;
+ TInt iRxTxTrigger;
+
NTimer iSlaveTimer; // Used to simulate an asynchronous capture operation
+ TSpinLock iEventSpinLock; // To serialise simulated bus events - Rx, Tx or Rx+Tx
};
#endif/*SLAVE_MODE*/