kernel/eka/include/drivers/iic_channel.h
changeset 90 947f0dc9f7a8
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
52:2d65c2f76d7b 90:947f0dc9f7a8
    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 
   118 protected:
   120 protected:
   119 #ifdef _DEBUG
   121 #ifdef _DEBUG
   120 	inline void DumpChannel();
   122 	inline void DumpChannel();
   121 #endif
   123 #endif
   122 protected:
   124 protected:
   123 	NTimer iTimeoutTimer;	// timeout timer
       
   124 	TInt8 iChannelNumber;	// this is the Key for ordering channels in the array
   125 	TInt8 iChannelNumber;	// this is the Key for ordering channels in the array
   125 	TUint8 iFlags;			// combination of TChannelType, TChannelDuplex and TBusType
   126 	TUint8 iFlags;			// combination of TChannelType, TChannelDuplex and TBusType
   126 	TInt8 iSpare1;
   127 	TInt8 iSpare1;
   127 	TInt8 iSpare2;
   128 	TInt8 iSpare2;
   128 private:
   129 private:
   287 	@publishedPartner
   288 	@publishedPartner
   288 	@prototype 9.6
   289 	@prototype 9.6
   289 
   290 
   290 	Function to cancel the timer to check the Slave responsiveness.
   291 	Function to cancel the timer to check the Slave responsiveness.
   291 
   292 
       
   293 	Call either in a thread or an IDFC context. Do not call from an ISR.
       
   294 
   292 	*/
   295 	*/
   293 	void CancelTimeOut();
   296 	void CancelTimeOut();
   294 
   297 
   295 	// Methods to make private data of TIicBusTransaction object accessible to derivatives of this class
   298 	// Methods to make private data of TIicBusTransaction object accessible to derivatives of this class
   296 	/**
   299 	/**
   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