kernel/eka/include/drivers/iic_channel.h
branchRCL_3
changeset 44 3e88ff8f41d5
parent 43 c1f20ce4abcf
equal deleted inserted replaced
43:c1f20ce4abcf 44:3e88ff8f41d5
    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 = 0x7E; // Maximum allowable time in milliseconds for a Slave channel to wait for a response
    43 const static TInt8 KMaxWaitTime = 0x21; // 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 // In particular, for the simulated master timeout tests.
    50 const TInt KSlaveDefMWaitTime = 32;
    51 const TInt KSlaveDefMWaitTime = 125;
    51 const TInt KSlaveDefCWaitTime = 16;
    52 const TInt KSlaveDefCWaitTime = 124;
       
    53 
       
    54 #else
    52 #else
    55 const TInt KSlaveDefMWaitTime = 1;	// Default wait time for Master timeout. PSL can use SetMasterWaitTime to override.
    53 const TInt KSlaveDefMWaitTime = 1;	// Default wait time for Master timeout. PSL can use SetMasterWaitTime to override.
    56 const TInt KSlaveDefCWaitTime = 1;	// Default wait time for Client timeout. PSL can use SetClientWaitTime to override.
    54 const TInt KSlaveDefCWaitTime = 1;	// Default wait time for Client timeout. PSL can use SetClientWaitTime to override.
    57 #endif
    55 #endif
    58 
    56 
   120 protected:
   118 protected:
   121 #ifdef _DEBUG
   119 #ifdef _DEBUG
   122 	inline void DumpChannel();
   120 	inline void DumpChannel();
   123 #endif
   121 #endif
   124 protected:
   122 protected:
       
   123 	NTimer iTimeoutTimer;	// timeout timer
   125 	TInt8 iChannelNumber;	// this is the Key for ordering channels in the array
   124 	TInt8 iChannelNumber;	// this is the Key for ordering channels in the array
   126 	TUint8 iFlags;			// combination of TChannelType, TChannelDuplex and TBusType
   125 	TUint8 iFlags;			// combination of TChannelType, TChannelDuplex and TBusType
   127 	TInt8 iSpare1;
   126 	TInt8 iSpare1;
   128 	TInt8 iSpare2;
   127 	TInt8 iSpare2;
   129 private:
   128 private:
   288 	@publishedPartner
   287 	@publishedPartner
   289 	@prototype 9.6
   288 	@prototype 9.6
   290 
   289 
   291 	Function to cancel the timer to check the Slave responsiveness.
   290 	Function to cancel the timer to check the Slave responsiveness.
   292 
   291 
   293 	Call either in a thread or an IDFC context. Do not call from an ISR.
       
   294 
       
   295 	*/
   292 	*/
   296 	void CancelTimeOut();
   293 	void CancelTimeOut();
   297 
   294 
   298 	// Methods to make private data of TIicBusTransaction object accessible to derivatives of this class
   295 	// Methods to make private data of TIicBusTransaction object accessible to derivatives of this class
   299 	/**
   296 	/**
   499 	TIicBusTransaction* iCurrentTransaction;	// Pointer to current fragment of a multiple transaction
   496 	TIicBusTransaction* iCurrentTransaction;	// Pointer to current fragment of a multiple transaction
   500 
   497 
   501 	NFastMutex iTransactionQLock;
   498 	NFastMutex iTransactionQLock;
   502 
   499 
   503 	TDfc* iSlaveTimeoutDfc;
   500 	TDfc* iSlaveTimeoutDfc;
   504 
       
   505 	NTimer iTimeoutTimer;	// timeout timer
       
   506 
   501 
   507 	TInt16 iTransCount; // Count of pending transactions
   502 	TInt16 iTransCount; // Count of pending transactions
   508 	TInt8 iChannelReady;
   503 	TInt8 iChannelReady;
   509 	TInt8 iSpare1;
   504 	TInt8 iSpare1;
   510 
   505 
   655 	Function reserved for future use
   650 	Function reserved for future use
   656 	*/
   651 	*/
   657 	virtual TInt Spare1(TInt aVal, TAny* aPtr1, TAny* aPtr2);
   652 	virtual TInt Spare1(TInt aVal, TAny* aPtr1, TAny* aPtr2);
   658 
   653 
   659 	// Interface to TIicBusSlaveCallback
   654 	// Interface to TIicBusSlaveCallback
   660 	//
   655 	// channel-specific function to process data received/transmitted (called from NotifyClient or DFC queued from it)
   661 	// ProcessData is a channel-specific function to be provided by the PSL. Its purpose is to process
   656 	// Must fill in the aCb object's iReturn, iRxWords and/or iTxWords using the appropriate funtions
   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 	//
       
   667 	/**
   657 	/**
   668 	@publishedPartner
   658 	@publishedPartner
   669 	@prototype 9.6
   659 	@prototype 9.6
   670 	Function invoked when an asynchronous event occurs on the Slave channel. Implemented by the PSL.
   660 	Function invoked when an asynchronous event occurs on the Slave channel. Implemented by the PSL.
   671     @param aTrigger		Argument to indicate the type of event that occurred
   661     @param aTrigger		Argument to indicate the type of event that occurred
   853 	TInt8 iReqTrig;			// Represents the trigger required by the Client (bitmask from TIicBusSlaveTrigger).
   843 	TInt8 iReqTrig;			// Represents the trigger required by the Client (bitmask from TIicBusSlaveTrigger).
   854 	TInt8 iAccumTrig;		// Represents the events accumulated during the current trigger period
   844 	TInt8 iAccumTrig;		// Represents the events accumulated during the current trigger period
   855 	TInt16 iSpare3;
   845 	TInt16 iSpare3;
   856 
   846 
   857 	TSpinLock iSpinLock;
   847 	TSpinLock iSpinLock;
   858 	NTimer iTimeoutTimer;	// timeout timer
       
   859 	TAny* iReserved1;
   848 	TAny* iReserved1;
   860 	TAny* iReserved2;
   849 	TAny* iReserved2;
   861 
   850 
   862 	friend class DIicBusChannelMasterSlave;
   851 	friend class DIicBusChannelMasterSlave;
   863 	friend class DIicBusController; // For static method DIicBusController::DeRegisterChannel
   852 	friend class DIicBusController; // For static method DIicBusController::DeRegisterChannel