sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // This file defines the interface provided by the driver to the user. sl@0: // It will be included both in the application (user) and the driver (kernel). sl@0: // This file typically defines the RBusLogicalChannel derived class that will sl@0: // inturn provide the driver API to the user application. sl@0: // ifndef __EXINT_H__ will resolve the multiple inclusion of this header sl@0: // file in different source files. If the file is already included, then the sl@0: // following switch will not re-include the file. sl@0: // sl@0: // sl@0: sl@0: #ifndef __EXINT_H__ sl@0: #define __EXINT_H__ sl@0: sl@0: // include files sl@0: // sl@0: // e32ver.h (for KE32BuildVersionNumber), e32cmn.h and e32std.h are already sl@0: // included in d32comm.h and hence not repeating here. sl@0: // sl@0: #include sl@0: sl@0: // Literal string descriptor constants for driver name. These descriptors sl@0: // are used by the driver to associate a name for registering to the sl@0: // Symbian OS. LDD will have a name to associate with. sl@0: // sl@0: _LIT(KDriverName, "d_exint"); sl@0: sl@0: // Loopback modes sl@0: const TInt KIntLoopbackDisable=0; sl@0: const TInt KIntLoopbackEnable=1; sl@0: sl@0: /** sl@0: User interface for tutorial driver sl@0: sl@0: RExDriverChannel class is derived from the RBusLogicalChannel and provides sl@0: the interface for user. User application accesses the driver functionality sl@0: using only these API. sl@0: */ sl@0: class RExDriverChannel:public RBusLogicalChannel sl@0: { sl@0: public: sl@0: // TVer is an enumeration for the version related information. Driver will sl@0: // need to set and validate version related information while installing. sl@0: // Version numbers are validated to check if this version of driver as sl@0: // expected by the client/user application sl@0: // sl@0: enum TVer sl@0: { sl@0: EUartMajorVersionNumber=1, // Major number for driver sl@0: EUartMinorVersionNumber=0, // Minor number for device sl@0: EUartBuildVersionNumber=KE32BuildVersionNumber // Build version number for driver sl@0: }; sl@0: // TControl is the enumeration for control and synchronous messages sl@0: // supported by the driver. User application can request for any of sl@0: // the following control messages to the driver through DoControl() sl@0: // API provided by the RBusLogicalChannel class. sl@0: // sl@0: enum TControl // Synchronous control messages used with DoControl() sl@0: { sl@0: EControlCaps, // Get the channel capabilities on uart sl@0: EControlSetConfig, // Configure the device (uart) sl@0: EControlSetIntLoopback // Configure the device's internal looback mode sl@0: }; sl@0: // TRequest is the enumeration for asynchronous requests supported sl@0: // by the driver. User application can request for any of the sl@0: // following messages to the driver through DoRequest() API provided sl@0: // by the RBusLogicalChannel class. sl@0: // sl@0: enum TRequest // Asynchronous request messages used with DoRequest() sl@0: { sl@0: ERequestTransmitData, // Transmit data over the device (uart) sl@0: ERequestReceiveData, // Receive the data from the device (uart) sl@0: ENumRequests, sl@0: EAllRequests = (1<