diff -r 578be2adaf3e -r 307f4279f433 Adaptation/GUID-2607CCFA-3D24-4716-A447-74304F861C44.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Adaptation/GUID-2607CCFA-3D24-4716-A447-74304F861C44.dita Fri Oct 15 14:32:18 2010 +0100 @@ -0,0 +1,490 @@ + + + + + +DSDIORegisterInterface +Class TutorialDescribes the DSDIORegisterInterface API class. +
Description

This +class provides the main client API between the SDIO implementation and the +rest of the system.

For portability reasons, it is recommended that +this class is allocated on behalf of the client by the appropriate function +class after the client has been registered with the SDIO function.

Unless +stated otherwise, all the register offsets are defined to be relative to offsets +within the SDIO function.

+ + + +

Header file

+

regifc.h

+
+ +

Source code file

+

regifc.cpp

+
+ +

Required libraries

+

EPBUSSDIO

+
+ +

Class declaration

+

class DSDIORegisterInterface: public DSDIOSession

+
+ + +
+
Read8()

The +function declaration for the Read8() method is:

IMPORT_C TInt Read8(TUint32 aReg, TUint8* aReadDataP);

Description

This method reads a single 8 bit value from the +specified register.

Parameters

+ + + +

TUint32 aReq

+

The Source register address.

+
+ +

TUint8* aReadDataP

+

The location of the byte to read into.

+
+ + +

Return value

+ + + +

TInt

+

The result of the operation. KErrNone if the operation was successful, +otherwise a system wide error code.

+
+ + +
+
Write8()

The +function declaration for the Write8() method is:

IMPORT_C TInt Write8(TUint32 aReg, TUint8 aWriteVal);

Description

This method writes a single 8 bit value to the +register specified.

Parameters

+ + + +

TUint32 aReg

+

The destination register address.

+
+ +

TUint8 aWriteVal

+

The 8 bit value to be written.

+
+ + +

Return value

+ + + +

TInt

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
Modify8()

The +function declaration for the Modify8() method is:

IMPORT_C TInt Modify8(TUint32 aReg, TUint8 aSet, TUint8 aClr); +

Description

This method performs a bitwise read-modify-write +operation on the specified register.

Parameters

+ + + +

TUint32 aReg

+

The destination register address.

+
+ +

TUint8 aSet

+

A bitmask of the values to be set.

+
+ +

TUint8 aClr

+

A bitmask of the values to be cleared.

+
+ + +

Return value

+ + + +

TInt

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
Modify8() with +read-after-write

The function declaration for the Modify8() with +read-after-write method is:

IMPORT_C TInt Modify8(TUint32 aReg, TUint8 aSet, TUint8 aClr, TUint8* aReadDataP);

Description

This method performs a bitwise read-modify-write operation on the +specified register.

Parameters

+ + + +

TUint32 aReg

+

The destination register address.

+
+ +

TUint8 aSet

+

A bitmask of the values to be set.

+
+ +

TUint8 aClr

+

A bitmask of the values to be cleared.

+
+ +

TUint8* aReadDataP

+

The address of the byte to read into. The result of the operation +is stored in this buffer.

+
+ + +

Return value

+ + + +

TInt

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
ReadMultiple8()

The +function declaration for the ReadMultiple8() method is:

IMPORT_C TInt ReadMultiple8(TUint32 aReg, TUint8* aDataP, TUint32 aLen); +

Description

This method reads the specified number +of bytes starting at the specified register offset.

Parameters

+ + + +

TUint32 aReg

+

The source register address.

+
+ +

TUint8* aDataP

+

The start address of the destination buffer.

+
+ +

TUint32 aLen

+

The number of bytes to be read.

+
+ + +

Return value

+ + + +

TInt

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
ReadMultiple8() +with auto-increment

The function declaration for the ReadMultiple8() +method with auto-increment is:

IMPORT_C TInt ReadMultiple8(TUint32 aReg, TUint8* aDataP, TUint32 aLen, TBool aAutoInc); +

Description

This method reads the specified number +of bytes starting at the specified register offset.

Parameters

+ + + +

TUint32 aReg

+

The source register address.

+
+ +

TUint8* aDataP

+

The start address of the destination buffer.

+
+ +

TUint32 aLen

+

The number of bytes that are to be read.

+
+ +

TBool aAutoInc

+

Enable or disable the auto-increment functionality.

+
+ + +

Return value

+ + + +

TInt

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
ReadMultiple8() +using shared chunks

The function declaration for the ReadMultiple8()method +using shared chunks is:

IMPORT_C TInt ReadMultiple8(TUint32 aReg, DChunk* aChunk, TUint32 aOffset, TUint32 aLen); +

Description

This method reads the specified number +of bytes starting at the specified register offset.

Parameters

+ + + +

TUint32 aReg

+

The source register address.

+
+ +

DChunk* aChunk

