Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This file defines the interface provided by the driver to the user.
15 // It will be included both in the application (user) and the driver (kernel).
16 // This file typically defines the RBusLogicalChannel derived class that will
17 // inturn provide the driver API to the user application.
18 // ifndef __EXDMA_H__ will resolve the multiple inclusion of this header
19 // file in different source files. If the file is already included, then the
20 // following switch will not re-include the file.
29 // e32ver.h (for KE32BuildVersionNumber), e32cmn.h and e32std.h are already
30 // included in d32comm.h and hence not repeating here.
34 // Literal string descriptor constants for driver name. These descriptors
35 // are used by the driver to associate a name for registering to the
36 // Symbian OS. LDD will have a name to associate with.
38 _LIT(KDriverName, "d_exdma");
40 // Internal loopback modes
41 const TInt KIntLoopbackDisable=0;
42 const TInt KIntLoopbackEnable=1;
45 User interface for tutorial driver
47 RExDriverChannel class is derived from the RBusLogicalChannel and provides
48 the interface for user. User application accesses the driver functionality
51 class RExDriverChannel:public RBusLogicalChannel
54 // TVer is an enumeration for the version related information. Driver will
55 // need to set and validate version related information while installing.
56 // Version numbers are validated to check if this version of driver as
57 // expected by the client/user application
61 EUartMajorVersionNumber=1, // Major number for driver
62 EUartMinorVersionNumber=0, // Minor number for device
63 EUartBuildVersionNumber=KE32BuildVersionNumber // Build version number for driver
65 // TControl is the enumeration for control and synchronous messages
66 // supported by the driver. User application can request for any of
67 // the following control messages to the driver through DoControl()
68 // API provided by the RBusLogicalChannel class.
70 enum TControl // Synchronous control messages used with DoControl()
72 EControlCaps, // Get the channel capabilities on uart
73 EControlSetConfig, // Configure the device (uart)
74 EControlSetIntLoopback // Configure the device's internal looback mode
76 // TRequest is the enumeration for asynchronous requests supported
77 // by the driver. User application can request for any of the
78 // following messages to the driver through DoRequest() API provided
79 // by the RBusLogicalChannel class.
81 enum TRequest // Asynchronous request messages used with DoRequest()
83 ERequestTransmitData, // Transmit data over the device (uart)
84 ERequestReceiveData, // Receive the data from the device (uart)
85 ENumRequests, // Total number of supported asynchrnous requests
86 EAllRequests = (1<<ENumRequests)-1
89 // VersionRequired() will provide the version of the driver. This is made inline
90 // function to initialize the TVersion object with driver's Major,Minor and Build
91 // version numbers. This is later used to validate the driver version.
93 inline static TVersion VersionRequired();
95 // These functions are wrappers to the RBusLogicalChannel API and are inline.
97 inline TInt Open(TInt aUnit); // Open the channel to the driver
98 inline TInt Caps(TDes8& aCaps); // Get the channel capabilities
99 inline TInt SetIntLoopback(const TInt aMode); // Configure the device's internal loopback
100 inline TInt SetConfig(const TDesC8& aConfig); // Configure device (UART)
101 inline TInt TransmitData(TRequestStatus& aStatus, const TDesC8& aData); // Send data on device (UART)
102 inline TInt ReceiveData(TRequestStatus& aStatus, TDes8& aData); // Receive data on device (UART)
103 inline void CancelTransmit(); // Cancel pending asynchronous Tx requests
104 inline void CancelReceive(); // Cancel pending asynchronous Rx requests
107 // All inline functions implementation is provided in a seperate inline file. This file
108 // is included here to add the inline implementations. Note:these inline functions
109 // implementaion is also available only in user space.
113 #endif // __EXDMA_H__