38 const static TInt KBusTypeMask = 0x07<<KBusTypeShift; // number of buses may grow in future |
38 const static TInt KBusTypeMask = 0x07<<KBusTypeShift; // number of buses may grow in future |
39 const static TInt KChannelDuplexShift= 5; |
39 const static TInt KChannelDuplexShift= 5; |
40 const static TInt KChannelDuplexMask = 0x01<<KChannelDuplexShift; |
40 const static TInt KChannelDuplexMask = 0x01<<KChannelDuplexShift; |
41 const static TInt16 KTransCountMsBit = (TInt16)((TUint16)0x8000); |
41 const static TInt16 KTransCountMsBit = (TInt16)((TUint16)0x8000); |
42 |
42 |
43 const static TInt8 KMaxWaitTime = 0x21; // Maximum allowable time in milliseconds for a Slave channel to wait for a response |
43 const static TInt8 KMaxWaitTime = 0x7E; // Maximum allowable time in milliseconds for a Slave channel to wait for a response |
44 // (from Master or Client). This constant is used to limit run-time selected values |
44 // (from Master or Client). This constant is used to limit run-time selected values |
45 // for timeouts. The value stated here is semi-arbitrary. |
45 // for timeouts. The value stated here is semi-arbitrary. |
46 |
46 |
47 #ifdef IIC_SIMULATED_PSL |
47 #ifdef IIC_SIMULATED_PSL |
48 // In a real system, the following timeout values are likely to be excessive. However, they are available |
48 // In a real system, the following timeout values are likely to be excessive. However, they are available |
49 // for use in the test framework, to account for the processing overhead. |
49 // for use in the test framework, to account for the processing overhead. |
50 const TInt KSlaveDefMWaitTime = 32; |
50 // In particular, for the simulated master timeout tests. |
51 const TInt KSlaveDefCWaitTime = 16; |
51 const TInt KSlaveDefMWaitTime = 125; |
|
52 const TInt KSlaveDefCWaitTime = 124; |
|
53 |
52 #else |
54 #else |
53 const TInt KSlaveDefMWaitTime = 1; // Default wait time for Master timeout. PSL can use SetMasterWaitTime to override. |
55 const TInt KSlaveDefMWaitTime = 1; // Default wait time for Master timeout. PSL can use SetMasterWaitTime to override. |
54 const TInt KSlaveDefCWaitTime = 1; // Default wait time for Client timeout. PSL can use SetClientWaitTime to override. |
56 const TInt KSlaveDefCWaitTime = 1; // Default wait time for Client timeout. PSL can use SetClientWaitTime to override. |
55 #endif |
57 #endif |
56 |
58 |
496 TIicBusTransaction* iCurrentTransaction; // Pointer to current fragment of a multiple transaction |
499 TIicBusTransaction* iCurrentTransaction; // Pointer to current fragment of a multiple transaction |
497 |
500 |
498 NFastMutex iTransactionQLock; |
501 NFastMutex iTransactionQLock; |
499 |
502 |
500 TDfc* iSlaveTimeoutDfc; |
503 TDfc* iSlaveTimeoutDfc; |
|
504 |
|
505 NTimer iTimeoutTimer; // timeout timer |
501 |
506 |
502 TInt16 iTransCount; // Count of pending transactions |
507 TInt16 iTransCount; // Count of pending transactions |
503 TInt8 iChannelReady; |
508 TInt8 iChannelReady; |
504 TInt8 iSpare1; |
509 TInt8 iSpare1; |
505 |
510 |
650 Function reserved for future use |
655 Function reserved for future use |
651 */ |
656 */ |
652 virtual TInt Spare1(TInt aVal, TAny* aPtr1, TAny* aPtr2); |
657 virtual TInt Spare1(TInt aVal, TAny* aPtr1, TAny* aPtr2); |
653 |
658 |
654 // Interface to TIicBusSlaveCallback |
659 // Interface to TIicBusSlaveCallback |
655 // channel-specific function to process data received/transmitted (called from NotifyClient or DFC queued from it) |
660 // |
656 // Must fill in the aCb object's iReturn, iRxWords and/or iTxWords using the appropriate funtions |
661 // ProcessData is a channel-specific function to be provided by the PSL. Its purpose is to process |
|
662 // data received/transmitted (called from NotifyClient or DFC queued from it). It Must fill in the |
|
663 // aCb object's iReturn, iRxWords and/or iTxWords using the appropriate functions |
|
664 // |
|
665 // The functions UpdateReqTrig, StartTimerByState and StopTimer are for use by the PIL, only. |
|
666 // |
657 /** |
667 /** |
658 @publishedPartner |
668 @publishedPartner |
659 @prototype 9.6 |
669 @prototype 9.6 |
660 Function invoked when an asynchronous event occurs on the Slave channel. Implemented by the PSL. |
670 Function invoked when an asynchronous event occurs on the Slave channel. Implemented by the PSL. |
661 @param aTrigger Argument to indicate the type of event that occurred |
671 @param aTrigger Argument to indicate the type of event that occurred |
843 TInt8 iReqTrig; // Represents the trigger required by the Client (bitmask from TIicBusSlaveTrigger). |
853 TInt8 iReqTrig; // Represents the trigger required by the Client (bitmask from TIicBusSlaveTrigger). |
844 TInt8 iAccumTrig; // Represents the events accumulated during the current trigger period |
854 TInt8 iAccumTrig; // Represents the events accumulated during the current trigger period |
845 TInt16 iSpare3; |
855 TInt16 iSpare3; |
846 |
856 |
847 TSpinLock iSpinLock; |
857 TSpinLock iSpinLock; |
|
858 NTimer iTimeoutTimer; // timeout timer |
848 TAny* iReserved1; |
859 TAny* iReserved1; |
849 TAny* iReserved2; |
860 TAny* iReserved2; |
850 |
861 |
851 friend class DIicBusChannelMasterSlave; |
862 friend class DIicBusChannelMasterSlave; |
852 friend class DIicBusController; // For static method DIicBusController::DeRegisterChannel |
863 friend class DIicBusController; // For static method DIicBusController::DeRegisterChannel |