+

The chunk that hosts the destination buffer.

+
+ +

TUint32 aOffset

+

The offset from the start of the chunk to the start of the destination +buffer.

+
+ +

TUint32 aLen

+

The number of bytes to be read.

+
+ + +

Return value

+ + + +

TInt

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
ReadMultiple8() +with auto-increment using shared chunks

The function declaration +for the ReadMultiple8() method with auto-increment using +shared chunks is:

IMPORT_C TInt ReadMultiple8(TUint32 aReg, DChunk* aChunk, TUint32 aOffset, TUint32 aLen, TBool aAutoInc);

Description

This method reads the specified number of bytes +starting at the specified register offset.

Parameters

+ + + +

TUint32 aReg

+

The source register address.

+
+ +

DChunk* aChunk

+

The chunk that hosts the destination buffer.

+
+ +

TUint32 aOffset

+

The offset from the start of the chunk to the start of the destination +buffer.

+
+ +

TUint32 aLen

+

The number of bytes to be read.

+
+ +

TBool aAutoInc

+

Enable or disable the auto-increment functionality.

+
+ + +

Return value

+ + + +

TInt

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
WriteMultiple8()

The +function declaration for the WriteMultiple8() method is:

IMPORT_C TInt WriteMultiple8(TUint32 aReg, TUint8* aDataP, TUint32 aLen); +

Description

This method writes the specified length +of bytes starting at the specified register.

Parameters

+ + + +

TUint32 aReg

+

The destination register address.

+
+ +

TUint8* aDataP

+

The start address of the source buffer.

+
+ +

TUint32 aLen

+

The number of bytes to be written.

+
+ + +

Return value

+ + + +

TInt

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
WriteMultiple8() +with auto-increment

The function declaration for the WriteMultiple8() method +with auto-increment is:

IMPORT_C TInt WriteMultiple8(TUint32 aReg, TUint8* aDataP, TUint32 aLen, TBool aAutoInc); +

Description

This method writes the specified length +of bytes starting at the specified register.

Parameters

+ + + +

TUint32 aReg

+

The destination register address.

+
+ +

TUint8* aDataP

+

The start address of the source buffer.

+
+ +

TUint32 aLen

+

The number of bytes to be written.

+
+ +

TBool aAutoInc

+

Enable or disable the auto-increment functionality.

+
+ + +

Return value

+ + + +

TInt

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
WriteMultiple8() +using shared chunks

The function declaration for the WriteMultiple8() method +using shared chunks is:

IMPORT_C TInt WriteMultiple8(TUint32 aReg, DChunk* aChunk, TUint32 aOffset, TUint32 aLen); +

Description

This method writes the specified length +of bytes starting at the specified register.

Parameters

+ + + +

TUint32 aReg

+

The destination register address.

+
+ +

DChunk* aChunk

+

The chunk that hosts the source buffer.

+
+ +

TUint32 aOffset

+

The offset from the start of the chunk and the start address of +the source buffer.

+
+ +

TUint32 aLen

+

The number of bytes to be written.

+
+ + +

Return value

+ + + +

TInt

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
WriteMultiple8( +) with auto-increment using shared chunks

The function declaration +for the WriteMultiple8() method with autoincrement using +shared chunks is:

IMPORT_C TInt WriteMultiple8(TUint32 aReg, DChunk* aChunk, TUint32 aOffset, TUint32 aLen, TBool aAutoInc);

Description

This method writes the specified length of bytes +starting at the specified register.

Parameters

+ + + +

TUint32 aReg

+

The destination register address.

+
+ +

DChunk* aChunk

+

The chunk that hosts the source buffer.

+
+ +

TUint32 aOffset

+

The offset from the start of the chunk and the start address of +the source buffer.

+
+ +

TUint32 aLen

+

The number of bytes to be written.

+
+ +

TBool aAutoInc

+

Enable or disable the auto-increment functionality.

+
+ + +

Return value

+ + + +

TInt

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
SetAsync()

The +function declaration for the SetAsync() method is:

IMPORT_C TBool SetAsync(TMMCCallBack& aCallback); +

Description

This function allows the user to disable +the synchronous nature of the DSDIORegInterface class, by using the specified +callback function to indicate the completion of an operation.

Parameters

+ + + +

TMMCCallback& aCallback

+

Reference to the callback function.

+
+ + +

Return value

+ + + +

TBool

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
SetSync()

The +function declaration for the SetSync() method is:

IMPORT_C TBool SetSync();

Description

Allows the synchronous nature of the DSDIORegInterface class to be enabled.

When +the synchronous nature of the DSDIORegInterface class is enabled, then completion +of an operation is specified by waiting on a semaphore.

Parameters

None

Return +value

+ + + +

TBool

+

The result of the operation. KErrNone if the operation +was successful, otherwise a system wide error code.

+
+ + +
+
\ No newline at end of file